Pytest fails with an incompatibility with newer scikit-learn
- Dominant language
- Python
- Stars
- 26
- Forks
- 19
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 1
Description
While building for nixpkgs:
```sh
=================================== FAILURES ===================================
____________________ TestModelRegistry.test_model_registry _____________________
self =
setup = None
mlflow_client =
def test_model_registry(self, setup, mlflow_client):
# Start an MLflow run
registered_model_name = generate_uuid(20)
> X_train, lr = train_iris_logistic_regression_model()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/integration/tests/test_model_registry.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def train_iris_logistic_regression_model():
# Load the Iris dataset
X, y = datasets.load_iris(return_X_y=True)
# Split the data into training and test sets
X_train, _, y_train, _ = train_test_split(X, y, test_size=0.2, random_state=42)
# Define the model hyperparameters
params = {
"solver": "lbfgs",
"max_iter": 1000,
"multi_class": "auto",
"random_state": 8888,
}
# Train the model
> lr = LogisticRegression(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E TypeError: LogisticRegression.__init__() got an unexpected keyword argument 'multi_class'
test/integration/utils/sklearn_utils.py:22: TypeError
```
Contributor guide
Research direction
Start with test/integration/utils/sklearn_utils.py and the failing test in test/integration/tests/test_model_registry.py. Run the model registry integration test under the newer scikit-learn version and compare the LogisticRegression parameters with the installed API. Done means the test no longer raises the constructor TypeError and the model registry test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, scikit-learn
- Domain
- machine-learning, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100