template.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:project-template 作者: scikit-learn-contrib 项目源码 文件源码
def fit(self, X, y):
        """A reference implementation of a fitting function for a classifier.

        Parameters
        ----------
        X : array-like, shape = [n_samples, n_features]
            The training input samples.
        y : array-like, shape = [n_samples]
            The target values. An array of int.

        Returns
        -------
        self : object
            Returns self.
        """
        # Check that X and y have correct shape
        X, y = check_X_y(X, y)
        # Store the classes seen during fit
        self.classes_ = unique_labels(y)

        self.X_ = X
        self.y_ = y
        # Return the classifier
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号