Skip to content
Snippets Groups Projects
Commit def89aab authored by LHOUTELLIER Maël's avatar LHOUTELLIER Maël
Browse files

Api noclass

parent 469fe1a0
Branches
No related tags found
No related merge requests found
File moved
{
"chess": {
"noclasses": false,
"threshold": [0.3, 0.2, 0.1]
},
"hepatitis": {
"noclasses": false,
"threshold": [0.2, 0.1, 0.05]
},
"kr_vs_kp": {
"noclasses": false,
"threshold": [0.3, 0.2]
},
"connect": {
"noclasses": false,
"threshold": [0.18, 0.15, 0.1]
},
"heart_cleveland": {
"noclasses": false,
"threshold": [0.1, 0.08, 0.06]
},
"splice1": {
"noclasses": false,
"threshold": [0.1, 0.05, 0.02]
},
"mushroom": {
"noclasses": false,
"threshold": [0.01, 0.008, 0.005]
},
"t40": {
"noclasses": true,
"threshold": [0.08, 0.05, 0.01]
},
"pumsb": {
"noclasses": false,
"threshold": [0.8, 0.7]
},
"t10": {
"noclasses": true,
"threshold": [0.005, 0.0025]
},
"bms1": {
"noclasses": true,
"threshold": [0.001, 0.0005]
},
"retail": {
"noclasses": true,
"threshold": [0.004, 0.002]
},
"iris": {
"classes": false,
"threshold": [0.02, 0.01]
},
"zoo": {
"noclasses": false,
"threshold": [0.02, 0.01]
}
}
const colors = function (app, fs) {
const file = require('./file.js')
const pathColors = __dirname + '/../data/colors.json'
const pathColors = __dirname + '/../config/colors.json'
app.get('/colors', (req, res) => {
file.readFile(
......
......@@ -3,6 +3,8 @@ const datasets = function (app, fs) {
const pathDatasets = __dirname + '/../datasets/'
const dataExtention = 'dat'
const noClassesPath = './config/noclasses.json'
app.get('/datasets', (req, res) => {
fs.readdir(pathDatasets, (err, files) => {
const datasetsList = []
......@@ -15,6 +17,24 @@ const datasets = function (app, fs) {
res.send(datasetsList)
})
})
app.get('/datasets/:name/noclasses', (req, res) => {
file.readFile(
fs,
function (data) {
const name = req.params['name']
console.log(name)
console.log(data)
if (name in data) {
res.send({ noclasses: data[name].noclasses })
} else {
res.send({ noclasses: false })
}
},
true,
noClassesPath,
)
})
}
module.exports = datasets
......@@ -36,7 +36,7 @@ async function createWindow() {
function createBackgroundProcess() {
console.log(__dirname)
const serverProcess = fork(path.join(path.dirname(__dirname), 'api', 'index.js'))
const serverProcess = fork('./ressources/api/index.js') // path.join(path.dirname(__dirname), 'api', 'index.js'))
serverProcess.on('message', (msg) => {
console.log(msg)
......
......@@ -3,7 +3,7 @@
<div id="dataSetFilter" class="divBlock">
<h2>DataSet</h2>
<h3 class="needed">Dataset's path ( -d )</h3>
<v-select v-model="dataSetPath" :items="datasets" />
<v-select v-model="dataSetPath" :items="datasets" @change="LoadNoClass()" />
<h3>Choose dataSet format ( --dat )</h3>
......@@ -12,7 +12,7 @@
<v-radio type="radio" label="Transactionnal" value="Transactionnal" />
</v-radio-group>
<v-checkbox v-model="dataSetClassTransaction" @click="checkNoClasses()" label="No classes ( --nc )" />
<v-checkbox v-model="dataSetClassTransaction" @click="checkNoClasses()" label="No classes ( --nc )" :disabled="!dataSetPath || datasetNoClass" />
</div>
<div id="patternFilter" class="divBlock">
......@@ -100,6 +100,7 @@ export default {
name: 'NouvelleAnalyse',
data() {
return {
datasetNoClass: true,
datasets: [],
dataSetFormat: 'Binary', // ?
dataSetClassTransaction: false, // ?
......@@ -128,6 +129,14 @@ export default {
}
},
methods: {
async LoadNoClass() {
await ApiSkyppattern.get(`/datasets/${this.dataSetPath}/noclasses`).then((response) => {
this.datasetNoClass = response.data.noclasses
if (this.datasetNoClass) {
this.noclasses = true
}
})
},
onMeasureLenght() {
if (!this.withPatternMeasureLength) {
this.constraintMinLength = ''
......@@ -298,6 +307,7 @@ export default {
this.refreshDatasets().then(() => {
if (this.datasets[0]) {
this.dataSetPath = this.datasets[0] // initialise avec une valeur
this.LoadNoClass()
}
})
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment