Utilities.py 文件源码

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

项目:a-cadmci 作者: florez87 项目源码 文件源码
def getClasses(labels):
        """
        Get unique values from a column of labels.

        Parameters
        ----------
        labels: array-like of shape = [number_samples] or [number_samples, number_outputs]
            The target values (class labels in classification).

        Return
        ----------
        classes: ndarray
            The sorted unique labels

        ids: ndarray
            The indices of the first occurrences of the unique values in the original array.
        """
        uniques, ids = numpy.unique(labels, return_inverse=True)
        return uniques, ids
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号