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

[MAINT] Update pinned versions #15

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
22565b9
Update sklearn to >= 1.5.0
chiuhoward Dec 4, 2024
67abbf0
update indices_to_mask import that was changed in sklearn 1.3.0
chiuhoward Dec 4, 2024
6669ed0
change if_delegate_has_method to available_if in metaestimators
chiuhoward Dec 4, 2024
a6a9dac
change more if_delegate_has_method
chiuhoward Dec 4, 2024
752b886
Fix sklearn to 1.5.2
chiuhoward Dec 5, 2024
77f8d41
Update statsmodels pin from 0.14.0 to 0.14.4
chiuhoward Dec 5, 2024
879f24b
Update seaborn pin from 0.13.0 to 0.13.2
chiuhoward Dec 5, 2024
e9c80c9
Update pandas pin from 2.1.4 to 2.2.3
chiuhoward Dec 5, 2024
a61320d
Update matplotlib pin from <3.9 to 3.9.3
chiuhoward Dec 5, 2024
2b99096
Update scipy pin from 1.3.1 to 1.4.1
chiuhoward Dec 5, 2024
d25b82a
Update dipy pin from 1.0.0 to 1.9.0
chiuhoward Dec 5, 2024
8c2d152
Update numpy pin from 1.23.5 to 2.1.3
chiuhoward Dec 5, 2024
23ffcf3
Update numpy pin from 1.23.5 to 1.26.4, numpy >= 2 breaking change
chiuhoward Dec 5, 2024
4d2f753
Update references to richford to tractometry in contributing.md
chiuhoward Dec 5, 2024
8264584
Vendorize neurocombat_sklearn and updated estimator variable
chiuhoward Dec 13, 2024
59cb6b7
More changes
chiuhoward Dec 13, 2024
3981dae
Merge branch 'main' into update-pinned-versions
arokem Dec 14, 2024
931c30b
Changed folder structure for neurocombat, added pre-commit hooks
chiuhoward Dec 16, 2024
4fa0590
Rename python file to make it unique from folder name
chiuhoward Dec 16, 2024
92f8499
update __init__.py in neurocombat folder
chiuhoward Dec 17, 2024
6ea8283
Use absolute import in test
chiuhoward Dec 17, 2024
0aa5180
Update import in nn/utils.py
chiuhoward Dec 17, 2024
44d150d
Trying to pass tests
chiuhoward Dec 17, 2024
193b0ae
Removes an extraneous (?) copy of neurocombat sklearn
arokem Dec 21, 2024
c957382
Merge pull request #2 from arokem/rm_one_nc_sklearn
chiuhoward Dec 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can contribute in many ways:

### Report Bugs

Report bugs at <https://github.com/richford/AFQ-Insight/issues>.
Report bugs at <https://github.com/tractometry/AFQ-Insight/issues>.

If you are reporting a bug, please include:

Expand Down Expand Up @@ -64,7 +64,7 @@ articles, and such.
### Submit Feedback

The best way to send feedback is to file an issue at
<https://github.com/richford/AFQ-Insight/issues>.
<https://github.com/tractometry/AFQ-Insight/issues>.

If you are proposing a feature:

