Skip to content

scaling the weights back to original units in the orignal space is giving error #3

Description

@jrasero

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions