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.
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
# SKLearn's one-vs-rest class requires that the (binary) estimator object implements decision_function() or predict_proba(). | |
# If you want the internal estimator to contain a parameter sweeping layer (so that each ovr classifier gets optimized separately), | |
# this fails due to the following chain of events: | |
# | |
# 1. OVR checks `hasattr(estimator, 'predict_proba')` at construction time | |
# 2. `hasattr()` tries to call `getattr(estimator, 'predict_proba')` and fails if an exception is thrown | |
# 3. Because the estimator has not yet been fit, it has no `best_estimator_` property, so it throws an exception and fails | |
# 4. `hasattr()` misinterprets this exception, and returns false. | |
# | |
# We can circumvent this probelm by putting a wrapper on the predict_proba and decision_function methods, but this is a dirty, dirty hack. |
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.