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

Boosting model

Boosting is also an ensemble learning model. Here, we are using the AdaBoostRegressor model, and we will again produce 50 estimators. The following screenshot shows the algorithm used for this model:

The following screenshot shows the train_mse and test_mse results that we get after training all these models:

The following screenshot shows the algorithm and gives the comparison of all of these models on the basis of the values of the test mean squared error. The result is shown with the help of a horizontal bar graph:

Now, when we compare the result of all of these models, we can see that the random forest model is the most successful. The bagging and KNN models come second and third, respectively. This is why we use the KNN model with the bagging model.

The following screenshot shows the algorithm used to produce a graphical representation between the predicted prices and the observed prices while testing the dataset, and also shows the performance of the random forest model:

On using this model again with a predict API or with a predict method, we can get individual predictions.

For example, let's predict the values for the first ten predictions that we get from the testing dataset. The following algorithm shows the prediction that is made by this random forest model, which in turns shows us the real price and the predicted price of the diamonds that we have from the testing dataset:

From this screenshot, we can see that the values for Real price and Predicted price are very close, both for the expensive and inexpensive diamonds.

主站蜘蛛池模板: 娄烦县| 柘城县| 乐山市| 德钦县| 泾源县| 弥勒县| 江油市| 大丰市| 广丰县| 洪湖市| 水城县| 义马市| 高陵县| 涟源市| 临猗县| 聂拉木县| 武乡县| 贵溪市| 聂拉木县| 绿春县| 原阳县| 南京市| 宜章县| 共和县| 资阳市| 九龙坡区| 阳信县| 交口县| 崇义县| 中西区| 互助| 和林格尔县| 呼和浩特市| 天门市| 柞水县| 武强县| 琼结县| 安丘市| 邹平县| 巴马| 阿克苏市|