2017-04-03 12 views
0

私は次のコード私はスパイダーでのpython 3でアナコンダを使用しています「sklearn.leanear_model」エラーがアナコンダ3で発生したという名前のモジュール、スパイダー

import pandas as pd 
import quandl 
import math 
import numpy as np 
from sklearn import preprocessing, cross_validation, svm 
from sklearn.leanear_model import LearnRegression 


df = quandl.get('WIKI/GOOGL') 
df = df[['Adj. Open','Adj. High','Adj. Low','Adj. Close','Adj. Volume',]] 
df['HL_PCT'] = (df['Adj. High'] - df['Adj. Close'])/df['Adj. Close']*100.0 
df['PCT_change'] = (df['Adj. Close'] - df['Adj. Open'])/df['Adj. Open']*100.0 

df = df[['Adj. Close','HL_PCT','PCT_change','Adj. Volume']] 

forecast_col='Adj. Close' 
df.fillna(-99999, inplace=True) 

forecast_out=int(math.ceil(0.01*len(df))) 

df['label'] = df[forecast_col].shift(-forecast_out) 
df.dropna(inplace=True) 

X = np.array(df.drop(['label'],1)) 
y=np.array(df['label']) 

X = preprocessing.scale(X) 

X=X[:-forecast_out+1] 
df.drona(inplace=True) 
y = np.array(df['label']) 

print(len(X),len(y)) 

を実行しますが、それは

runfile('C:/Users/jayram/.spyder-py3/temp.py', wdir='C:/Users/jayram/.spyder-py3') 
C:\Users\jayram\Anaconda3\lib\site-packages\sklearn\cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20. 
    "This module will be removed in 0.20.", DeprecationWarning) 
Traceback (most recent call last): 

    File "<ipython-input-1-f93a3ccc2710>", line 1, in <module> 
    runfile('C:/Users/jayram/.spyder-py3/temp.py', wdir='C:/Users/jayram/.spyder-py3') 

    File "C:\Users\jayram\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile 
    execfile(filename, namespace) 

    File "C:\Users\jayram\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile 
    exec(compile(f.read(), filename, 'exec'), namespace) 

    File "C:/Users/jayram/.spyder-py3/temp.py", line 6, in <module> 
    from sklearn.leanear_model import LearnRegression 

ModuleNotFoundError: No module named 'sklearn.leanear_model' 
次のエラーを示してい

anacondaにはすべてのパッケージがインストールされていますか?なぜ上記のエラーが表示されますか?またはanacondaのインストール後にパッケージをインストールする必要がありますか?

答えて

関連する問題