def test(): df = pd.DataFrame(np.random.randint(0, 1000, size=(1000000, 10)), columns=['c{}'.format(x) for x in range(10)]) profiler = cProfile.Profile(subcalls=True, builtins=True, timeunit=.001) lbe = LabelEncoder(min_obs=100) profiler.enable() lbe.fit(df) X_new = lbe.transform(df) profiler.disable() profiler.print_stats()
def test(): df = pd.DataFrame( np.random.randint(0, N_CATEGORY, size=(N_OBS, N_FEATURE)), columns=["c{}".format(x) for x in range(N_FEATURE)], ) profiler = cProfile.Profile(subcalls=True, builtins=True, timeunit=0.001) lbe = LabelEncoder(min_obs=100) profiler.enable() lbe.fit(df) _ = lbe.transform(df) profiler.disable() profiler.print_stats()