Penelope v0.4.0 Penelope.NIF

NIF wrapper module

for blas, see http://www.netlib.org/blas/ for libsvm, see https://github.com/cjlin1/libsvm

Link to this section Summary

Functions

z = ax + y

compiles crf model parameters into a model resource

extracts crf model parameters from a model resource

predicts a sequence from a sequence of features

trains a crf model using crfsuite

module initialization callback

compiles linear model parameters into a model resource

extracts linear model parameters from a model resource

predicts a class from a feature vector

predicts an ordered list of class probabilities from a feature vector

trains a inear model using liblinear

compiles svm model parameters into a model resource

extracts svm model parameters from a model resource

predicts a class from a feature vector

predicts an ordered list of class probabilities from a feature vector

trains an svm model using libsvm

Link to this section Functions

Link to this function blas_saxpy(a, x, y)
blas_saxpy(a :: float(), x :: Penelope.ML.Vector.t(), y :: Penelope.ML.Vector.t()) :: Penelope.ML.Vector.t()

z = ax + y

Link to this function blas_sscal(a, x)
blas_sscal(a :: float(), x :: Penelope.ML.Vector.t()) :: Penelope.ML.Vector.t()

y = ax

Link to this function crf_compile(params)
crf_compile(params :: map()) :: reference()

compiles crf model parameters into a model resource

Link to this function crf_export(model)
crf_export(model :: reference()) :: map()

extracts crf model parameters from a model resource

Link to this function crf_predict(model, x)
crf_predict(model :: reference(), x :: [[String.t() | list() | map()]]) :: {[String.t()], float()}

predicts a sequence from a sequence of features

Link to this function crf_train(x, y, params)
crf_train(x :: [[%{optional(String.t()) => float()}]], y :: [[String.t()]], params :: map()) :: reference()

trains a crf model using crfsuite

Link to this function init()
init() :: :ok

module initialization callback

Link to this function lin_compile(params)
lin_compile(params :: map()) :: reference()

compiles linear model parameters into a model resource

Link to this function lin_export(model)
lin_export(model :: reference()) :: map()

extracts linear model parameters from a model resource

Link to this function lin_predict_class(model, x)
lin_predict_class(model :: reference(), x :: Penelope.ML.Vector.t()) :: integer()

predicts a class from a feature vector

Link to this function lin_predict_probability(model, x)
lin_predict_probability(model :: reference(), x :: Penelope.ML.Vector.t()) :: [{integer(), float()}]

predicts an ordered list of class probabilities from a feature vector

Link to this function lin_train(x, y, params)
lin_train(x :: [Penelope.ML.Vector.t()], y :: [integer()], params :: map()) :: reference()

trains a inear model using liblinear

Link to this function svm_compile(params)
svm_compile(params :: map()) :: reference()

compiles svm model parameters into a model resource

Link to this function svm_export(model)
svm_export(model :: reference()) :: map()

extracts svm model parameters from a model resource

Link to this function svm_predict_class(model, x)
svm_predict_class(model :: reference(), x :: Penelope.ML.Vector.t()) :: integer()

predicts a class from a feature vector

Link to this function svm_predict_probability(model, x)
svm_predict_probability(model :: reference(), x :: Penelope.ML.Vector.t()) :: [{integer(), float()}]

predicts an ordered list of class probabilities from a feature vector

Link to this function svm_train(x, y, params)
svm_train(x :: [Penelope.ML.Vector.t()], y :: [integer()], params :: map()) :: reference()

trains an svm model using libsvm