Ricardo Cristian Ramirez
Ricardo Cristian Ramirez

Reputation: 1224

multivariate random forest with opencv

Let's say we are trying to classify a pencil as healthy or not and we have two variables for this purpose: length and weight of the pencil. Now, what should I give to the training method of random forest implemented in opencv? I am really confused with this because I have two different data, both of them are numeric but their units are different. Below example will give a better sense:

Height (cm)   Weight (gr)   Healthy? (bool)
-----------   -----------   ---------------
10            34            0
4             6             0
12            14            1
8             20            1
5             18            0

If I train a univariate random forest with only height, {10, 4, 12, 8, 5} and {0, 0, 1, 1, 0} vectors will be the parameters. However, what if I want to use both variables, what will be the parameters?

Upvotes: 2

Views: 498

Answers (1)

sashkello
sashkello

Reputation: 17871

In Python the training data input can be fed into as a list of tuples, if you have multiple variables.

Upvotes: 1

Related Questions