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

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.

主站蜘蛛池模板: 榕江县| 建德市| 荃湾区| 久治县| 襄城县| 永顺县| 古浪县| 昭觉县| 武穴市| 南充市| 宽甸| 灵寿县| 大英县| 慈利县| 宝清县| 泽州县| 济阳县| 苍山县| 循化| 政和县| 玉门市| 民丰县| 中方县| 清河县| 新闻| 体育| 遵化市| 玛纳斯县| 静乐县| 合肥市| 西安市| 广元市| 砚山县| 垫江县| 寿宁县| 清水河县| 抚宁县| 新干县| 磴口县| 万州区| 四子王旗|