emel/ml/perceptron
A binary classification algorithm that makes its predictions based on a linear predictor function combining a set of weights with the features.
Functions
pub fn classifier(data: List(#(List(Float), Bool)), learning_rate: Float, error_threshold: Float, max_iterations: Int) -> fn(
List(Float),
) -> Bool
Returns the function that classifies a point by using the Perceptron Algorithm.
Data = [
{[0.0, 0.0], false},
{[0.0, 1.0], true},
{[1.0, 0.0], true},
{[1.0, 1.0], true}
],
LearningRate = 0.01,
ErrorThreshold = 0.1,
MaxIterations = 1000,
F = emel@ml@perceptron:classifier(Data, LearningRate, ErrorThreshold, MaxIterations),
F([0.0, 0.0]).
% false