@@ -25,16 +25,17 @@ class OWKNNLearner(OWBaseLearner):
2525
2626 def add_main_layout (self ):
2727 box = gui .vBox (self .controlArea , "Neighbors" )
28- gui .spin (box , self , "n_neighbors" , 1 , 100 , label = "Number of neighbors:" ,
29- alignment = Qt .AlignRight , callback = self .settings_changed )
30- gui .comboBox (box , self , "metric_index" , label = "Metric:" ,
31- orientation = Qt .Horizontal ,
32- items = [i .capitalize () for i in self .metrics ],
33- callback = self .settings_changed )
34- gui .comboBox (box , self , "weight_type" , label = "Weight:" ,
35- orientation = Qt .Horizontal ,
36- items = [i .capitalize () for i in self .weights ],
37- callback = self .settings_changed )
28+ self .n_neighbors_spin = gui .spin (
29+ box , self , "n_neighbors" , 1 , 100 , label = "Number of neighbors:" ,
30+ alignment = Qt .AlignRight , callback = self .settings_changed )
31+ self .metrics_combo = gui .comboBox (
32+ box , self , "metric_index" , orientation = Qt .Horizontal ,
33+ label = "Metric:" , items = [i .capitalize () for i in self .metrics ],
34+ callback = self .settings_changed )
35+ self .weights_combo = gui .comboBox (
36+ box , self , "weight_type" , orientation = Qt .Horizontal ,
37+ label = "Weight:" , items = [i .capitalize () for i in self .weights ],
38+ callback = self .settings_changed )
3839
3940 def create_learner (self ):
4041 return self .LEARNER (
0 commit comments