![keras 回归预测](https://img-blog.csdnimg.cn/img_convert/2b5dc64d83d58877959d1665895feb92.png)
keras 回归预测
Keras-使用MPL进行回归预测 (Keras - Regression Prediction using MPL)
In this chapter, let us write a simple MPL based ANN to do regression prediction. Till now, we have only done the classification based prediction. Now, we will try to predict the next possible value by analyzing the previous (continuous) values and its influencing factors.
在本章中,让我们编写一个基于MPL的简单ANN进行回归预测。 到目前为止,我们仅完成了基于分类的预测。 现在,我们将尝试通过分析先前(连续)的值及其影响因素来预测下一个可能的值。
The Regression MPL can be represented as below −
回归MPL可以表示如下-
![MPL](https://img-blog.csdnimg.cn/img_convert/cc2232ad917057e0f5cf92dd7c9fa4ef.png)
The core features of the model are as follows −
该模型的核心特征如下-
Input layer consists of (13,) values.
输入层由(13,)个值组成。
First layer, Dense consists of 64 units and ‘relu’ activation function with ‘normal’ kernel initializer.
第一层, Dense由64个单元和带有“正常”内核初始化程序的“ relu”激活功能组成。
Second layer, Dense consists of 64 units and ‘relu’ activation function.
第二层, Dense由64个单元和“ relu”激活功能组成。
Output layer, Dense consists of 1 unit.
输出层, Dense由1个单元组成。
Use mse as loss function.
使用mse作为损失函数。
Use RMSprop as Optimizer.
使用RMSprop作为优化程序。
Use accuracy as metrics.
使用准确性作为指标。
Use 128 as batch size.
使用128作为批处理大小。
Use 500 as epochs.
使用500作为时代。
Step 1 − Import the modules
步骤1-导入模块
Let us import the necessary modules.
让我们导入必要的模块。
import keras
from keras.datasets import boston_housing
from keras.models import S