File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 22class  BaseDatafit :
33    """Base class for datafits.""" 
44
5+     @staticmethod  
6+     def  inverse_link (x ):
7+         """Inverse link function (identity by default). 
8+ 
9+         Parameters 
10+         ---------- 
11+         x : array-like 
12+             Linear predictor values. 
13+ 
14+         Returns 
15+         ------- 
16+         array-like 
17+             Transformed values in response scale. 
18+         """ 
19+         return  x 
20+ 
521    def  get_spec (self ):
622        """Specify the numba types of the class attributes. 
723
Original file line number Diff line number Diff line change @@ -266,10 +266,8 @@ def predict(self, X):
266266            else :
267267                indices  =  scores .argmax (axis = 1 )
268268            return  self .classes_ [indices ]
269-         elif  hasattr (self .datafit , "inverse_link" ):
270-             return  self .datafit .inverse_link (self ._decision_function (X ))
271269        else :
272-             return  self ._decision_function (X )
270+             return  self .datafit . inverse_link ( self . _decision_function (X ) )
273271
274272    def  get_params (self , deep = False ):
275273        """Get parameters of the estimators including the datafit's and penalty's. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments