In fact I am not clear about the difference between mixin and abc. I 
mimic LogisticRegression because both are based on liblinear. I want 
LinearRegressorMixin act as Mixin like LinearClassifierMixin for 
LogisticRegression.

predict method of LinearModel will work but _center_data and 
_set_intercept seem useless here.

scores.ravel() is not necessary here. I will remove it.

On 04/18/2013 02:51 PM, jnothman wrote:
>
> In sklearn/linear_model/base.py:
>
> > +    """
> > +    def decision_function(self,X):
> > +        """Predict using the linear model
> > +
> > +        Parameters
> > +        ----------
> > +        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
> > +
> > +        Returns
> > +        -------
> > +        array, shape = [n_samples]
> > +           Predicted target values per element in X.
> > +        """
> > +        X = atleast2d_or_csr(X)
> > +        scores = safe_sparse_dot(X, self.coef_.T, dense_output=True) + self.intercept_
> > +        return scores.ravel()
>
> The only differences between this class and |LinearModel| seem to be 
> the |ravel| and constraining the |X| validation a bit more. I don't 
> understand why this case needs to be distinguished, what cases require 
> |ravel|, or why this class cannot merely wrap |LinearModel| to make 
> the minor differences more apparent. Or is it more to do with this 
> being a |Mixin| and that an |ABC|?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/scikit-learn/scikit-learn/pull/1867/files#r3847760>.
>


-- 
Qiang Luo
Department of Mathematical Sciences
Tsinghua University
Beijing 100084
China