Dear all,

I am trying to evaluate if we could use Mahout's Logistic Regression
implementation to predict CTR for a Ad Network.

I run the command in Mahout In Action(chapter 13) successfully, but meet an
error while try to introduce a categorical predictor by the following
command with the built-in example on Mahout-0.4

mahout trainlogistic --input donut.csv --output ./model --target color
--categories 2 --predictors shape x y --types word numeric --features 20
--passes 100 --rate 50

but get a NullPointerException
Running on hadoop, using HADOOP_HOME=/opt/hadoop
No HADOOP_CONF_DIR set, using /opt/hadoop/conf
20
color ~ -1.945*Intercept Term + 0.532*x + 1.304*yException in thread "main"
java.lang.NullPointerException
at
org.apache.mahout.classifier.sgd.TrainLogistic.predictorWeight(TrainLogistic.java:138)
at
org.apache.mahout.classifier.sgd.TrainLogistic.main(TrainLogistic.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:184)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

I am wondering how to fix it.

And does the Mahout's implementation transfer a word/category predictor to
multiple unigram predictor to do the logistic regression? Or it use some
other way?

Thanks.

Best wishes,
Stanley Xu

Reply via email to