Download the PHP package ifaqih/ifnaivebayes without Composer
On this page you can find all versions of the php package ifaqih/ifnaivebayes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ifnaivebayes
Naive Bayes Classifier
Naive Bayes classifier (NBC) is a machine learning method that utilizes probability and statistical calculations proposed by British scientist Thomas Bayes, which predicts future probabilities based on past experience.
PHP Version: 8.0 or above |-
Installation
With Composer:
Use The Library
Set Data Method
Method to set the data to be processed.
- Type: static
- Parameter data type:
array $data
- Return data type:
void
Prototype:
info:
- label: something that represents the group name
- attribute: parameters to be calculated in the classification process
Set Training Data Method
A method for organizing past classification data that will be used as the basis for future classifications.
- Type: static
- Parameter data type:
array|object $data, int $type_training_data = 0, ?string $key_label = null
- Return data type:
void
Prototype 1:
Prototype 2:
Prototype 3:
Set training data based on number of attributes and number of labels. If using this prototype does not require data input (in the set_data() method) and will skip the attribute calculation stage, because it is assumed to have performed attribute calculations manually.
info:
- label: something that represents the group name
- attribute name: parameters to be calculated in the classification process
- "$key_label" parameter is not needed when using the second prototype
Process Method
The method that will perform the classification calculation.
- Type: static
- Parameter data type:
?array $data = null, array|object|null $training_data = null, int $type_training_data = 0, ?string $key_label = null, bool $boolean_returned = true, bool $clear_after = false
- Return data type:
string|bool|null
info: do not include parameters if already set data using 'set' method, otherwise this parameter data will overwrite data which have been set using 'set' method
Get Result Method
Method to get the result of the classification process.
- Type: static
- Parameter data type: not needed
- Return data type:
string|int|float|null
Get Result Point Method
Method to get the points result from the classification process.
- Type: static
- Parameter data type:
?string $label = null
- Return data type:
object|float|int|null
info: parameter in this method is used to get the calculation result points which refers to the requested label and will be returned in float data type, if parameter is not filled or contains null it will return all calculation result points in object data type
Clear Method
This method will delete all data stored statically on the class.
- Type: static
- Parameter data type: not needed
- Return data type:
void
Test Results
Number of training data = 100000