emel v0.2.0 Help.Model View Source
Link to this section Summary
Functions
Returns a function that transforms a value of a continuous attribute to a value of a discrete attribute
Applies feature scaling on the dataset
’s numeric values of keys
and reduces them to a scale between 0 and 1
Trims and parses the string
into a float
Separates the dataset
into a training set
and testing set
Link to this section Functions
Returns a function that transforms a value of a continuous attribute to a value of a discrete attribute.
Examples
iex> f = Help.Model.categorizer(["small", 7.0, "moderate", 12.0, "large"])
...> f.(8.0)
"moderate"
iex> f = Help.Model.categorizer(["small", 7.0, "moderate", 12.0, "large"])
...> f.(6.0)
"small"
iex> f = Help.Model.categorizer(["non positive", 0.0, "positive"])
...> f.(-0.3)
"non positive"
iex> f = Help.Model.categorizer(["non positive", 0.0, "positive"])
...> f.(0.0)
"non positive"
Applies feature scaling on the dataset
’s numeric values of keys
and reduces them to a scale between 0 and 1.
Examples
iex> Help.Model.normalize([%{a: 0}, %{a: 1}], [:a])
[%{a: 0.0}, %{a: 1.0}]
iex> Help.Model.normalize([%{"x" => 1}, %{"x" => 2}, %{"x" => 1.5}], ["x"])
[%{"x" => 0.0}, %{"x" => 1.0}, %{"x" => 0.5}]
iex> Help.Model.normalize([%{"x" => 1, "y" => -2, "z" => -4}, %{"x" => 2, "y" => 2, "z" => -8}], ["y", "z"])
[%{"x" => 1, "y" => 0.0, "z" => 1.0}, %{"x" => 2, "y" => 1.0, "z" => 0.0}]
Trims and parses the string
into a float.
Separates the dataset
into a training set
and testing set
.