- R Programming By Example
- Omar Trejo Navarro
- 176字
- 2021-07-02 21:30:45
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.
推薦閱讀
- 蕩胸生層云:C語言開發(fā)修行實(shí)錄
- 計(jì)算機(jī)原理
- 來吧!帶你玩轉(zhuǎn)Excel VBA
- Hands-On Cloud Solutions with Azure
- 圖解PLC控制系統(tǒng)梯形圖和語句表
- ServiceNow Cookbook
- 數(shù)據(jù)挖掘?qū)嵱冒咐治?/a>
- 大數(shù)據(jù)挑戰(zhàn)與NoSQL數(shù)據(jù)庫技術(shù)
- 大數(shù)據(jù)時(shí)代
- Linux服務(wù)與安全管理
- Nginx高性能Web服務(wù)器詳解
- Mastering ServiceNow Scripting
- 單片機(jī)C語言程序設(shè)計(jì)完全自學(xué)手冊
- Photoshop CS5圖像處理入門、進(jìn)階與提高
- SQL Server數(shù)據(jù)庫應(yīng)用基礎(chǔ)(第2版)