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

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.

主站蜘蛛池模板: 芷江| 宁强县| 平湖市| 贺州市| 海口市| 齐齐哈尔市| 翼城县| 大邑县| 绩溪县| 娄底市| 合水县| 宣城市| 罗江县| 江油市| 丽江市| 罗城| 呼伦贝尔市| 祁东县| 鄯善县| 嘉峪关市| 东乌珠穆沁旗| 宽城| 乌鲁木齐市| 东城区| 巴彦淖尔市| 乌拉特后旗| 南汇区| 吕梁市| 个旧市| 栖霞市| 海门市| 澎湖县| 德钦县| 偃师市| 福清市| 商洛市| 拜城县| 醴陵市| 溧水县| 孝感市| 瓦房店市|