Waikato / moa

MOA is an open source framework for Big Data stream mining. It includes a collection of machine learning algorithms (classification, regression, clustering, outlier detection, concept drift detection and recommender systems) and tools for evaluation.
http://moa.cms.waikato.ac.nz/
GNU General Public License v3.0
603 stars 352 forks source link

Updating ARFHoeffdingTree to address issues when subspace size = 1 #283

Closed hmgomes closed 9 months ago

hmgomes commented 9 months ago

This change address an issue when the subspaceSizeOption was set to 1. Effectively, when the subspaceSize was set to 1, the AttributeClassObserver for that attribute was not initialised.

Furthermore, also made two other changes:

1) If the subspace size is greater than the number of features, there is no need to randomly create the subspaces (just use the original feature set) 2) Set the minimum value of subspaceSizeOption to 1 to prevent the occurrence of zero or negative values. If other classes utilizing the ARFHoeffdingTree need to implement custom logic for handling negative subspace sizes (e.g., totalNumberOfFeatures - subspaceSize), such handling should be the responsibility of those respective classes For example, the AdaptiveRandomForest class handle such cases here

hmgomes commented 9 months ago

Updated the AdaptiveRandomForestTest.ref to reflect the changes to the base learner (ARFHoeffdingTree).

hmgomes commented 9 months ago

Updated the code to allow the last feature to also be selected in the random selection. Also, adding another version of AdaptiveRandomForestTest.ref to reflect the changes in ARFHoeffdingTree code.