- Neural Networks with Keras Cookbook
- V Kishore Ayyadevara
- 167字
- 2021-07-02 12:46:32
Getting ready
Given that the objective is to minimize error, let's define the error that we shall be minimizing—we should ensure that a positive error and a negative error do not cancel out each other. Hence, we shall minimize the absolute error. An alternative of this is to minimize the squared error.
Now that we have fine-tuned our objective, let's define our strategy of solving this problem:
- Normalize the input dataset so that all variables range between zero to one.
- Split the given data to train and test datasets.
- Initialize the hidden layer that connects the input of 13 variables to the output of one variable.
- Compile the model with the Adam optimizer, and define the loss function to minimize as the mean absolute error value.
- Fit the model.
- Make a prediction on the test dataset.
- Calculate the error in the prediction on the test dataset.
Now that we have defined our approach, let's go ahead and perform it in code in the next section.
推薦閱讀
- Java逍遙游記
- 深入理解Android(卷I)
- 微信公眾平臺(tái)與小程序開發(fā):從零搭建整套系統(tǒng)
- 小程序?qū)崙?zhàn)視頻課:微信小程序開發(fā)全案精講
- LabVIEW入門與實(shí)戰(zhàn)開發(fā)100例
- 信息可視化的藝術(shù):信息可視化在英國(guó)
- jQuery EasyUI網(wǎng)站開發(fā)實(shí)戰(zhàn)
- Java高手真經(jīng)(高級(jí)編程卷):Java Web高級(jí)開發(fā)技術(shù)
- 編寫高質(zhì)量代碼:改善Python程序的91個(gè)建議
- Java加密與解密的藝術(shù)(第2版)
- C語(yǔ)言程序設(shè)計(jì)教程(第2版)
- 一塊面包板玩轉(zhuǎn)Arduino編程
- 零基礎(chǔ)學(xué)HTML+CSS
- C++程序設(shè)計(jì)教程
- Akka入門與實(shí)踐