source: orange/Orange/OrangeWidgets/Regression/OWKNNRegression.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 869 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

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.