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

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.

主站蜘蛛池模板: 台湾省| 永登县| 乳山市| 永定县| 文山县| 麻城市| 崇左市| 彰化县| 三门峡市| 甘南县| 滦南县| 达尔| 安西县| 阿拉尔市| 呼和浩特市| 崇州市| 漯河市| 惠东县| 林州市| 辉县市| 广饶县| 新巴尔虎左旗| 泾阳县| 岑巩县| 宜宾市| 揭西县| 沾益县| 宽城| 东丰县| 丘北县| 玛多县| 开鲁县| 仁怀市| 诸暨市| 尖扎县| 奉化市| 若尔盖县| 镇平县| 海淀区| 龙口市| 怀集县|