<jupyter_start><jupyter_text>X - features1. Extract the `forecast_col`, in this example 'Close'1. Ignore the last `forecast_out` number of rows, they will be used later to test the prediction in `x_lately`1. Scale the values using the `sklearn.preprocessing.scale` function to get better results<jupyter_code># x - features, extract forecast collumn, remove last 5 rows (they will be used for prediction later), scalling the valies 
x = np.array(df[[forecast_col]])
#x = preprocessing.scale(x)
x_lately = x[-forecast_out:]
x = x[:-forecast_out]
x, x_lately<jupyter_output><empty_output><jupyter_text>Y - label1. E<jupyter_code># y - label
label = df[forecast_col].shift(-forecast_out)
label.dropna(inplace=True)
y = np.array(label)
y[10:], y[:10]
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=test_size, random_state=0)
model = LinearRegression()
model.fit(x_train, y_train)
score = model.score(x_test, y_test)
forecast = model.predict(x_lately)
score, forecast, x_lately<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11925708699902249, 'fraction_numerical': 0.009775171065493646, 'mean_word_length': 6.641791044776119, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '520874', 'license': 'MIT', 'n_tokens_mistral': 382, 'n_tokens_neox': 375, 'n_words': 98, 'path': 'Stocks Price Prediction.ipynb', 'repo_name': 'jaswdr/notebooks', 'size': '1023'}