|
| __construct (int $maxDepth=10) |
|
| getFeatureImportances () |
| This will return an array including an importance value for each column in the given dataset.
|
|
| getGiniIndex ($baseValue, array $colValues, array $targets) |
|
| getHtml () |
|
| predict (array $samples) |
|
| setColumnNames (array $names) |
| A string array to represent columns.
|
|
| setNumFeatures (int $numFeatures) |
| This method is used to set number of columns to be used when deciding a split at an internal node of the tree.
|
|
| train (array $samples, array $targets) |
|
|
static | getColumnTypes (array $samples) |
|
|
int | $actualDepth = 0 |
|
const | CONTINUOUS = 1 |
|
const | NOMINAL = 2 |
|
|
| getBestSplit (array $records) |
|
| getSelectedFeatures () |
| Returns available features/columns to the tree for the decision making process.
|
|
| getSplitLeaf (array $records, int $depth=0) |
|
| getSplitNodesByColumn (int $column, DecisionTreeLeaf $node) |
| Collects and returns an array of internal nodes that use the given column as a split criterion.
|
|
| predictSample (array $sample) |
|
| preprocess (array $samples) |
|
| setSelectedFeatures (array $selectedFeatures) |
| Used to set predefined features to consider while deciding which column to use for a split.
|
|
|
static | isCategoricalColumn (array $columnValues) |
|
◆ getFeatureImportances()
Phpml\Classification\DecisionTree::getFeatureImportances |
( |
| ) |
|
This will return an array including an importance value for each column in the given dataset.
The importance values are normalized and their total makes 1.
◆ getGiniIndex()
Phpml\Classification\DecisionTree::getGiniIndex |
( |
| $baseValue, |
|
|
array | $colValues, |
|
|
array | $targets ) |
◆ getSelectedFeatures()
Phpml\Classification\DecisionTree::getSelectedFeatures |
( |
| ) |
|
|
protected |
Returns available features/columns to the tree for the decision making process.
If a number is given with setNumFeatures() method, then a random selection of features up to this number is returned.
If some features are manually selected by use of setSelectedFeatures(), then only these features are returned
If any of above methods were not called beforehand, then all features are returned by default.
◆ predict()
Phpml\Estimator::predict |
( |
array | $samples | ) |
|
|
inherited |
◆ predictSample()
Phpml\Classification\DecisionTree::predictSample |
( |
array | $sample | ) |
|
|
protected |
◆ setColumnNames()
Phpml\Classification\DecisionTree::setColumnNames |
( |
array | $names | ) |
|
A string array to represent columns.
Useful when HTML output or column importances are desired to be inspected.
- Return values
-
- Exceptions
-
◆ setNumFeatures()
Phpml\Classification\DecisionTree::setNumFeatures |
( |
int | $numFeatures | ) |
|
This method is used to set number of columns to be used when deciding a split at an internal node of the tree.
If the value is given 0, then all features are used (default behaviour), otherwise the given value will be used as a maximum for number of columns randomly selected for each split operation.
- Return values
-
- Exceptions
-
◆ train()
Phpml\Classification\DecisionTree::train |
( |
array | $samples, |
|
|
array | $targets ) |
The documentation for this class was generated from the following file:
- lib/mlbackend/php/phpml/src/Phpml/Classification/DecisionTree.php