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

update compatibility with scikitlearn 1.4 #1343

Merged
merged 1 commit into from
Feb 22, 2024
Merged

update compatibility with scikitlearn 1.4 #1343

merged 1 commit into from
Feb 22, 2024

Conversation

perib
Copy link
Contributor

@perib perib commented Feb 20, 2024

[please review the Contribution Guidelines prior to submitting your pull request. go ahead and delete this line if you've already reviewed said guidelines.]

What does this PR do?

This resolves the error encountered in #1341 . The latest version of sklearn updated the internal function def _fit_and_score to take in an additional score_params parameter. When TPOT attempted to evaluate a pipeline with this function, it would throw an error because this parameter was missing.

The parameter was introduced in this PR https://github.com/scikit-learn/scikit-learn/pull/26896/files

How should this PR be tested?

I tested with the following code. Runs with the fix but not without the fix.

from tpot import TPOTClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import numpy as np

iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data.astype(np.float64),
    iris.target.astype(np.float64), train_size=0.75, test_size=0.25, random_state=42)

est = TPOTClassifier(generations=5, population_size=50, verbosity=2, random_state=42)
est.fit(X_train, y_train) 

Questions:

  • Do the docs need to be updated?
  • Does this PR add new (Python) dependencies?

Updates the dependencies of scikit learn to version 1.4 . This change is incompatible with previous versions of scikit-learn

@jay-m-dev jay-m-dev self-assigned this Feb 21, 2024
@jay-m-dev jay-m-dev self-requested a review February 21, 2024 21:28
Copy link
Contributor

@jay-m-dev jay-m-dev left a comment

Choose a reason for hiding this comment

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

Tested on Python 3.10.12 and 3.12.1

@jay-m-dev jay-m-dev merged commit db64799 into master Feb 22, 2024
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