Table of Contents

Method LoadFromCSV

Namespace
OpenCvSharp.ML
Assembly
OpenCvSharp.dll

LoadFromCSV(string, int, int, int, string, char, char)

Reads the dataset from a .csv file and returns the ready-to-use training data.

public static TrainData LoadFromCSV(string filename, int headerLineCount, int responseStartIdx = -1, int responseEndIdx = -1, string varTypeSpec = "", char delimiter = ',', char missch = '?')

Parameters

filename string

The input file name

headerLineCount int

The number of lines in the beginning to skip; besides the header, the function also skips empty lines and lines starting with '#'

responseStartIdx int

Index of the first output variable. If -1, the function considers the last variable as the response

responseEndIdx int

Index of the last output variable + 1. If -1, then there is single response variable at responseStartIdx.

varTypeSpec string

The optional text string that specifies the variables' types. It has the format ord[n1-n2,n3,n4-n5,...]cat[n6,n7-n8,...].

delimiter char

The character used to separate values in each line.

missch char

The character used to specify missing measurements. It should not be a digit.

Returns

TrainData