<jupyter_start><jupyter_text>MLP<jupyter_code>from sklearn.neural_network import MLPRegressor
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split

regr = MLPRegressor(random_state=1, max_iter=500).fit(x_train, y_train)
pred= regr.predict(x_test)
pred
new_pred=[]
for i in range(len(pred)):
    new=[]
    new.append(pred[i])
    new_pred.append(new)
predictions = scaler.inverse_transform(new_pred)
rmse=np.sqrt(np.mean(((predictions- y_test)**2)))
rmse
mse= np.mean((predictions-y_test)**2)
mse
valid = data[training_data_len:]
valid['Predictions'] = predictions
plt.figure(figsize=(10,5))
plt.title('MLP Model Result')
plt.xlabel('Date', fontsize=18)
plt.ylabel('Close Price USD ($)', fontsize=18)
plt.plot(valid[['Prices', 'Predictions']])
plt.legend(['Valid', 'Predictions'])
plt.show()<jupyter_output>/home/ashok/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:2: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
{'fraction_non_alphanumeric': 0.14085667215815487, 'fraction_numerical': 0.01400329489291598, 'mean_word_length': 7.046357615894039, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '202240', 'license': 'MIT', 'n_tokens_mistral': 467, 'n_tokens_neox': 446, 'n_words': 83, 'path': 'mlp.ipynb', 'repo_name': 'Akbhobhiya/Tweet-Sentiment-Analysis-Effect-on-Stock-Price', 'size': '1214'}