def _spark_fit(self, cls, Z, *args, **kwargs):
mapper = lambda X_y: super(cls, self).fit(<EOL>X_y[<NUM_LIT:0>], X_y[<NUM_LIT:1>], *args, **kwargs<EOL>)<EOL>models = Z.map(mapper)<EOL>avg = models.reduce(operator.add) / models.count()<EOL>self.__dict__.update(avg.__dict__)<EOL>return self<EOL>
Wraps a Scikit-learn Linear model's fit method to use with RDD
        input.

        Parameters
        ----------
        cls : class object
            The sklearn linear model's class to wrap.
        Z : TupleRDD or DictRDD
            The distributed train data in a DictRDD.

        Returns
        -------
        self: the wrapped class