This file contains hidden or 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
| """Benchmark categorical split performance on the Amazon Employee dataset. | |
| Usage: | |
| # Native categorical handling: | |
| python bench_categorical_tree.py --mode categorical --label cat --output results_cat.csv | |
| # Ordinal (treat integers as numeric): | |
| python bench_categorical_tree.py --mode ordinal --label ord --output results_ord.csv | |
| # One-hot encoding: |
This file contains hidden or 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
| import numpy as np | |
| import torch | |
| import torch.nn as nn | |
| class ResidualBlock(nn.Module): | |
| def __init__(self, latent_dim, inner_dim): | |
| super(ResidualBlock, self).__init__() | |
| self.fc1 = nn.Linear(latent_dim, inner_dim) | |
| self.fc2 = nn.Linear(inner_dim, inner_dim) |
This file contains hidden or 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
| """Instructions | |
| 1. Build this PR and run: | |
| ```bash | |
| python bench_missing_extratrees.py bench ~/bench_results pr_no_pythoncheck | |
| ``` | |
| 2. On main run: | |
| ```bash |
This file contains hidden or 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
| """Instructions | |
| 1. Build this PR and run: | |
| ```bash | |
| python bench_missing_extraforest.py bench ~/bench_results_forest pr | |
| ``` | |
| 2. On main run: | |
| ```bash |
This file contains hidden or 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
| """Instructions | |
| 1. Build this PR and run: | |
| ```bash | |
| python bench_randomforest.py bench ~/bench_results_forest pr | |
| ``` | |
| 2. On main run: | |
| ```bash |
This file contains hidden or 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 sklearn.ensemble import RandomForestClassifier | |
| from sklearn.datasets import make_classification | |
| n_samples = 10_000 | |
| n_features = 200 | |
| n_estimators = 200 | |
| # Generate synthetic classification dataset | |
| X, y = make_classification(n_samples=n_samples, n_features=n_features, n_classes=2, random_state=42) |
This file contains hidden or 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
| """Instructions | |
| 1. Build this PR and run: | |
| ```bash | |
| python bench_missing_extraforest.py bench ~/bench_results_forest pr | |
| ``` | |
| 2. On main run: | |
| ```bash |
This file contains hidden or 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
| """Instructions | |
| 1. Build this PR and run: | |
| ```bash | |
| python bench_missing_extratrees.py bench ~/bench_results pr_no_pythoncheck | |
| ``` | |
| 2. On main run: | |
| ```bash |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder