EpistasisLab / EpistasisLab/tpot

Import issue with tpot 0.12.0 and sklearn 1.0.2

Open
#1,314 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
10.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

[provide general introduction to the issue and why it is relevant to this repository]

## Context of the issue

tpot 0.12.0 gives error with scikit-learn v1.0.2, but loads ok with scikit-learn v1.1.3

## Process to reproduce the issue

`import tpot`

## Expected result

TPOT loads without error

## Current result

```
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in :1 │
│ │
│ C:\...\lib\site-packages\tpot\__init__.py:27 in │
│ │
│ │
│ 24 """ │
│ 25 │
│ 26 from ._version import __version__ │
│ ❱ 27 from .tpot import TPOTClassifier, TPOTRegressor │
│ 28 from .driver import main │
│ 29 │
│ │
│ C:\...\lib\site-packages\tpot\tpot.py:31 in │
│ │
│ 28 │
│ 29 import numpy as np │
│ 30 │
│ ❱ 31 from .base import TPOTBase │
│ 32 from .config.classifier import classifier_config_dict │
│ 33 from .config.regressor import regressor_config_dict │
│ 34 │
│ │
│ C:\...\lib\site-packages\tpot\base.py:83 in │
│ │
│ 80 from .config.classifier_cuml import classifier_config_cuml │
│ 81 from .config.regressor_cuml import regressor_config_cuml │
│ 82 │
│ ❱ 83 from .metrics import SCORERS │
│ 84 from .gp_types import Output_Array │
│ 85 from .gp_deap import ( │
│ 86 │ eaMuPlusLambda, │
│ │
│ C:\...\lib\site-packages\tpot\metrics.py:27 in │
│ │
│ │
│ 24 """ │
│ 25 │
│ 26 import numpy as np │
│ ❱ 27 from sklearn.metrics import get_scorer, get_scorer_names, make_scorer │
│ 28 │
│ 29 │
│ 30 def balanced_accuracy(y_true, y_pred): │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'get_scorer_names' from 'sklearn.metrics'
```

## Possible fix

Either increase the required version of sckit-learn or fix tpot to keep current dependency.

## `name of issue` screenshot

[if relevant, include a screenshot]

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.