Changeset 9619:647e4075633b in orange


Ignore:
Timestamp:
02/02/12 18:03:47 (2 years ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
rebase_source:
329ae514e2d4c5799e56befbf73b518f890d44a2
Message:

PLS now also sets the multitarget flag for continuized discrete classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/regression/pls.py

    r9612 r9619  
    233233            if domain.class_var: 
    234234                y_vars = [domain.class_var] 
    235                 multitarget = False 
    236235            elif domain.class_vars: 
    237236                y_vars = domain.class_vars 
    238                 multitarget = True 
    239237            else: 
    240238                raise TypeError('Class-less domain (x-vars and y-vars needed).') 
    241239            x_table = select_attrs(table, x_vars) 
    242240            y_table = select_attrs(table, y_vars) 
    243         elif x_vars and y_vars: 
    244             # independent and response variables are passed by the caller 
    245             multitarget = True 
    246         else: 
     241        elif not (x_vars and y_vars): 
    247242            raise ValueError("Both x_vars and y_vars must be defined.") 
    248243 
     
    262257         
    263258        domain = Orange.data.Domain(x_vars + y_vars, False) 
    264          
     259        multitarget = True if len(y_vars) > 1 else False 
     260 
    265261        x = x_table.to_numpy()[0] 
    266262        y = y_table.to_numpy()[0] 
Note: See TracChangeset for help on using the changeset viewer.