[ Index ]

PHP Cross Reference of Moodle 310

title

Body

[close]

/lib/mlbackend/php/phpml/src/Phpml/Classification/ -> DecisionTree.php (summary)

(no description)

File Size: 484 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

DecisionTree:: (16 methods):
  __construct()
  train()
  getColumnTypes()
  getGiniIndex()
  setNumFeatures()
  setColumnNames()
  getHtml()
  getFeatureImportances()
  getSplitLeaf()
  getBestSplit()
  getSelectedFeatures()
  preprocess()
  isCategoricalColumn()
  setSelectedFeatures()
  getSplitNodesByColumn()
  predictSample()


Class: DecisionTree  - X-Ref

__construct(int $maxDepth = 10)   X-Ref


train(array $samples, array $targets)   X-Ref
No description

getColumnTypes(array $samples)   X-Ref
No description

getGiniIndex($baseValue, array $colValues, array $targets)   X-Ref

param: mixed $baseValue

setNumFeatures(int $numFeatures)   X-Ref
This method is used to set number of columns to be used
when deciding a split at an internal node of the tree.  <br>
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: $this

setColumnNames(array $names)   X-Ref
A string array to represent columns. Useful when HTML output or
column importances are desired to be inspected.

return: $this

getHtml()   X-Ref
No description

getFeatureImportances()   X-Ref
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.<br/>


getSplitLeaf(array $records, int $depth = 0)   X-Ref
No description

getBestSplit(array $records)   X-Ref
No description

getSelectedFeatures()   X-Ref
Returns available features/columns to the tree for the decision making
process. <br>

If a number is given with setNumFeatures() method, then a random selection
of features up to this number is returned. <br>

If some features are manually selected by use of setSelectedFeatures(),
then only these features are returned <br>

If any of above methods were not called beforehand, then all features
are returned by default.

preprocess(array $samples)   X-Ref
No description

isCategoricalColumn(array $columnValues)   X-Ref
No description

setSelectedFeatures(array $selectedFeatures)   X-Ref
Used to set predefined features to consider while deciding which column to use for a split


getSplitNodesByColumn(int $column, DecisionTreeLeaf $node)   X-Ref
Collects and returns an array of internal nodes that use the given
column as a split criterion


predictSample(array $sample)   X-Ref

return: mixed



Generated: Wed Jan 22 11:59:49 2025 Cross-referenced by PHPXref 0.7.1