source: orange/orange/OrangeWidgets/Regression/OWKNNRegression.py @ 9546:2b6cc6f397fe

Revision 9546:2b6cc6f397fe, 869 bytes checked in by ales_erjavec <ales.erjavec@…>, 2 years ago (diff)

Renamed widget channel names in line with the new naming rules/convention.
Added backwards compatibility in orngDoc loadDocument to enable loading of schemas saved before the change.

Line 
1"""
2<name>k Nearest Neighbours Regression</name>
3<description>K-nearest neighbours learner/predictor.</description>
4<icon>icons/kNearestNeighbours.png</icon>
5<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
6<priority>20</priority>
7<keywords>knn</keywords>
8"""
9
10from OWKNN import *
11
12class OWKNNRegression(OWKNN):
13    def __init__(self, parent=None, signalManager=None, title="kNN Regression"):
14        OWKNN.__init__(self, parent, signalManager, title)
15       
16        self.inputs = [("Data", ExampleTable, self.setData), ("Preprocess", PreprocessedLearner, self.setPreprocessor)]
17        self.outputs = [("Learner", orange.Learner),("kNN Classifier", orange.kNNClassifier)]
18           
19    def setData(self,data):
20        self.data = self.isDataWithClass(data, orange.VarTypes.Continuous, checkMissing=True) and data or None
21        self.setLearner()
Note: See TracBrowser for help on using the repository browser.