即使我设置了n_components=2
,使用scikit-learn执行LDA时的结果似乎只包含一个功能。这里会发生什么?
dataset_normnya = datasetLDANorm[index,:]
dataset_normnya.shape
> (10000, 8)
labelLeft = data.iloc[li,6].values
labelLeft.shape
> (10000,)
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
da = LDA(n_components = 2)
dataset_normnyaBaru = da.fit_transform(dataset_normnya, labelLeft)
print(dataset_normnyaBaru.shape)`
> (10000, 1)