mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-24 07:30:12 +01:00
Advertise support for Scala in Codehilite
This commit is contained in:
parent
611c8404ce
commit
5cc68d4a04
@ -915,6 +915,27 @@ module Finity
|
|||||||
end
|
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
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
|
Loading…
Reference in New Issue
Block a user