Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Regression in opencv using Decision Trees

I have 2 sets of data. One set of the data is 41 vector and another set is the 81 vector that is generated from 41 vector. Like this I have many sets of data. Now given a new 41 vector , I need to predict what the new 8*1 vector will be. I wanted to ask that is it possible to do regression in the Opencv using the decision trees? If yes what header we need to write to include the opencv machine learning library for decision trees? Also I read a code for the classification using decision trees. So what will we write for 'max_categories' field of CvDTreeParams while specifying the params. These questions may be very easy but I don't know the machine learning and I am just using it as a tool for my project in Opencv. Actually I have to make the machine learn.

What is wrong with the following code-:

           Ptr<ml::TrainData> tData = ml::TrainData::create(train_data, ml::ROW_SAMPLE, response);

train_data and response are the matrices with equal number of rows. train_data has 4 columns and the response has 16 columns. Basically each row of the train_data has the 41 input and each row of the response has 161 corresponding output.

click to hide/show revision 2
No.2 Revision

updated 2015-10-25 01:18:18 -0600

berak gravatar image

Regression in opencv using Decision Trees

I have 2 sets of data. One set of the data is 44 * 1 vector and another set is the 88 * 1 vector that is generated from 44 * 1 vector. Like this I have many sets of data. Now given a new 44 * 1 vector , I need to predict what the new 8*1 8 * 1 vector will be. I wanted to ask that is it possible to do regression in the Opencv using the decision trees? If yes what header we need to write to include the opencv machine learning library for decision trees? Also I read a code for the classification using decision trees. So what will we write for 'max_categories' field of CvDTreeParams while specifying the params. These questions may be very easy but I don't know the machine learning and I am just using it as a tool for my project in Opencv. Actually I have to make the machine learn.

What is wrong with the following code-:

           Ptr<ml::TrainData> tData = ml::TrainData::create(train_data, ml::ROW_SAMPLE, response);

train_data and response are the matrices with equal number of rows. train_data has 4 columns and the response has 16 columns. Basically each row of the train_data has the 44 * 1 input and each row of the response has 1616 * 1 corresponding output.

Regression in opencv using Decision Trees

I have 2 sets of data. One set of the data is 4 * 1 vector and another set is the 8 * 1 vector that is generated from 4 * 1 vector. Like this I have many sets of data. Now given a new 4 * 1 vector , I need to predict what the new 8 * 1 vector will be. I wanted to ask that is it possible to do regression in the Opencv using the decision trees? If yes what header we need to write to include the opencv machine learning library for decision trees? Also I read a code for the classification using decision trees. So what will we write for 'max_categories' field of CvDTreeParams while specifying the params. These questions may be very easy but I don't know the machine learning and I am just using it as a tool for my project in Opencv. Actually I have to make the machine learn.

What is wrong with the following code-:

           Ptr<ml::TrainData> tData = ml::TrainData::create(train_data, ml::ROW_SAMPLE, response);

train_data and response are the matrices with equal number of rows. train_data has 4 columns and the response has 16 columns. Basically each row of the train_data has the 4 * 1 input and each row of the response has 16 * 1 corresponding output.

Sorry the things may not be clear . actually my one input is 14 vector and the corresponding output is 116 vector. Like this I have many samples of 14 inputs and 116 outputs.