NlpTools API
Class

NlpTools\Models\LinearModel

class LinearModel

This class represents a linear model of the following form f(x_vec) = l1*x1 + l2*x2 + l3*x3 ...

Maybe the name is a bit off. What is really meant is that models of
this type provide a set of weights that will be used by the classifier
(probably through a linear combination) to decide the class of a
given document.

Methods

__construct(array $l)

float getWeight(string $feature)

Get the weight for a given feature

array getWeights()

Get all the weights as an array.

Details

at line 18
public __construct(array $l)

Parameters

array $l

at line 28
public float getWeight(string $feature)

Get the weight for a given feature

Parameters

string $feature The feature for which the weight will be returned

Return Value

float The weight

at line 39
public array getWeights()

Get all the weights as an array.

Return Value

array The weights as an associative array