how do i load and use TrainData
I downloaded training set for digit recognition. The training set is in csv format , the first column contains the responses and pixel value of the following response is stored the corresponding row. I am trying to write a c++ code in visual studio that uses the ml module of open cv 3.00 to train from the data. I can load the data using the TrainData::loadFromCSV function but i am unable to understand how will it generate the samples and responses matrix that is required to feed into the TrainData::create command my code:
void main()
{
TrainData::loadFromCSV("C:/Users/Shreya Srivastava/Desktop/train.csv",0,1,10);
Mat samples ( 28,28, CV_32FC1 );
Mat responses(35591,0,CV_32F);
TrainData::create(samples,ROW_SAMPLE,responses);
imshow("samples",samples);
waitKey();
}
can you add a single line from your csv ? do you really have 10 responses per feature (aka hot-encoded) ?
what kind of machine learning do you plan to use ?
yes i can use ifstream interface of c++ but will it help ?
the training set has one response that is the digit that corresponds to the given image whose pixel values have been stored in the following columns of that row
is that digit at the end or at the start of the row ?
i am new to machine learning and was following the coursera open course by andrew ng i was trying to build a project on digit recognition using neural networks
and i also have a test set which is also in csv format such that each row contains the pixel values
the digit is in the start of the row
again, what kind of machine learning ? (i'll have to revise the answer below)
what exactly do you mean by what kind of machine learning ? I am using ANN