Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在keras中查看每个历元后的验证错误_Python_Machine Learning_Keras - Fatal编程技术网

Python 如何在keras中查看每个历元后的验证错误

Python 如何在keras中查看每个历元后的验证错误,python,machine-learning,keras,Python,Machine Learning,Keras,我正在使用keras来训练回归模型。我的代码如下所示: estimators = [] estimators.append(('standardize', StandardScaler())) estimators.append(('mlp', KerasRegressor(build_fn=baseline_model, epochs=100, batch_size=32, verbose=2))) pipeline = Pipeline(estimators) X_train, X_test

我正在使用keras来训练回归模型。我的代码如下所示:

estimators = []
estimators.append(('standardize', StandardScaler()))
estimators.append(('mlp', KerasRegressor(build_fn=baseline_model, epochs=100, batch_size=32, verbose=2)))
pipeline = Pipeline(estimators)
X_train, X_test, y_train, y_test = train_test_split(X, Y,
                                                    train_size=0.75, test_size=0.25)
pipeline.fit(X_train, y_train)
问题是,它明显地过度拟合了。我怎样才能看到这个世界 每个历元后的验证错误

您可以将以下方法传输到Keras回归或拟合:

验证分割:浮动(0. 通过管道:

**fit_params:dict of string->object Parameters传递给每个步骤的fit方法,其中每个参数名称的前缀如下 步骤s的参数p具有键s\u\p

例如:

pipeline.fit(X_train, y_train, mlp__validation_split=0.3)
您可以将以下方法传输到Keras回归或拟合:

验证分割:浮动(0. 通过管道:

**fit_params:dict of string->object Parameters传递给每个步骤的fit方法,其中每个参数名称的前缀如下 步骤s的参数p具有键s\u\p

例如:

pipeline.fit(X_train, y_train, mlp__validation_split=0.3)

非常感谢你。我会问另一个关于过度装修的问题。非常感谢。我会问一个关于过度装配问题的不同问题。