ml-dataset-iris
v1.2.1
Published
Iris flower data set
Downloads
314
Keywords
Readme
dataset-iris
Iris flower data set.
Installation
$ npm i ml-dataset-iris
Usage
import {
getClasses,
getClassesAsNumber,
getCrossValidationSets,
getDataset,
getDistinctClasses,
getNumbers,
} from 'ml-dataset-iris';
const dataset = getDataset();
console.log(dataset[0]) // [5.1, 3.5, 1.4, 0.2, 'setosa']
const numbers = getNumbers();
console.log(numbers[0]) // [5.1, 3.5, 1.4, 0.2]
const classes = getClasses();
console.log(classes[0]) // setosa
const classes = getClassesAsNumber();
console.log(classes[0]) // 0
console.log(classes[50]) // 1
console.log(classes[100]) // 2
const distinctClasses = iris.getDistinctClasses();
console.log(distinctClasses) // ['setosa', 'versicolor', 'virginica']
const cvSetsByFolds = iris.getCrossValidationSets(7, { idx: 1, by: 'folds' });
console.log(cvSetsByFolds.length) // 7