diff --git a/docs/extensions/codehilite.md b/docs/extensions/codehilite.md index 17777adc3..cb94348c8 100644 --- a/docs/extensions/codehilite.md +++ b/docs/extensions/codehilite.md @@ -915,6 +915,27 @@ module Finity end ``` +### Scala + +```scala +// Every record of this DataFrame contains the label and +// features represented by a vector. +val df = sqlContext.createDataFrame(data).toDF("label", "features") + +// Set parameters for the algorithm. +// Here, we limit the number of iterations to 10. +val lr = new LogisticRegression().setMaxIter(10) + +// Fit the model to the data. +val model = lr.fit(df) + +// Inspect the model: get the feature weights. +val weights = model.weights + +// Given a dataset, predict each point's label, and show the results. +model.transform(df).show()g +``` + ### XML ``` xml