Expand Down
33 changes: 17 additions & 16 deletions afqinsight/_serial_bagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
_parallel_predict_regression,
)
from sklearn.ensemble._base import _partition_estimators
from sklearn.utils import check_array, check_random_state, indices_to_mask, resample
from sklearn.utils.metaestimators import if_delegate_has_method
from sklearn.utils import check_array, check_random_state, resample
from sklearn.utils._mask import indices_to_mask
from sklearn.utils.metaestimators import available_if
from sklearn.utils.random import sample_without_replacement
from sklearn.utils.validation import (
_check_sample_weight,
Expand Down Expand Up @@ -102,7 +103,7 @@ def _parallel_build_estimators(
max_samples = ensemble._max_samples
bootstrap = ensemble.bootstrap
bootstrap_features = ensemble.bootstrap_features
support_sample_weight = has_fit_parameter(ensemble.base_estimator_, "sample_weight")
support_sample_weight = has_fit_parameter(ensemble.estimator_, "sample_weight")
if not support_sample_weight and sample_weight is not None:
raise ValueError("The base estimator doesn't support sample weight")

Expand Down Expand Up @@ -181,7 +182,7 @@ class SerialBaggingClassifier(BaggingClassifier):

Parameters
----------
base_estimator : object, default=None
estimator : object, default=None
The base estimator to fit on random subsets of the dataset.
If None, then the base estimator is a decision tree.

Expand Down Expand Up @@ -235,7 +236,7 @@ class SerialBaggingClassifier(BaggingClassifier):

Attributes
----------
base_estimator_ : estimator
estimator_ : estimator
The base estimator from which the ensemble is grown.

n_features_in_ : int
Expand Down Expand Up @@ -286,7 +287,7 @@ class SerialBaggingClassifier(BaggingClassifier):

def __init__(
self,
base_estimator=None,
estimator=None,
n_estimators=10,
*,
max_samples=1.0,
Expand All @@ -300,7 +301,7 @@ def __init__(
verbose=0,
):
super().__init__(
base_estimator=base_estimator,
estimator=estimator,
n_estimators=n_estimators,
max_samples=max_samples,
max_features=max_features,
Expand Down Expand Up @@ -366,7 +367,7 @@ def _fit(self, X, y, max_samples=None, max_depth=None, sample_weight=None):
self._validate_estimator()

if max_depth is not None: # pragma: no cover
self.base_estimator_.max_depth = max_depth
self.estimator_.max_depth = max_depth

# Validate max_samples
if max_samples is None: # pragma: no cover
Expand Down Expand Up @@ -568,7 +569,7 @@ def predict_log_proba(self, X):
classes corresponds to that in the attribute :term:`classes_`.
"""
check_is_fitted(self)
if hasattr(self.base_estimator_, "predict_log_proba"):
if hasattr(self.estimator_, "predict_log_proba"):
# Check data
X = check_array(
X, accept_sparse=["csr", "csc"], dtype=None, force_all_finite=False
Expand Down Expand Up @@ -610,7 +611,7 @@ def predict_log_proba(self, X):
else:
return np.log(self.predict_proba(X))

@if_delegate_has_method(delegate="base_estimator")
@available_if(lambda est: hasattr(est.estimator, "decision_function"))
def decision_function(self, X):
"""Average of the decision functions of the base classifiers.

Expand Down Expand Up @@ -690,7 +691,7 @@ class SerialBaggingRegressor(BaggingRegressor):

Parameters
----------
base_estimator : object, default=None
estimator : object, default=None
The base estimator to fit on random subsets of the dataset.
If None, then the base estimator is a decision tree.

Expand Down Expand Up @@ -745,7 +746,7 @@ class SerialBaggingRegressor(BaggingRegressor):

Attributes
----------
base_estimator_ : estimator
estimator_ : estimator
The base estimator from which the ensemble is grown.

n_features_in_ : int
Expand Down Expand Up @@ -780,7 +781,7 @@ class SerialBaggingRegressor(BaggingRegressor):
>>> X, y = make_regression(n_samples=100, n_features=4,
... n_informative=2, n_targets=1,
... random_state=0, shuffle=False)
>>> regr = BaggingRegressor(base_estimator=SVR(),
>>> regr = BaggingRegressor(estimator=SVR(),
... n_estimators=10, random_state=0).fit(X, y)
>>> regr.predict([[0, 0, 0, 0]])
array([-2.8720...])
Expand All @@ -803,7 +804,7 @@ class SerialBaggingRegressor(BaggingRegressor):

def __init__(
self,
base_estimator=None,
estimator=None,
n_estimators=10,
max_samples=1.0,
max_features=1.0,
Expand All @@ -816,7 +817,7 @@ def __init__(
verbose=0,
):
super().__init__(
base_estimator=base_estimator,
estimator=estimator,
n_estimators=n_estimators,
max_samples=max_samples,
max_features=max_features,
Expand Down Expand Up @@ -881,7 +882,7 @@ def _fit(self, X, y, max_samples=None, max_depth=None, sample_weight=None):
self._validate_estimator()

if max_depth is not None: # pragma: no cover
self.base_estimator_.max_depth = max_depth
self.estimator_.max_depth = max_depth

# Validate max_samples
if max_samples is None: # pragma: no cover
Expand Down
3 changes: 3 additions & 0 deletions afqinsight/neurocombat_sklearn/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .neurocombat import CombatModel

__all__ = ["CombatModel"]
Loading
Loading