Skip to content

Add benchmarks for daal4py random forest, fix native RF benches for consistency #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Be consistent with RNG and FPType in native random forests
  • Loading branch information
bibikar committed Jun 6, 2019
commit 54d1b4d859fceeaa1d4c00803e8ef4c8efe9ef58
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ daal4py: data
--fileX data/multi/X-$(SVM_SAMPLES)x$(SVM_FEATURES).npy \
--fileY data/multi/y-$(SVM_SAMPLES)x$(SVM_FEATURES).npy \
--header
python daal4py/df_clsf.py --num-threads $(NUM_THREADS) \
--fileX data/two/X-$(SVM_SAMPLES)x$(SVM_FEATURES).npy \
--fileY data/two/y-$(SVM_SAMPLES)x$(SVM_FEATURES).npy \
--header
python daal4py/df_clsf.py --num-threads $(NUM_THREADS) \
--fileX data/multi/X-$(SVM_SAMPLES)x$(SVM_FEATURES).npy \
--fileY data/multi/y-$(SVM_SAMPLES)x$(SVM_FEATURES).npy \
--header

data: $(KMEANS_DATA) svm_data

Expand Down
5 changes: 3 additions & 2 deletions native/decision_forest_clsf_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ df_classification_fit(
df_clsf_alg.parameter.minObservationsInLeafNode = 1;
df_clsf_alg.parameter.impurityThreshold = min_impurity;
df_clsf_alg.parameter.bootstrap = bootsrap;
df_clsf_alg.parameter.engine = da::engines::mt19937::Batch<double>::create(seed);
df_clsf_alg.parameter.engine = da::engines::mt2203::Batch<double>::create(seed);

if (verbose) {
std::cout << "@ {'nTrees': " << nTrees <<
Expand Down Expand Up @@ -88,7 +88,8 @@ df_classification_predict(
bool verbose
)
{
dfc::prediction::Batch<double> pred_alg(nClasses);
// We explicitly specify float here to match sklearn.
dfc::prediction::Batch<float> pred_alg(nClasses);
pred_alg.input.set(da::classifier::prediction::data, Xt);
pred_alg.input.set(da::classifier::prediction::model,
training_result_ptr->get(da::classifier::training::model));
Expand Down
5 changes: 3 additions & 2 deletions native/decision_forest_regr_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ df_regression_fit(
df_reg_alg.parameter.minObservationsInLeafNode = 1;
df_reg_alg.parameter.impurityThreshold = min_impurity;
df_reg_alg.parameter.bootstrap = bootsrap;
df_reg_alg.parameter.engine = da::engines::mt19937::Batch<double>::create(seed);
df_reg_alg.parameter.engine = da::engines::mt2203::Batch<double>::create(seed);

if (verbose) {
std::cout << "@ {'nTrees': " << nTrees <<
Expand Down Expand Up @@ -85,7 +85,8 @@ df_regression_predict(
bool verbose
)
{
dfr::prediction::Batch<double> pred_alg;
// We explicitly specify float here to match sklearn.
dfr::prediction::Batch<float> pred_alg;
pred_alg.input.set(dfr::prediction::data, Xt);
pred_alg.input.set(dfr::prediction::model,
training_result_ptr->get(dfr::training::model));
Expand Down