我有 2000 多个 ANN 数据集。我已经在其中应用了 MLPRegressor。我的代码工作正常。但是对于测试,我想修复我的测试值,例如我有 50 个数据集。从那我想测试前 20 个值。如何在代码中解决这个问题?我使用了以下代码。
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.neural_network import MLPRegressor
df = pd.read_csv("0.5-1.csv")
df.head()
X = df[['wavelength', 'phase velocity']]
y = df['shear wave velocity']
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2)
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import mean_absolute_error
mlp = MLPRegressor(hidden_layer_sizes=(30,30,30))
mlp.fit(X_train,y_train)