Skip to content

Fix crash on no feature indices#41

Open
edelangh wants to merge 1 commit intomaciejkula:masterfrom
edelangh:fix_crash_no_feature
Open

Fix crash on no feature indices#41
edelangh wants to merge 1 commit intomaciejkula:masterfrom
edelangh:fix_crash_no_feature

Conversation

@edelangh
Copy link
Contributor

If no feature indices are detected, clasifier will panic

   9:     0x56419f61951b - <core::option::Option<T>>::unwrap::hd8b8ff2812a12642
                               at /checkout/src/libcore/macros.rs:20
  10:     0x56419f61206a - rustlearn::trees::decision_tree::FeatureIndices::new::h713ea4d48acd865b
                               at /home/rico/.cargo/git/checkouts/rustlearn-1ee86889f45d433e/2ef4de2/src/trees/decision_tree.rs:58
  11:     0x56419f613345 - <rustlearn::trees::decision_tree::DecisionTree as rustlearn::traits::SupervisedModel<&'a rustlearn::array::dense::Array>>::fit::hcc2df1c85dd330cc
                               at /home/rico/.cargo/git/checkouts/rustlearn-1ee86889f45d433e/2ef4de2/src/trees/decision_tree.rs:323
  12:     0x56419f603adf - <rustlearn::ensemble::random_forest::RandomForest as rustlearn::traits::SupervisedModel<&'a rustlearn::array::dense::Array>>::fit::hba6d79b944d21aa4
                               at /home/rico/.cargo/git/checkouts/rustlearn-1ee86889f45d433e/2ef4de2/src/ensemble/random_forest.rs:119

@edelangh edelangh force-pushed the fix_crash_no_feature branch from 653af19 to cebc244 Compare August 29, 2018 16:36
@maciejkula
Copy link
Owner

Does this algorithm even make sense when there are no indices? Maybe it would be preferable to return an error.

If no feature indices are detected, clasifier will panic.
Now it return an Err
@edelangh edelangh force-pushed the fix_crash_no_feature branch from cebc244 to 45dfdb2 Compare August 30, 2018 09:12
@edelangh
Copy link
Contributor Author

You're right !
It's done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants