How to use the ml-dataset-iris.getDataset function in ml-dataset-iris

To help you get started, we’ve selected a few ml-dataset-iris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mljs / libsvm / tools / iris.js View on Github external
'use strict';
const fs = require('fs');
const path = require('path');
const data = require('ml-dataset-iris').getDataset();
const distinctClasses = require('ml-dataset-iris').getDistinctClasses();
data.forEach(d => {
    d[4] = distinctClasses.indexOf(d[4]);
});
const str = data.map(d => d.join(' ')).join('\n');
fs.writeFileSync(path.resolve(__dirname, '../benchmark/data.txt'), str);

ml-dataset-iris

Iris flower data set

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages