Search code examples
javahadoopmahout

How to run logistic regression of mahout from java code instead of command prompt?


I know Algorithm and how to run it from command prompt. Is there any specific code to call logistic Regression from mahout and providing predictors and target ,other inputs?


Solution

  • Customized Logistic Regression with mahout is explained here : https://github.com/Chandramani/mahout-logistic-regression-examples/blob/master/logitExample/src/OnlineTrainLogisticExampleAlt.java#L139

    In this program you just need to change the target , predictors and categories of predictors and target. At start of main() method add predictors in PredictorList List.and their type in TypeList List resp.

    Provide appropriate input file and directory where you want the constructed model.