Spark ML's model summaries as Clojure maps, from a fixed list of each summary's values, by the classes and traits it extends.
Spark ML's model summaries as Clojure maps, from a fixed list of each summary's values, by the classes and traits it extends.
(binary-summary model-or-summary)A logistic regression model's training summary as summary gives it, with
the binary classifier's values, which throws for a multinomial model, or a
binary summary as a map.
A logistic regression model's training summary as `summary` gives it, with the binary classifier's values, which throws for a multinomial model, or a binary summary as a map.
(summary model-or-summary)A model's training summary, or a summary that evaluate gives for a
model and new data, as a map of its values: for a classifier, its accuracy,
the rates, precision and recall by label and weighted, and for a binary
one, the area under the ROC curve; for a regression, its errors and r2, and
for a linear or generalised linear one, the coefficients' statistics; for a
clustering model, its cluster sizes and cost; and the objective's history
where the model has one. ROC and PR curves, residuals and predictions stay
DataFrames. A value that Spark can't give for the model, such as a linear
regression's standard errors without the normal solver, or its p-values for
more features than rows, is left out.
Spark computes most of the metrics from the predictions, so the map takes
a job or two to make. (.summary model) gives Spark's own summary.
(:area-under-roc (ml/summary model))
(ml/summary (ml/evaluate test-data model))
A model's training summary, or a summary that `evaluate` gives for a model and new data, as a map of its values: for a classifier, its accuracy, the rates, precision and recall by label and weighted, and for a binary one, the area under the ROC curve; for a regression, its errors and r2, and for a linear or generalised linear one, the coefficients' statistics; for a clustering model, its cluster sizes and cost; and the objective's history where the model has one. ROC and PR curves, residuals and predictions stay DataFrames. A value that Spark can't give for the model, such as a linear regression's standard errors without the normal solver, or its p-values for more features than rows, is left out. Spark computes most of the metrics from the predictions, so the map takes a job or two to make. `(.summary model)` gives Spark's own summary. ```clojure (:area-under-roc (ml/summary model)) (ml/summary (ml/evaluate test-data model)) ```
(summary->map summary)A summary's values as a map, for the summary classes that summary-values
lists, leaving out what Spark can't give for the model.
A summary's values as a map, for the summary classes that `summary-values` lists, leaving out what Spark can't give for the model.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |