Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

hmgomes
Copy link
Member

@hmgomes hmgomes commented Sep 14, 2023

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
Copy link
Member Author

hmgomes commented Sep 15, 2023

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

@hmgomes
Copy link
Member Author

hmgomes commented Sep 19, 2023

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.

Copy link
Contributor

@YibinSun YibinSun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This amended version of ARFHoeffdingTree has been tested on 6 datasets with 6 different subspace values, both individually and ''ensembly''. The results indicate that the modification has fixed the previous problem, especially when subspace value is set to 1.

Here are the results from ARF with the old and new ARFHoeffdingTree:
Screenshot 2023-09-21 at 2 05 27 PM

@abifet abifet merged commit 070d250 into Waikato:master Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants