machine learning - Spark (1.6) ML Linear Regression - how to predict w/ a model -
i have working linear regression model:
lrmodel org.apache.spark.ml.regression.linearregressionmodel
and have data in dataframe:
data org.apache.spark.sql.dataframe = [label: double, features: vector]
how use model predict? in case, want like:
lrmodel.predict(data) // doesn't work
then compare expected value (label) predicted value
to predict need have dataframe
, , convert using transform method part of ml models. note of them require dataframe
s have same structure of training data, hence fetures
column.
Comments
Post a Comment