The documentation for RandomForestRegressor states that input samples will be converted to dtype=np.float32internally.
, numpy Pandas ( )
numpy dtypes Pandas. ( script ) .csv :
df = pd.read_csv(filename, usecols=[0, 4, 5, 10],
dtype={0: np.uint8,
4: np.uint32,
5: np.uint16,
10: np.float16})
dtype DataFrame, Series.astype():
s = pd.Series(...)
s = s.astype(np.float16)
df = pd.DataFrame(...)
df['col1'] = df['col1'].astype(np.float16)
DataFrame , DataFrame.astype():
df = pd.DataFrame(...)
df[['col1', 'col2']] = df[['col1', 'col2']].astype(np.float16)