- Ensemble Machine Learning Cookbook
- Dipayan Sarkar Vijayalakshmi Natarajan
- 193字
- 2021-07-02 13:21:57
How it works...
In Step 1, we imported the libraries that are required to build our models. In Step 2, we created the response and feature sets. We retrieved our feature set using the iloc() function of the pandas DataFrame. In Step 3, we split our dataset into training and testing sets. In Step 4, we built our base classifiers. Kindly note that we passed probability=True to our SVC function to allow SVC() to return class probabilities. In the SVC class, the default is probability=False.
In Step 5, we fitted our model to the training data. We used the predict_proba() function in Step 6 to predict the class probabilities for our test observations.
Finally, in Step 7, we assigned different weights to each of our models to estimate the weighted average predictions. The question that comes up is how to choose the weights. One way is to sample the weights uniformly and to make sure they normalize to one and validate on the test set and repeat keeping track of weights that provide the highest accuracy. This is an example of a random search.
- 計算機應用
- LabVIEW虛擬儀器從入門到測控應用130例
- 走入IBM小型機世界
- Mastering VMware vSphere 6.5
- 深度學習中的圖像分類與對抗技術
- Mastering Elastic Stack
- Apache Spark Deep Learning Cookbook
- 21天學通Java Web開發
- JavaScript典型應用與最佳實踐
- 聊天機器人:入門、進階與實戰
- Windows Server 2008 R2活動目錄內幕
- Salesforce Advanced Administrator Certification Guide
- 電氣控制與PLC原理及應用(歐姆龍機型)
- Spark大數據商業實戰三部曲:內核解密|商業案例|性能調優
- 人工智能云平臺:原理、設計與應用