Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 通过非监督学习模型进行交叉评分_Python_Machine Learning_Scikit Learn - Fatal编程技术网

Python 通过非监督学习模型进行交叉评分

Python 通过非监督学习模型进行交叉评分,python,machine-learning,scikit-learn,Python,Machine Learning,Scikit Learn,当我们将没有predict方法的东西传递给cross\u val\u score时,具体计算了什么,如下所示 from sklearn.model_selection import cross_val_score from sklearn.decomposition import PCA # X is some data, say two dimensional numpy array of reals cross_val_score(PCA(n_components=10), X) 也就是说

当我们将没有
predict
方法的东西传递给
cross\u val\u score
时,具体计算了什么,如下所示

from sklearn.model_selection import cross_val_score
from sklearn.decomposition import PCA
# X is some data, say two dimensional numpy array of reals
cross_val_score(PCA(n_components=10), X)
也就是说,在不使用
y
和不使用
predict
的情况下,使用
cross\u val\u得分

我以前问过,但没有答复


谢谢

在这种情况下,
PCA
有一个评分方法(请参阅):它返回“所有样本的平均对数似然”。因此,您的
交叉验证分数
返回每个交叉验证步骤计算的分数。

那么,您真的尝试过吗?若否,原因为何?如果是,结果是什么?也许,从陈述中有点不清楚,但当然,我试过了,结果是
cross\u val\u score
的标准输出,即数字数组。也许我遗漏了什么,似乎答案很简单,尽管我认为我问错了地方。