Changeset 10449:74928ebb2543 in orange


Ignore:
Timestamp:
03/06/12 16:58:02 (2 years ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
Message:

Added a checkbox for intercept to Linear Regression widget.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Regression/OWLinearRegression.py

    r10156 r10449  
    1818 
    1919class OWLinearRegression(OWWidget): 
    20     settingsList = ["name", "use_ridge", "ridge_lambda",  
     20    settingsList = ["name", "intercept", "use_ridge", "ridge_lambda", 
    2121                    "use_lasso", "t", "tol"] 
    2222     
     
    3636          
    3737        self.name = "Linear Regression" 
     38        self.intercept = True 
    3839        self.use_ridge = False 
    3940        self.ridge_lambda = 1.0 
     
    5051        OWGUI.lineEdit(self.controlArea, self, "name", box="Learner/predictor name",    
    5152                       tooltip="Name of the learner/predictor") 
     53         
     54        OWGUI.checkBox(self.controlArea, self, 'intercept', 'Intercept') 
    5255         
    5356        bbox = OWGUI.radioButtonsInBox(self.controlArea, self, "use_lasso", [],  
     
    121124        if self.use_ridge: 
    122125            learner = linear.LinearRegressionLearner(name=self.name, 
    123                                                 ridgeLambda=self.ridge_lambda) 
     126                intercept=self.intercept, ridgeLambda=self.ridge_lambda) 
    124127        else: 
    125             learner = linear.LinearRegressionLearner(name=self.name) 
     128            learner = linear.LinearRegressionLearner(name=self.name, 
     129                intercept=self.intercept) 
    126130        predictor = None 
    127131        if self.preprocessor: 
Note: See TracChangeset for help on using the changeset viewer.