<jupyter_start><jupyter_text>**Learning Curve PVT**<jupyter_code>from google.colab import files
uploaded = files.upload()
import numpy as np
import pandas as pd
from sklearn.model_selection import learning_curve
from sklearn.neural_network import MLPRegressor
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
dataset=pd.read_csv('PVT Data.csv')
X=dataset.iloc[:,0:4]
y=dataset.iloc[:,4].values
sc=MinMaxScaler()
Xnorm=pd.DataFrame(data=sc.fit_transform(X))
seed=50
np.random.seed(seed)
clfB = MLPRegressor(activation='relu',alpha=0.01, hidden_layer_sizes=7, learning_rate_init=0.01,
             max_iter=500, solver='lbfgs',random_state=20)
train_sample_sizes, train_MSEscores,test_MSEscores =learning_curve(clfB,Xnorm,y,cv=5,scoring='neg_mean_absolute_error',
                                                      n_jobs=-1,train_sizes=np.linspace(0.1,1.0,100),random_state=10)
train_MSEmean = np.mean(train_MSEscores, axis=1)
test_MSEmean = np.mean(test_MSEscores, axis=1)
plt.plot(train_sample_sizes, -train_MSEmean,  color="k",  label="Training MSE score")
plt.plot(train_sample_sizes, -test_MSEmean,'--', color="k", label="Cross-validation MSE score")
plt.title("Learning Curve for PVT Data Set")
plt.xlabel("Training Set Sample Size"), plt.ylabel("MSE Score"),
plt.legend(loc="best")
plt.tight_layout() 
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13178855901520636, 'fraction_numerical': 0.02172338884866039, 'mean_word_length': 6.160621761658031, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '633677', 'license': 'MIT', 'n_tokens_mistral': 535, 'n_tokens_neox': 503, 'n_words': 83, 'path': 'Case Study 2/PVT/Learning Curve PVT.ipynb', 'repo_name': 'thirasit/Practical-ML-in-Petrol-with-Python', 'size': '1381'}