MicrogradEx.PlotData (MicrogradEx v0.1.0)

Copy Markdown View Source

Converts MicrogradEx datasets and training runs into plain plotting rows.

The returned values are ordinary lists of maps. They are designed to be consumed by Livebook, Vega-Lite, CSV exporters, or tests without making the core library depend on any plotting package.

Summary

Functions

Converts training accuracy into percentage rows for charts.

Converts dataset points into chart-friendly rows.

Evaluates a model over a padded two-dimensional grid.

Expands training history into loss metric rows.

Returns full training-history rows with percentage accuracy added.

Functions

accuracy_history(other)

@spec accuracy_history(MicrogradEx.Trainer.Run.t()) :: [map()]

Converts training accuracy into percentage rows for charts.

dataset_points(other)

@spec dataset_points(MicrogradEx.Datasets.Dataset.t()) :: [map()]

Converts dataset points into chart-friendly rows.

Numeric labels are preserved as :label_value, while :label is a friendly legend string.

decision_boundary(model, dataset, opts \\ [])

@spec decision_boundary(
  MicrogradEx.NN.model(),
  MicrogradEx.Datasets.Dataset.t(),
  Keyword.t()
) :: [
  map()
]

Evaluates a model over a padded two-dimensional grid.

Options:

  • :h - positive grid spacing, default 0.25
  • :padding - non-negative padding around dataset bounds, default 1.0

loss_history(other)

@spec loss_history(MicrogradEx.Trainer.Run.t()) :: [map()]

Expands training history into loss metric rows.

training_history(other)

@spec training_history(MicrogradEx.Trainer.Run.t()) :: [map()]

Returns full training-history rows with percentage accuracy added.