python小波尺度图的LDA降维

python小波尺度图的LDA降维,python,feature-extraction,feature-selection,lda,dimensionality-reduction,Python,Feature Extraction,Feature Selection,Lda,Dimensionality Reduction,我试图降低具有相同尺寸[5x3844]的多个比例图的维数。 我如何在python中使用LDA应用它 任何帮助都将不胜感激 代码: def wavelet(data): fs=256 lowcut=117 highcut=123 y=butter_bandstop_filter(data, lowcut, highcut, fs, order=6) lowcut=57 highcut=63 y=butter_bandstop_filter(y

我试图降低具有相同尺寸[5x3844]的多个比例图的维数。 我如何在python中使用LDA应用它

任何帮助都将不胜感激

代码

def wavelet(data):
    fs=256
    lowcut=117
    highcut=123
    y=butter_bandstop_filter(data, lowcut, highcut, fs, order=6)
    lowcut=57
    highcut=63
    y=butter_bandstop_filter(y, lowcut, highcut, fs, order=6)
    cutoff=1
    y=butter_highpass_filter(y, cutoff, fs, order=6)
    coeffs = wavedec(y, 'sym5', level=5)
    cA5,cD5,cD4,cD3,cD2,cD1=coeffs
    result = []
    common_x = np.linspace(0,3844, len(cD1))
    for c in [cD5,cD4,cD3,cD2,cD1]:
        x = np.linspace(0, 3844, len(c))
        f = interp1d(x, c)
        result.append(f(common_x)) 
    return result

你看过scikit learn LDA实现吗?@KirtimanSinha是的,但我不知道如何在我的数据上应用它。LDA是受监督的,你有没有试图预测的类标签?如果您想进行无监督学习,您可能需要查看PCA或SVD。@KirtimanSinha是的,我正在处理癫痫发作癫痫数据集以预测癫痫发作。我想应用LDA来减少维度减少。如果结果列表是您的预测值(
X
),并且您有一个培训标签列表(
Y
)然后它就像
clf.fit(X,y)
一样简单。我错过了什么?