Problem During application of linear regression

by: sayan, 7 years ago


I am new to linear regression and machine learning.
I did the following... and ended up with a hugr error which ends with:
" ImportError: DLL load failed: The specified module could not be found. "
I don't understand how to solve this issue. I have all the modules installed. I'm using python 3.5.2, and the updated version of pip ( pip 9.0.1 )



import pandas as pd
import numpy as np
import quandl
import math
from sklearn import preprocessing, cross_validation, svm
from sklearn.linear_model import LinearRegression

quandl.ApiConfig.api_key = 'rb6SGMgaCHExRg6yos7N'
df = quandl.get('WIKI/GOOGL')

#print(df.head())

df = df[['Adj. Open', 'Adj. High', 'Adj. Low', 'Adj. Close', 'Adj. Volume']]
#print(df.head())
df['HL_PCT'] = ((df['Adj. High'] - df['Adj. Low']) / df['Adj. Low'] )*100.0

df['OC_PCT'] = ((df['Adj. Close'] - df['Adj. Open']) / df['Adj. Close'] )*100.0
###print(df.head())

##df = df[['OC_PCT', 'HL_PCT', 'Adj. Volume']]
###print(df.head())

forecast_col = 'Adj. Close'
##print(df[forecast_col])
df.fillna(value=-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_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, test_size=0.2)
clf = svm.SVR()
clf.fit(X_train, y_train)
confidence = clf.score(X_test, y_test)
print(confidence)





You must be logged in to post. Please login or register an account.



Which module is that error in reference to? Also you should probably remove your API key from the code, or change it.

-Harrison 7 years ago

You must be logged in to post. Please login or register an account.