C Lang/machine learing

6-7. categorial data handling(one hot encoding, get_dummies, data binning, pd.cut,

iliosncelini 2019. 3. 24. 13:48






Out[60]:
sourcetargetweightcolorweight_sign
0023redM
1124blueL
2235blueXL
In [48]:
Out[48]:
sourcetargetweightcolor_bluecolor_redweight_sign_Lweight_sign_Mweight_sign_XL
002301010
112410100
223510001







regimentcompanynamepreTestScorepostTestScore
0Nighthawks1stMiller425
1Nighthawks1stJacobson2494
2Nighthawks2ndAli3157
3Nighthawks2ndMilner262
4Dragoons1stCooze370
5Dragoons1stJacon425
6Dragoons2ndRyaner2494
7Dragoons2ndSone3157
8Scouts1stSloan262
9Scouts1stPiger370
10Scouts2ndRiani262
11Scouts2ndAli370
In [76]:
Out[76]:
0       Low
1     Great
2      Good
3      Good
4      Good
5       Low
6     Great
7      Good
8      Good
9      Good
10     Good
11     Good
Name: postTestScore, dtype: category
Categories (4, object): [Low < Okay < Good < Great]