CSV Format

Plain comma-separated values — the Explorer infers attribute types automatically from the data.

Format


CSV files must have a header row as the first line. Column names become attribute names. The last column is treated as the class attribute. No special declarations are required — the parser infers types from the values.

Example


sepal_length,sepal_width,petal_length,petal_width,species 5.1,3.5,1.4,0.2,setosa 4.9,3.0,1.4,0.2,setosa 7.0,3.2,4.7,1.4,versicolor 6.3,3.3,6.0,2.5,virginica

Behavior


Type inference: A column is treated as numeric if every non-empty value parses as a finite number; otherwise it is treated as nominal.

Missing values: Empty cells are counted during preprocessing and receive a maximum-distance penalty during classification and clustering.

Class attribute: The last column is always used as the class. If you need a different column to be the class, reorder your CSV before loading.

machinelearning.js.org · open source · MIT · Marin's Web Site