import pandas as pd import numpy as np from sklearn.metrics import rocaucscore,…
- User
import pandas as pd import numpy as np from sklearn.metrics import roc_auc_score, confusion_matrix, roc_curve, precision_recall_curve, f1_score, auc,
accuracy_score, precision_score, recall_score from sklearn.calibration import CalibratedClassifierCV import matplotlib.pyplot as plt import seaborn as snsimport warnings warnings.filterwarnings('ignore')
import vtests, mkb
import joblib
from sklearn.linear_model import LogisticRegression
from orm_logreg.main_stats import Statistics
import json from collections import defaultdict
import optbinning
from typing import Optional import pandas as pd from tqdm.auto import tqdm from optbinning import OptimalBinning, BinningProcess
import sys
import os import datetime from datetime import datetime выдал ошибку RuntimeError Traceback (most recent call last) RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe Output exceeds the size limit. Open the full output data in a text editor--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[2], line 3 1 import pandas as pd 2 import numpy as np ----> 3 from sklearn.metrics import roc_auc_score, confusion_matrix, roc_curve, precision_recall_curve, f1_score, auc,
4 accuracy_score, precision_score, recall_score 5 from sklearn.calibration import CalibratedClassifierCV 6 import matplotlib.pyplot as pltFile c:\Work\Anaconda3\envs\py_dvc\lib\site-packages\sklearn_init_.py:82 80 from . import _distributor_init # noqa: F401 81 from . import __check_build # noqa: F401 ---> 82 from .base import clone 83 from .utils._show_versions import show_versions 85 all = [ 86 "calibration", 87 "cluster", (...) 128 "show_versions", 129 ]
File c:\Work\Anaconda3\envs\py_dvc\lib\site-packages\sklearn\base.py:17 15 from . import version 16 from ._config import get_config ... 12 get_csr_submatrix) 13 from ._sputils import upcast 15 from ._compressed import _cs_matrix
ImportError: numpy.core.multiarray failed to import почему?
- Assistant
The error:
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xeand
ImportError: numpy.core.multiarray failed to importsuggest that there might be a mismatch between the version of NumPy that was used to compile
scikit-learn(or another Python package) and the version that you currently have installed in your Python environment.The versions of Python packages are tightly coupled with the versions of other packages they depend upon. When a package like
scikit-learnis built, it is compiled against specific versions of its dependencies, in this case, NumPy. If the NumPy version in your environment is older or newer than the one was compiled with, you may run into issues like this. - User
почему может не работать !pip uninstall numpy
- Assistant
The command
!pip uninstall numpyis typically used in Jupyter notebooks to uninstall the NumPy package. Here are a few reasons why it may not work as expected: