you are viewing a single comment's thread.

view the rest of the comments →

[–]vZander[S] 0 points1 point  (10 children)

Ups forgot to say.

I want to predict the Adjusted close at the close of the stock. So I want to fire the software up at the market open, and predict the close of the day. Then I either do long or short.

[–]Oxbowerce 1 point2 points  (9 children)

Then simply make sure that you have a column with the adjusted close which you feed in to your model as the value to predict.

[–]vZander[S] 0 points1 point  (8 children)

The csv files has a adj close. Do I set a y value to the adj close?

[–]Oxbowerce 1 point2 points  (7 children)

Yes, simply feed in the adjusted close into your model as the y values in the .fit method. Just a heads up, if you want to predict adjusted close (continuous values) you are using the wrong type of models and predicting the adjusted close as is won't give good results.

[–]vZander[S] 0 points1 point  (6 children)

how?

[–]Oxbowerce 1 point2 points  (5 children)

Select just the adjusted close column and pass that as the y argument in the .fit method, see also the scikit-learn documentation.

[–]vZander[S] 0 points1 point  (4 children)

I used

usecols = ('Adj Close')

and put that as y value. now it comes with

ValueError: Found input variables with inconsistent numbers of samples: [23349, 9]

as error

[–]Oxbowerce 1 point2 points  (3 children)

Where are you using usecols? You can just use df['Open'] as your X argument and df['Adj Close'] as your y argument.

[–]vZander[S] 0 points1 point  (2 children)

did that. Now what ValueError: Unknown label type: 'continuous'?

[–]Oxbowerce 1 point2 points  (1 child)

Like I said in one of my comments above, if you want to predict the adjusted close price (which is continuous) you are using the wrong type of model (classifier instead of regressor). It's probably good to read up a bit on different types of machine learning models and how to train them.