3
$\begingroup$

I am working on Spark MLlib and have a project where I have to make predictions for numeric data based on non-numeric features. I am a bit confused about which regression algorithm to use from Spark MLlib library primarily due to being new at this. The algorithms present in Spark MLlib library are:

-linear models (SVMs, logistic regression, linear regression)
-naive Bayes
-decision trees
-ensembles of trees (Random Forests and Gradient-Boosted Trees)
-isotonic regression 

Can anyone provide me some guidance as to which algorithm will be suitable for predictions for numeric data based on non-numeric features?

$\endgroup$
1
$\begingroup$

I would suggest -ensembles of trees (Random Forests and Gradient-Boosted Trees).

Here is a nice reference for handling such data with decision trees.

$\endgroup$
2
  • $\begingroup$ So, if my features are say like persons geographic details,age,occupation etc and my target prediction value need to be say persons monthly spending then how would I make those non numeric features to be encoded so as to make the prediction for numeric value? $\endgroup$ Nov 27 '15 at 5:48
  • $\begingroup$ Yes, encode them and use them in the algorithm. A helpful link which might help you. $\endgroup$
    – Dawny33
    Nov 27 '15 at 5:57
0
$\begingroup$

A linear regression would work, but the real issue here is feature extraction. You have to encode your categorical features somehow, likely by vectorizing them. You can one-hot encode your features, treat them as text and countVectorize them, etc.

$\endgroup$
2
  • $\begingroup$ the above post is mine (something goofy is happening and after I registered it is not showing as mine). So, if my features are say like persons geographic details,age,occupation etc and my target prediction value need to be say persons monthly spending then how would I make those non numeric features to be encoded so as to make the prediction for numeric value? $\endgroup$ Nov 27 '15 at 5:47
  • $\begingroup$ @JasonDonnald I edited my answer to include a link discussing methods for vectorizing categorical data. Things like age are already numeric. $\endgroup$
    – jamesmf
    Nov 27 '15 at 5:55

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.