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

[ENH] Optimize Unsuprf #114

Merged
merged 17 commits into from
Aug 22, 2023
Merged

[ENH] Optimize Unsuprf #114

merged 17 commits into from
Aug 22, 2023

Conversation

adam2392
Copy link
Collaborator

Towards: #113

Changes proposed in this pull request:

  • Changes fastBIC to "fasterBIC" framework

Before submitting

  • I've read and followed all steps in the Making a pull request
    section of the CONTRIBUTING docs.
  • I've updated or added any relevant docstrings following the syntax described in the
    Writing docstrings section of the CONTRIBUTING docs.
  • If this PR fixes a bug, I've added a test that will fail without my fix.
  • If this PR adds a new feature, I've added tests that sufficiently cover my new functionality.

After submitting

  • All GitHub Actions jobs for my pull request have passed.

Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 98.36% and project coverage change: +0.21% 🎉

Comparison is base (3b124e3) 86.52% compared to head (9b4ff1b) 86.73%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   86.52%   86.73%   +0.21%     
==========================================
  Files          26       26              
  Lines        2063     2111      +48     
==========================================
+ Hits         1785     1831      +46     
- Misses        278      280       +2     
Files Changed Coverage Δ
sktree/ensemble/_unsupervised_forest.py 70.63% <ø> (ø)
sktree/tree/_honest_tree.py 99.40% <97.67%> (-0.60%) ⬇️
sktree/ensemble/_honest_forest.py 91.46% <100.00%> (ø)
sktree/tests/test_supervised_forest.py 99.41% <100.00%> (+<0.01%) ⬆️
sktree/tree/_classes.py 75.00% <100.00%> (+0.06%) ⬆️
sktree/tree/tests/test_unsupervised_tree.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
@adam2392
Copy link
Collaborator Author

adam2392 commented Aug 22, 2023

@PSSF23 can you add the support to honest tree and forest for partial fit to fix the CI here?

=========================== short test summary info ============================
FAILED sktree/tests/test_honest_forest.py::test_sklearn_compatible_estimator[HonestForestClassifier(n_estimators=10,random_state=0)-check_fit_score_takes_y] - AttributeError: 'HonestTreeClassifier' object has no attribute 'partial_fit'
FAILED sktree/tests/test_honest_forest.py::test_sklearn_compatible_estimator[HonestForestClassifier(n_estimators=10,random_state=0)-check_estimators_partial_fit_n_features] - TypeError: fit() got an unexpected keyword argument 'classes'

Feel free to commit directly to the branch once you have something working locally? Afterwards, I can merge this PR and the forests/trees in scikit-tree should have partial_fit enabled.

Copy link
Member

@PSSF23 PSSF23 left a comment

Choose a reason for hiding this comment

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

@adam2392 I have optimized the honest fitting as we currently have classes as a variable. Right now only the samples used for tree structures are included in the fitting, instead of the current sample_weight=0 method.

@PSSF23
Copy link
Member

PSSF23 commented Aug 22, 2023

black version 22.12.0 is affecting the linting checks. Should we update it?

@adam2392
Copy link
Collaborator Author

There are some errors in the implementation. Also do you mind adding the functionality to the forest as well?

I'm not as sure what needs to get added to partial_fit. As long as it passes the check_estimator unit-tests then it should be good on the CIs

PSSF23

This comment was marked as outdated.

Copy link
Member

@PSSF23 PSSF23 left a comment

Choose a reason for hiding this comment

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

I think all CIs work now.

@adam2392
Copy link
Collaborator Author

Cool thanks @PSSF23!

@adam2392 adam2392 merged commit fc48cef into main Aug 22, 2023
25 checks passed
@adam2392 adam2392 deleted the urf branch August 22, 2023 19:52
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.

2 participants