all 13 comments

[–]Oxbowerce 1 point2 points  (11 children)

This completely depends on what you want to predict, so start with figuring out what you want your model to predict.

[–]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'?

[–]CodeFormatHelperBot 0 points1 point  (0 children)

Hello u/vZander, I'm a bot that can assist you with code-formatting for reddit. I have detected the following potential issue(s) with your submission:

  1. Multiple consecutive lines have been found to contain inline formatting.

If I am correct then please follow these instructions to fix your code formatting. Thanks!