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

Predicting votes from wards with unknown data

Now that we know how to train our models and find the best one possible, we will provide predictions for those wards for which we don't have voting data using the best models we found using the Vote measure. To do so, we simply execute the following line:

predictions <- predict(best_lm_fit_by_votes, data_incomplete)

predictions
#> 804 805 806 807 808 809 810 811 812 813
#> 0.6845 0.6238 0.5286 0.4092 0.5236 0.6727 0.6322 0.6723 0.6891 0.6004
#> 814 815 816 817 818 819 820 821 822 823
#> 0.6426 0.5854 0.6966 0.6073 0.4869 0.5974 0.5611 0.4784 0.5534 0.6151
(Truncated output)

This will take the best model we found earlier using the Votes measure and use it to generate predictions for the Proportion variable in the data_incomplete data, which contains those observations for which we don't have any voting data. These are the best predictions we can provide with what we have done so far and we can expect them to have a 91% accuracy when used to categorize the Proportion variable into the Vote variable.

主站蜘蛛池模板: 韶山市| 靖安县| 宁阳县| 桐乡市| 阿克苏市| 勐海县| 崇礼县| 泌阳县| 萨迦县| 海淀区| 恩施市| 莲花县| 循化| 聂荣县| 贵德县| 巍山| 山丹县| 阳泉市| 上思县| 开阳县| 乾安县| 宿松县| 扎鲁特旗| 上栗县| 望江县| 峨边| 新源县| 山阴县| 隆安县| 丹东市| 临汾市| 玉溪市| 茂名市| 景谷| 鹿泉市| 运城市| 阿合奇县| 隆德县| 积石山| 南城县| 体育|