机器学习-TMall 重复购买预测

import copy
import gc
from collections import Counter

import pandas as pd
from pandas import *
import numpy as np
def reduce_mem_usage(df,verbose=True):
    start_mem =df.memory_usage().sum()/1024**2
    numerics= ['int16','int32','int64','float16','float32','float64']

    for col in df.columns:
        col_type = df[col].dtypes
        if col_type in numerics:
            c_min = df[col].min()
            c_max = df[col].max()

        if str(col_type)[:3]=='int':
            if c_min>np.iinfo(np.int8).min and c_maxnp.iinfo(np.int16).min and c_maxnp.iinfo(np.int32).min and c_max

你可能感兴趣的:(机器学习,python,深度学习)