This is due to this part of the code:
# We are computing the weights for the centered or scaled data,
# that's why we don't transform with the StandardScaler step
w = vt_1_inv_transf(pca_inv_transf(vt_2_inv_transf(beta)))
# Return weights to original units if we had scaled the data..
if self.scale:
w = w/self.best_estimator_.named_steps['standardscaler'].scale_
We should apply vt_1_inv_transf after we rescale the units of w. In the end, standardization takes place after the first VarianceThreshold operation...
Thus, I guess something like this should fix this bug:
# We are computing the weights for the centered or scaled data,
# that's why we don't transform with the StandardScaler step
w = pca_inv_transf(vt_2_inv_transf(beta))
# Return weights to original units if we had scaled the data..
if self.scale:
w = w/self.best_estimator_.named_steps['standardscaler'].scale_
w = vt_1_inv_transf(w)
This is due to this part of the code:
We should apply vt_1_inv_transf after we rescale the units of w. In the end, standardization takes place after the first VarianceThreshold operation...
Thus, I guess something like this should fix this bug: