mljs / random-forest

Random forest for classification and regression.
https://mljs.github.io/random-forest/
MIT License
61 stars 21 forks source link

Fixed issues 9, 15, 17, 28, 32 #37

Closed aiday-mar closed 2 years ago

aiday-mar commented 2 years ago

The variable this.gainThreshold in the TreeNode implementation was not initialized properly and this was leading to an incorrect creation of regression tree. This will be adressed in a separate pull request for the ml-cart module.

Added the possiblity to change the number of samples one wants to use in the training phase

Added a function featureImportance in order to compute the feature importance as was suggested by @xdadda

codecov[bot] commented 2 years ago

Codecov Report

Merging #37 (8489ef4) into master (229e93a) will decrease coverage by 18.36%. The diff coverage is 11.47%.

:exclamation: Current head 8489ef4 differs from pull request most recent head 8a26a53. Consider uploading reports for the commit 8a26a53 to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##           master      #37       +/-   ##
===========================================
- Coverage   91.38%   73.02%   -18.37%     
===========================================
  Files           4        4               
  Lines         209      278       +69     
  Branches       36       63       +27     
===========================================
+ Hits          191      203       +12     
- Misses         17       61       +44     
- Partials        1       14       +13     
Impacted Files Coverage Δ
src/RandomForestClassifier.js 95.45% <ø> (+0.10%) :arrow_up:
src/RandomForestRegression.js 87.50% <ø> (+0.54%) :arrow_up:
src/utils.js 90.90% <ø> (-2.75%) :arrow_down:
src/RandomForestBase.js 55.55% <11.47%> (-33.20%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 229e93a...8a26a53. Read the comment docs.