- Learning Data Mining with Python(Second Edition)
- Robert Layton
- 169字
- 2021-07-02 23:40:10
Setting parameters in Random Forests
The Random Forest implementation in scikit-learn is called RandomForestClassifier, and it has a number of parameters. As Random Forests use many instances of DecisionTreeClassifier, they share many of the same parameters such as the criterion (Gini Impurity or Entropy/information gain), max_features, and min_samples_split.
There are some new parameters that are used in the ensemble process:
- n_estimators: This dictates how many decision trees should be built. A higher value will take longer to run, but will (probably) result in a higher accuracy.
- oob_score: If true, the method is tested using samples that aren't in the random subsamples chosen for training the decision trees.
- n_jobs: This specifies the number of cores to use when training the decision trees in parallel.
The scikit-learn package uses a library called Joblib for inbuilt parallelization. This parameter dictates how many cores to use. By default, only a single core is used--if you have more cores, you can increase this, or set it to -1 to use all cores.
推薦閱讀
- 深入淺出DPDK
- SQL Server 2016數(shù)據(jù)庫應(yīng)用與開發(fā)習(xí)題解答與上機(jī)指導(dǎo)
- AutoCAD VBA參數(shù)化繪圖程序開發(fā)與實(shí)戰(zhàn)編碼
- .NET 3.5編程
- SQL Server與JSP動(dòng)態(tài)網(wǎng)站開發(fā)
- 領(lǐng)域驅(qū)動(dòng)設(shè)計(jì):軟件核心復(fù)雜性應(yīng)對(duì)之道(修訂版)
- Android嵌入式系統(tǒng)程序開發(fā):基于Cortex-A8(第2版)
- Java Web應(yīng)用開發(fā)項(xiàng)目教程
- Android應(yīng)用開發(fā)實(shí)戰(zhàn)
- 單片機(jī)原理及應(yīng)用技術(shù)
- 算法圖解
- Photoshop智能手機(jī)APP界面設(shè)計(jì)
- 深入理解Java虛擬機(jī):JVM高級(jí)特性與最佳實(shí)踐
- Python數(shù)據(jù)科學(xué)實(shí)踐指南
- Android熱門應(yīng)用開發(fā)詳解