Changeset 3692:f53a9edbe21b in orange


Ignore:
Timestamp:
05/27/07 17:05:46 (7 years ago)
Author:
blaz <blaz.zupan@…>
Branch:
default
Convert:
ff9cc191289fb496beecba43a3dd913b2289a9ee
Message:

linear regression now returns distribution (which is false, 0, just so that it works with orngTest and orngStat)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/orngRegression.py

    r3679 r3692  
    8989        self.beta = self.statistics['model']['estCoeff'] 
    9090 
    91     def __call__(self, example): 
     91    def __call__(self, example, returntype=None): 
    9292        ex = orange.Example(self.domain, example) 
    9393        ex = numpy.array(ex.native()) 
     
    9797        else: 
    9898            yhat = dot(self.beta, ex[:-1]) 
    99           
    100         return yhat 
     99        dist = 0                    # this should be distribution 
     100 
     101        if result_type == orange.GetValue: 
     102            return yhat 
     103        if result_type == orange.GetProbabilities: 
     104            return dist 
     105        return (v, dist) # for orange.GetBoth 
    101106 
    102107def printLinearRegression(lr): 
Note: See TracChangeset for help on using the changeset viewer.