# `Latu.ML.Classification.BinaryLogisticRegressionSummary`
[🔗](https://github.com/zero-one-group/latu_ml/blob/v0.4.2/lib/latu/ml/classification.ex#L0)

Attributes of a `BinaryLogisticRegressionSummary` — what an estimator recorded while it fitted. `Latu.ML.summary/1` is what hands you one.

Every accessor here is one name on the server's allowlist for
`org.apache.spark.ml.classification.BinaryLogisticRegressionSummary` — 25 of them — so
tab completion is that allowlist. The server refuses anything else with
`CONNECT_ML.ATTRIBUTE_NOT_ALLOWED`; these refuse a model of the wrong class before it gets
that far, and name the module that would have taken it.

Every allowlisted attribute of this class has a function here.

The allowlist is inherited rather than per class: this one is the union of
`org.apache.spark.ml.classification.BinaryClassificationSummary`,
`org.apache.spark.ml.classification.BinaryLogisticRegressionSummary`,
`org.apache.spark.ml.classification.ClassificationSummary`,
`org.apache.spark.ml.classification.LogisticRegressionSummary`.

# `accuracy`

```elixir
@spec accuracy(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Returns accuracy. (equals to the total number of correctly classified instances out of the
total number of instances.)

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `area_under_roc`

```elixir
@spec area_under_roc(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Computes the area under the receiver operating characteristic (ROC) curve.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `class`

```elixir
@spec class() :: String.t()
```

The JVM class these accessors belong to.

# `f_measure_by_label`

```elixir
@spec f_measure_by_label(Latu.ML.Summary.t(), number()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns f-measure for each label (category).

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

## Arguments

  * `beta` — a number, sent as a double

# `f_measure_by_threshold`

```elixir
@spec f_measure_by_threshold(Latu.ML.Summary.t()) :: Latu.DataFrame.t()
```

Returns a dataframe with two fields (threshold, F-Measure) curve with beta = 1.0.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

# `false_positive_rate_by_label`

```elixir
@spec false_positive_rate_by_label(Latu.ML.Summary.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns false positive rate for each label (category).

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `features_col`

```elixir
@spec features_col(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Field in "predictions" which gives the features of each instance as a vector.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `label_col`

```elixir
@spec label_col(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Field in "predictions" which gives the true label of each instance.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `labels`

```elixir
@spec labels(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Returns the sequence of labels in ascending order. This order matches the order used in
metrics which are specified as arrays over labels, e.g., truePositiveRateByLabel.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `pr`

```elixir
@spec pr(Latu.ML.Summary.t()) :: Latu.DataFrame.t()
```

Returns the precision-recall curve, which is a Dataframe containing two fields recall,
precision with (0.0, 1.0) prepended to it.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

# `precision_by_label`

```elixir
@spec precision_by_label(Latu.ML.Summary.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns precision for each label (category).

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `precision_by_threshold`

```elixir
@spec precision_by_threshold(Latu.ML.Summary.t()) :: Latu.DataFrame.t()
```

Returns a dataframe with two fields (threshold, precision) curve. Every possible probability
obtained in transforming the dataset are used as thresholds used in calculating the
precision.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

# `prediction_col`

```elixir
@spec prediction_col(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Field in "predictions" which gives the prediction of each class.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `predictions`

```elixir
@spec predictions(Latu.ML.Summary.t()) :: Latu.DataFrame.t()
```

Dataframe outputted by the model's `transform` method.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

# `probability_col`

```elixir
@spec probability_col(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Field in "predictions" which gives the probability of each class as a vector.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `recall_by_label`

```elixir
@spec recall_by_label(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Returns recall for each label (category).

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `recall_by_threshold`

```elixir
@spec recall_by_threshold(Latu.ML.Summary.t()) :: Latu.DataFrame.t()
```

Returns a dataframe with two fields (threshold, recall) curve. Every possible probability
obtained in transforming the dataset are used as thresholds used in calculating the recall.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

# `roc`

```elixir
@spec roc(Latu.ML.Summary.t()) :: Latu.DataFrame.t()
```

Returns the receiver operating characteristic (ROC) curve, which is a Dataframe having two
fields (FPR, TPR) with (0.0, 0.0) prepended and (1.0, 1.0) appended to it.

A lazy builder: the `Fetch` rides a relation, so this hands back a `Latu.DataFrame` and
nothing has run until you collect it.

# `score_col`

```elixir
@spec score_col(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Field in "predictions" which gives the probability or raw prediction of each class as a
vector.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `true_positive_rate_by_label`

```elixir
@spec true_positive_rate_by_label(Latu.ML.Summary.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns true positive rate for each label (category).

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `weight_col`

```elixir
@spec weight_col(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Field in "predictions" which gives the weight of each instance as a vector.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `weighted_f_measure`

```elixir
@spec weighted_f_measure(Latu.ML.Summary.t(), number()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns weighted averaged f-measure.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

## Arguments

  * `beta` — a number, sent as a double

# `weighted_false_positive_rate`

```elixir
@spec weighted_false_positive_rate(Latu.ML.Summary.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns weighted false positive rate.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `weighted_precision`

```elixir
@spec weighted_precision(Latu.ML.Summary.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns weighted averaged precision.

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `weighted_recall`

```elixir
@spec weighted_recall(Latu.ML.Summary.t()) :: {:ok, term()} | {:error, Latu.Error.t()}
```

Returns weighted averaged recall. (equals to precision, recall and f-measure)

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

# `weighted_true_positive_rate`

```elixir
@spec weighted_true_positive_rate(Latu.ML.Summary.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}
```

Returns weighted true positive rate. (equals to precision, recall and f-measure)

An action: it reaches the server. A `Vector` or `Matrix` comes back as an `Nx.Tensor`, or a
`Latu.ML.SparseVector` where densifying would be this package's decision rather than yours.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
