1
$\begingroup$

I have this given database:

enter image description here

I would like to predict column "y" using the columns "index_1","index_2","index_3" using the random forest classifier.

as you can see, column "size: does not have values for each observation.

My question is : Can I still use random forest classifier when I don't have data for all the observations, and if yes, is it ok?should I give value (e.g "noData") to the empty cells? will it harm the prediction? or maybe no need?

$\endgroup$
1
$\begingroup$

In theory decision trees (and random forests) are able to deal with missing values in the data. But whether a particular implementation of the algorithm allows this (and how to use it with this implementation) depends on the specific package.

| improve this answer | |
$\endgroup$
1
$\begingroup$

Since size seems to be a categorical variable you can just go ahead and treat all blank values as an additional variable level. This is regardless of the specific algorithm you're using.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.