View Source Scitree.Validations (scitree v0.1.0)

Validations to ensure data is consistent and in the format expected by Yggdrasil.

Link to this section Summary

Functions

Checks if config learner is valid.

Checks if all columns are the same size.

Checks if the configuration label is in the dataset.

Check if the task config is compatible with the type of the dataset's label column.

Link to this section Types

@type data() :: {{String.t(), atom(), [term()]}}

Link to this section Functions

Link to this function

validate(data, config \\ %Config{}, validations)

View Source
@spec validate(data(), Scitree.Config.t(), list()) ::
  :ok
  | {:error, atom()}
  | {:error,
     {:incompatible_column_for_task, col_type :: atom(),
      valid_types :: [atom()]}}
  | {:error, {:unsupported_validation, name :: atom()}}
Link to this function

validate_config_learner(data, config)

View Source
@spec validate_config_learner(data(), Scitree.Config.t()) ::
  :ok | {:error, :unknown_learner}

Checks if config learner is valid.

examples

Examples

iex> Scitree.Validations.validate_config_learner(data, config)
{:error, :unknown_learner}
Link to this function

validate_dataset_size(data, config)

View Source
@spec validate_dataset_size(data(), Scitree.Config.t()) ::
  :ok | {:error, :incompatible_column_sizes}

Checks if all columns are the same size.

examples

Examples

iex> Scitree.Validations.validate_dataset_size(data, config)
{:error, :incompatible_column_sizes}
Link to this function

validate_label(data, config)

View Source
@spec validate_label(data(), Scitree.Config.t()) ::
  :ok | {:error, :unidentified_label}

Checks if the configuration label is in the dataset.

examples

Examples

iex> Scitree.Validations.validate_label(data, config)
{:error, :unidentified_label}
Link to this function

validate_task(data, config)

View Source
@spec validate_task(data(), Scitree.Config.t()) ::
  :ok | {:error, {:incompatible_column_for_task, atom(), [atom()]}}

Check if the task config is compatible with the type of the dataset's label column.

examples

Examples

iex> Scitree.Validations.validate_task({{"my column", :numerical, 1}}, %{label: "my column", task: :classification})
{:error, {:incompatible_column_for_task, :numerical, [:categorical, :string]}