Changeset 10615:e97eeb46ebfa in orange
 Timestamp:
 03/22/12 16:44:12 (2 years ago)
 Branch:
 default
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/regression/linear.py
r10605 r10615 203 203 :type table: :class:`Orange.data.Table` 204 204 :param weight: the weights for instances. Default: None, i.e. 205 all data instances are eq aully important in fitting205 all data instances are equally important in fitting 206 206 the regression parameters 207 207 :type weight: None or list of Orange.feature.Continuous 208 208 which stores weights for instances 209 209 """ 210 if not self.use_vars isNone:210 if self.use_vars is not None: 211 211 new_domain = Orange.data.Domain(self.use_vars, 212 212 table.domain.class_var) … … 214 214 table = Orange.data.Table(new_domain, table) 215 215 216 # di crete values are continuized216 # discrete values are continuized 217 217 table = self.continuize_table(table) 218 218 … … 227 227 table = Orange.data.Table(new_domain, table) 228 228 229 # convertion to numpy 230 A, y, w = table.to_numpy() 231 n, m = numpy.shape(A) 229 domain = table.domain 230 231 # convert to numpy 232 X, y, w = table.to_numpy() 233 n, m = numpy.shape(X) 232 234 233 235 if self.intercept: 234 X = numpy.insert(A, 0, 1, axis=1) # adds a column of ones 235 else: 236 X = A 237 238 domain = table.domain 236 X = numpy.insert(X, 0, 1, axis=1) # adds a column of ones 239 237 240 238 if weight: … … 299 297 dict_model["Intercept"] = (coefficients[0], std_error[0], 300 298 t_scores[0], p_vals[0]) 301 for i, var in enumerate(domain. attributes):299 for i, var in enumerate(domain.features): 302 300 j = i + 1 if self.intercept else i 303 301 dict_model[var.name] = (coefficients[j], std_error[j],
Note: See TracChangeset
for help on using the changeset viewer.