Noob needing some help - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Noob needing some help (/thread-8760.html) |
Noob needing some help - TheDovah7 - Mar-06-2018 I am a new python user and I don't understand this error message. The code I have is: import pandas as pd import quandl, math import numpy as np from sklearn import preprocessing, cross_validation, svm from sklearn.linear_model import LinearRegression df = quandl.get("WIKI/GOOGL", authtoken="X5A1-ewy2UCfkFVfGKuW") 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.dropna(inplace=True) y= np.array(df["label"]) print(len(x),len(y))And the error I am getting is:
RE: Noob needing some help - nilamo - Mar-06-2018 Whatever line it's referencing is using an old interface which won't exist in future versions of whatever library you're using on that line. It might work fine now, though. RE: Noob needing some help - buran - Mar-06-2018 post your actual code. your error cite line 41 and you have just 31 lines in the code. in general this is not error, but depreciation warning - some module (sklearn.preprocessing?) you use is depreciated and will be replaced by model_selection in next version. you will need to update your code if you want to move to next sklearn version. EDIT: from the docs (ver. 18.0) Quote:The model_selection module so, from what you import it is sklearn.cross_validation that has been depreciated.
|