Predicts the most suitable category label for given textual data. More...
Public Member Functions | |
train (array &$dataTrain, array &$dataLabel) | |
Trains the classifier with the given example data. | |
setDatabase ($name) | |
Sets the name of the database to operate on. | |
save () | |
Uploads the learnt parameters to a new database. | |
classify ($dataTest) | |
Predicts the most suitable category label for the given test data. | |
Data Fields | |
const | OOV = "__OOV__" |
Out-of-vocabulary common symbol. |
Predicts the most suitable category label for given textual data.
Definition at line 44 of file Classifier.php.
Classifier::classify | ( | $ | dataTest | ) |
Predicts the most suitable category label for the given test data.
dataTest | The test data, e.g., in textual form. |
Exception | if the connection to the working database cannot be established. |
Implemented in MultinomialNaiveBayes.
Classifier::save | ( | ) |
Uploads the learnt parameters to a new database.
Exception | if the connection to the database management system fails. |
Implemented in MultinomialNaiveBayes.
Classifier::setDatabase | ( | $ | name | ) |
Sets the name of the database to operate on.
name | Name of the working database. |
Implemented in MultinomialNaiveBayes.
Classifier::train | ( | array &$ | dataTrain, | |
array &$ | dataLabel | |||
) |
Trains the classifier with the given example data.
dataTrain | Data instances, e.g., in textual form. | |
dataLabel | Instance labels. |
Exception | if data/label sizes don't match, i.e., different numbers of labelled instances are given. |
Implemented in MultinomialNaiveBayes.
const Classifier::OOV = "__OOV__" |
Out-of-vocabulary common symbol.
Definition at line 49 of file Classifier.php.
Referenced by MultinomialNaiveBayes::classify(), and MultinomialNaiveBayes::train().