0

I used StandardScaler() to scale my original data and the original data's shape was (91,4).

c.shape
> (91,4)
column = c.columns.to_list()
scaler = StandardScaler()
d = scaler.fit_transform(c)

and as I continue to model, I had to difference the data and added more columns so ended up with (90,6).

d.shape
> (90,6)
scaler.inverse_transform(d)
ValueError: operands could not be broadcast together with shapes (90,6) (4,) (90,6)

How do I inverse scale back to original?

Thank you

Edit) example

Original:
           Feature A  | Feature B | Feature C |Feature D |
    22Q1  | 2.9e4     | 1092      | 1.86e7    | 50293    |
    22Q2  | 1.4e5     | 1290      | 2.2e7     | 48240    |
    22Q3  | 1.78e5    | 1121      | 1.9e7     | 61546    |
    22Q4  | 3.08e5    | 895       | 2.24e7    | 57209    |

scaled:

    FeatureA |Feature B|Feature C|Feature D|PredictTrain|PredictTest|
22Q1| 0.048  | 0.051   | 0.8489  |-0.095   | 0.01874    | 0.0187    |
22Q2| 0.002  | -.005   | 0.852   | 0.05    | 0.0226     | 0.01866   |
22Q3| 0.172  | -.0537  | -0.772  | -0.198  | 0.0047     | 0.01885   |
22Q4| 0.577  | -0.018  | -0.222  | -0.81   | 0.0287     | 0.016     |

need above to an original form.

0 Answers0