File: neural_network.py

package info (click to toggle)
orange3 3.40.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,912 kB
  • sloc: python: 162,745; ansic: 622; makefile: 322; sh: 93; cpp: 77
file content (17 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from Orange.classification import NNClassificationLearner
from Orange.modelling import SklFitter
from Orange.regression import NNRegressionLearner

__all__ = ['NNLearner']


class NNLearner(SklFitter):
    __fits__ = {'classification': NNClassificationLearner,
                'regression': NNRegressionLearner}

    callback = None

    def get_learner(self, problem_type):
        learner = super().get_learner(problem_type)
        learner.callback = self.callback
        return learner