Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Performing logarithmic transformation on the feature
- cp['price_log']=np.log(cp['price'])
- # Reciprocal Transformation – This will inverse values of Price i.e1/Price
- cp['price_reciprocal']=np.reciprocal(cp.price)
- normality(cp,'price_reciprocal')
- # Square Root Transformation
- cp['price_sqroot']=np.sqrt(cp.price)
- normality(cp,'price_sqroot')
- # Exponential Transformation: The exponential value of the Price variable will be taken.
- cp['price_exponential']=np.exp(cp.price)
- normality(cp,'price_exponential')
- # Box-Cox Transformation
- cp['price_Boxcox'],parameters=stats.boxcox(cp['price'])
Add Comment
Please, Sign In to add comment