I want to cascade 4 steps in a pipeline to build a supervised classifier:
(1) dimension reduction with PCA, obtaining a matrix_1 of s rows (samples) by c columns (components).
(2) feed the output matrix_1 from (1) to a KMeans blind separation, obtaining a matrix_2 of s rows (samples) by 1 column (group label).
(3) horizontally concatenate matrix_1 from (1) and matrix_2 from (2), obtaining a matrix_3 of s rows (samples) by c+1 columns (c components plus 1 label).
(4) feed the output matrix_3 from (3) to a neural network of MLPClassifier.
So my pipeline will look like this:
Pipeline(steps=[('step1', PCA()), ('step2', KMeans()), ('step3', myStep3(FastICA().components_, KMeans().labels_)), ('step4', MLPClassifier())])
Now my question is how to realized the 'step3' in the pipeline. Is there a sklearn function/class for me to replace "myStep3()"?