You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am encountering a problem while installing mlrose to run code below, in poth python 3.12 and 3.10.10. i am using pycharm as an editor.
code:
import lib
import mlrose
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, recall_score, roc_auc_score
from sklearn.preprocessing import StandardScaler
Load the dataset
data = pd.read_csv('heart_statlog_cleveland_hungary_final.csv')
X = data.iloc[:, :-1].values
y = data.iloc[:, -1].values
Split the dataset into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
here is the command output:
Collecting mlrose==1.1.0
Using cached mlrose-1.1.0-py3-none-any.whl.metadata (4.4 kB)
Requirement already satisfied: numpy in c:\users\wajee\pycharmprojects\pythonproject3.venv\lib\site-packages (from mlrose==1.1.0) (1.26.4)
Requirement already satisfied: scipy in c:\users\wajee\pycharmprojects\pythonproject3.venv\lib\site-packages (from mlrose==1.1.0) (1.13.0)
Collecting sklearn (from mlrose==1.1.0)
Using cached sklearn-0.0.post12.tar.gz (2.6 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[15 lines of output]
The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
rather than 'sklearn' for pip commands.
Here is how to fix this error in the main use cases:
use 'pip install scikit-learn' rather than 'pip install sklearn'
replace 'sklearn' by 'scikit-learn' in your pip requirements files
(requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
if the 'sklearn' package is used by one of your dependencies,
it would be great if you take some time to track which package uses
'sklearn' instead of 'scikit-learn' and report it to their issue tracker
as a last resort, set the environment variable
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error
If you do %pip install (or variations) inside a notebook, you need to set the environment variable via os.environ, i.e. something like this should work:
i am encountering a problem while installing mlrose to run code below, in poth python 3.12 and 3.10.10. i am using pycharm as an editor.
code:
import lib
import mlrose
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, recall_score, roc_auc_score
from sklearn.preprocessing import StandardScaler
Load the dataset
data = pd.read_csv('heart_statlog_cleveland_hungary_final.csv')
X = data.iloc[:, :-1].values
y = data.iloc[:, -1].values
Split the dataset into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
Feature scaling
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
Define a fitness function based on the neural network
nn_model1 = mlrose.NeuralNetwork(hidden_nodes=[10], activation='relu',
algorithm='gradient_descent', max_iters=1000,
bias=True, is_classifier=True, learning_rate=0.0001,
early_stopping=True, clip_max=5, max_attempts=100,
random_state=3)
here is the command output:
Collecting mlrose==1.1.0
Using cached mlrose-1.1.0-py3-none-any.whl.metadata (4.4 kB)
Requirement already satisfied: numpy in c:\users\wajee\pycharmprojects\pythonproject3.venv\lib\site-packages (from mlrose==1.1.0) (1.26.4)
Requirement already satisfied: scipy in c:\users\wajee\pycharmprojects\pythonproject3.venv\lib\site-packages (from mlrose==1.1.0) (1.13.0)
Collecting sklearn (from mlrose==1.1.0)
Using cached sklearn-0.0.post12.tar.gz (2.6 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[15 lines of output]
The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
rather than 'sklearn' for pip commands.
Here is how to fix this error in the main use cases:
(requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
it would be great if you take some time to track which package uses
'sklearn' instead of 'scikit-learn' and report it to their issue tracker
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error
More information is available at
https://github.com/scikit-learn/sklearn-pypi-package
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
The text was updated successfully, but these errors were encountered: