liangzulin's recent timeline updates
liangzulin

liangzulin

V2EX member #327307, joined on 2018-07-06 11:29:40 +08:00
liangzulin's recent replies
DataFrame ?你确定说的是 DataFrame 吗?这是 xgboost python 里边的 API 吧。
spark 在 JAVA 里边是 Dataset<>

如果是 pandas DataFrame 的话,转成 DMatrix 是这么转的:
df = pd.read_csv('some_data.csv')
X_train_df = df[['col_x1', 'col_x2', 'col_x3', 'col_x4']]
y_train_df = df[['col_y']]
dtrain = xgb.DMatrix(X_train_df, label=y_train_df)
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2500 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms · UTC 02:39 · PVG 10:39 · LAX 19:39 · JFK 22:39
♥ Do have faith in what you're doing.