-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
owneuralnetwork: connect callbacks to NN through n_iters_
MLPClassifier n_iters_ was made a property which calls a callback.
- Loading branch information
1 parent
3fc7292
commit e7c89a2
Showing
5 changed files
with
57 additions
and
27 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import sklearn.neural_network as skl_nn | ||
from Orange.base import NNBase | ||
from Orange.regression import SklLearner | ||
from Orange.classification.neural_network import NIterCallbackMixin | ||
|
||
__all__ = ["NNRegressionLearner"] | ||
|
||
|
||
class MLPRegressorWCallback(skl_nn.MLPRegressor, NIterCallbackMixin): | ||
pass | ||
|
||
|
||
class NNRegressionLearner(NNBase, SklLearner): | ||
__wraps__ = skl_nn.MLPRegressor | ||
__wraps__ = MLPRegressorWCallback | ||
|
||
def _initialize_wrapped(self): | ||
clf = SklLearner._initialize_wrapped(self) | ||
clf.orange_callback = getattr(self, "callback", None) | ||
return clf |
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