Home>
Error message

Py 7 series/conda When using the sklearn library in 4.7.12, an error saying No module named 'sklearn.liner_model' appears. The same error occurs even if the library is uninstalled and reinstalled. Hope you can find a solution,

Error message
-------------------------------------------------- -------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-13-d482cac5b107>in<module>
      2 import pandas as pd
      Three
---->4 from sklearn.liner_model import LogisticRegression
      Five 
      6 df = load_train_data ()
ModuleNotFoundError: No module named 'sklearn.liner_model'
Applicable source code

import numpy as np
import pandas as pd

from sklearn.liner_model import LogisticRegression

df = load_train_data ()
x_train = df.drop (["Survived", "Name", "Ticket", "Fare", "Cabin", "Embarked"], axis = 1)
y_train = df ["Survived"]. values ​​

import sklearn.preprocessing as sp

le = sp.LabelEncoder ()
le.fit (x_train.Sex.unique ())
x_train.Sex = le.fit_transform (x_train.Sex)

Python3.7

pip3 uninstall scikit-learn

pip3 install -U scikit-learn

Confirmed that pip3 freeze was installed

Supplemental information (FW/tool version etc.)

Please provide more detailed information here.