View Source Scitree.Config (scitree v0.1.0)

Link to this section Summary

Functions

initializes a new classification setting.

This function defines which sorting method will be used and its options.

Set a directory to save training logs

Link to this section Types

@type learners() :: :cart | :gradient_boosted_trees | :random_forest
@type t() :: %Scitree.Config{
  label: term(),
  learner: term(),
  log_directory: term(),
  options: term(),
  task: term()
}
@type tasks() ::
  :undefined | :classification | :regression | :ranking | :categorical_uplift

Link to this section Functions

initializes a new classification setting.

examples

Examples

iex> Scitree.Config.init()
%Scitree.Config{
  label: "",
  learner: :gradient_boosted_trees,
  log_directory: "",
  options: [
    maximum_model_size_in_memory_in_bytes: -1.0,
    maximum_training_duration_seconds: -1.0,
    random_seed: 123456
  ],
  task: :classification
}
@spec label(t(), String.t()) :: t()
Link to this function

learner(config, learner, opts \\ [])

View Source
@spec learner(t(), learners(), list()) :: t()

This function defines which sorting method will be used and its options.

If you want to use the classic Random Forest model, you can use the following example as a basis.

examples

Examples

iex> Scitree.Config.init() |> Scitree.Config.learner(:random_forest)
%Scitree.Config{
  label: "",
  learner: :random_forest,
  log_directory: "",
  options: [
    random_seed: 123456,
    maximum_training_duration_seconds: -1.0,
    maximum_model_size_in_memory_in_bytes: -1.0
  ],
  task: :classification
}

Learner parameters can be changed, you can use the following options: (parameters that are not manually set will assume default values)

  • maximum_model_size_in_memory_in_bytes: Limit the size of the model when stored in ram.
  • maximum_training_duration_seconds: Maximum training duration of the model expressed in seconds.
  • random_seed: Random seed for the training of the model.

To change default options, can use the following example.

examples-1

Examples

iex> Scitree.Config.init() |> Scitree.Config.learner(:random_forest, random_seed: 654321)
%Scitree.Config{
  label: "",
  learner: :random_forest,
  log_directory: "",
  options: [
    maximum_model_size_in_memory_in_bytes: -1.0,
    maximum_training_duration_seconds: -1.0,
    random_seed: 654321
  ],
  task: :classification
}
Link to this function

log_directory(config, dir)

View Source
@spec log_directory(t(), String.t()) :: t()

Set a directory to save training logs

examples

Examples

iex> Scitree.Config.init() |> Scitree.Config.log_directory("/path")
%Scitree.Config{
  label: "",
  learner: :gradient_boosted_trees,
  log_directory: "/path",
  options: [
    maximum_model_size_in_memory_in_bytes: -1.0,
    maximum_training_duration_seconds: -1.0,
    random_seed: 123456
  ],
  task: :classification
}
@spec task(t(), tasks()) :: t()