# Changeset 10615:e97eeb46ebfa in orange

Ignore:
Timestamp:
03/22/12 16:44:12 (2 years ago)
Branch:
default
Message:

Some cleanup in linear regression.

File:
1 edited

Unmodified
Removed
• ## Orange/regression/linear.py

 r10605 :type table: :class:`Orange.data.Table` :param weight: the weights for instances. Default: None, i.e. all data instances are eqaully important in fitting all data instances are equally important in fitting the regression parameters :type weight: None or list of Orange.feature.Continuous which stores weights for instances """ if not self.use_vars is None: if self.use_vars is not None: new_domain = Orange.data.Domain(self.use_vars, table.domain.class_var) table = Orange.data.Table(new_domain, table) # dicrete values are continuized # discrete values are continuized table = self.continuize_table(table) table = Orange.data.Table(new_domain, table) # convertion to numpy A, y, w = table.to_numpy() n, m = numpy.shape(A) domain = table.domain # convert to numpy X, y, w = table.to_numpy() n, m = numpy.shape(X) if self.intercept: X = numpy.insert(A, 0, 1, axis=1) # adds a column of ones else: X = A domain = table.domain X = numpy.insert(X, 0, 1, axis=1) # adds a column of ones if weight: dict_model["Intercept"] = (coefficients[0], std_error[0], t_scores[0], p_vals[0]) for i, var in enumerate(domain.attributes): for i, var in enumerate(domain.features): j = i + 1 if self.intercept else i dict_model[var.name] = (coefficients[j], std_error[j],
Note: See TracChangeset for help on using the changeset viewer.