| ######cuML###### | ######Sklearn###### |
| | |
| from cuml import | from sklearn.ensemble import |
| RandomForestClassifier as cuRF | RandomForestClassifier as sklRF |
| | import multiprocessing as mp |
| | |
| # cuml Random Forest params | #sklearn Random Forest params |
| cu_rf_params = { | skl_rf_params = { |
| ‘n_estimators’: 25, | ‘n_estimators’: 25, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cuml.dask.ensemble import RandomForestClassifier as cuRF_mg | |
# cuml Random Forest params | |
cu_rf_params = { | |
‘n_estimators’: 25, | |
‘max_depth’: 13, | |
‘n_bins’: 15, | |
‘n_streams’: 8 | |
} | |
# Start by setting up the CUDA cluster on the local host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(A) Initialize a bit mask indicating which samples are contained in each node | |
(B) Initialize a “node map” indicating which nodes are present at each level | |
(C) ForEach(tree_level) | |
1. Find the node id of all data samples, using the bit mask | |
2. Compute the possible splits for all bins, all columns and all nodes | |
3. Find the best split for each node | |
4. Update the bit mask and sparse node map to feed the next level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instance | Red | Green | Blue | Size (cm) | Fruit (Label) | |
---|---|---|---|---|---|---|
1 | 0.0 | 1.0 | 0.0 | 20 | Water Melon | |
0 | 1.0 | 0.0 | 0.0 | 7.0 | Apple | |
5 | 1.0 | 0.0 | 0.0 | 0.8 | Cherry | |
2 | 1.0 | 0.0 | 0.0 | 1.0 | Cherry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instance | Red | Green | Blue | Size (cm) | Fruit (Label) | |
---|---|---|---|---|---|---|
4 | 1.0 | 0.0 | 0.0 | 1.0 | Strawberry | |
4 | 1.0 | 0.0 | 0.0 | 1.0 | Strawberry | |
1 | 0.0 | 1.0 | 0.0 | 20 | Water Melon | |
3 | 0.0 | 1.0 | 0.0 | 7.5 | Apple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instance | Red | Green | Blue | Size (cm) | Fruit (Label) | |
---|---|---|---|---|---|---|
5 | 1.0 | 0.0 | 0.0 | 0.8 | Cherry | |
0 | 1.0 | 0.0 | 0.0 | 7.0 | Apple | |
0 | 1.0 | 0.0 | 0.0 | 7.0 | Apple | |
4 | 1.0 | 0.0 | 0.0 | 1.0 | Strawberry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instance | Red | Green | Blue | Size (cm) | Fruit (Label) | |
---|---|---|---|---|---|---|
0 | 1.0 | 0.0 | 0.0 | 7.0 | Apple | |
1 | 0.0 | 1.0 | 0.0 | 20 | Water Melon | |
2 | 1.0 | 0.0 | 0.0 | 1.0 | Cherry | |
3 | 0.0 | 1.0 | 0.0 | 7.5 | Apple | |
4 | 1.0 | 0.0 | 0.0 | 1.0 | Strawberry | |
5 | 1.0 | 0.0 | 0.0 | 0.8 | Cherry |