Now that we have our features and our labels, we're ready to create and train our machine learning classifiers for our algorithmic trading strategy. The classifiers we use here are the Random Forest, Linear SVC, NuSVC, and Logistic Regression. sample code: http://pythonprogramming.net http://hkinsley.com https://twitter.com/sentdex http://sentdex.com http://seaofbtc.com
Visibility: 5789
Duration: 12m 33s
Rating: 39
ValueError: setting an array element with a sequence.
There was a runtime error on line 85.
I deleted line 85 just to see what happen and got the same error on line 90.
79 clf = RandomForestClassifier()
81 last_prices = price_list[-context.feature_window:]
82 current_features = (np.around(np.diff(last_prices) / last_prices[:-1]) * 100.0, 1)
84 X.append(current_features)
85 X = preprocessing.scale(X)
87 current_features = X[-1]
88 X = X[:-1]
90 clf.fit(X,y)
92 p = clf.predit(current_features)[0]
93 print(('Prediction',p))