Scikit-learn에서 semi-supervised regression 작업에 레이블 전파를 사용할 수 있습니까? API에 따르면 대답은 '예'입니다. scikit-learn에 의한 회귀에 대한 반 감독 학습
그러나 다음 코드를 실행하려고하면 오류 메시지가 나타납니다. . label_propagation.LabelSpreading에서() (X, y_30) 라인에 맞게
from sklearn import datasets
from sklearn.semi_supervised import label_propagation
import numpy as np
rng=np.random.RandomState(0)
boston = datasets.load_boston()
X=boston.data
y=boston.target
y_30=np.copy(y)
y_30[rng.rand(len(y))<0.3]=-999
label_propagation.LabelSpreading().fit(X,y_30)
그것은 ": 알 수없는 레이블 유형 '연속'에 ValueError"는 것을 보여줍니다.
어떻게 문제를 해결해야합니까? 고마워. "
이론적으로check_classification_targets(y)
# actual graph construction (implementations should override this)
graph_matrix = self._build_graph()
# label construction
# construct a categorical distribution for classification only
classes = np.unique(y)
classes = (classes[classes != -1])
는"check_classification_targets "호출을 제거하고 사용할 수 있습니다