官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 马边| 河西区| 新野县| 上林县| 浮山县| 丰原市| 怀仁县| 镇沅| 信宜市| 南靖县| 彩票| 钟祥市| 霍林郭勒市| 壶关县| 察隅县| 莱芜市| 新晃| 吴旗县| 菏泽市| 磴口县| 务川| 临泉县| 调兵山市| 普格县| 郎溪县| 商洛市| 海丰县| 扶沟县| 陆河县| 丰顺县| 沅陵县| 八宿县| 呈贡县| 仁怀市| 肃宁县| 宁武县| 高雄市| 民乐县| 阳山县| 定南县| 苏尼特右旗|