Value counts before label encoding: Southampton 646 Cherbourg 168 Queenstown 77 Name: embark_town, dtype: int64 Value counts after label encoding: 2 646 0 168 1 77 Name: embark_town, dtype: int64 Value counts after inverse transform: Southampton 646 Cherbourg 168 Queenstown 77 Name: embark_town, dtype: int64
As we can see, after the inverse transform, the encoded values 2, 0, and 1 have been replaced with Southampton, Cherbourg, and Queenstown, respectively.








































0 Comments