ml-dataset-iris
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

dataset-iris

NPM version build status Test coverage npm download

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

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ml-dataset-iris

Weekly Downloads

188

Version

1.2.1

License

MIT

Unpacked Size

78.2 kB

Total Files

24

Last publish

Collaborators

  • stropitek
  • targos
  • lpatiny
  • mljs-bot
  • maasencioh
  • jeffersonh44
  • andcastillo