我使用python中的H2o包运行xgboost。我开始使用我机器的32个核心。分类器位于for循环中,用于对不同参数运行分类。我正在启动水,并在循环中关闭它。它在循环中运行2-3轮,对于某些运行返回错误“Cannot perform booster operation:updater is inactive on node/127.0.0.1:54321”。 有人知道我为什么会犯这样的错误吗?在
谢谢, 埃尔纳兹
`for dates in start_end_dates:
for window_size in window_sizes:
print dates[0], dates[1], dates[2], window_size
model_string = str(dates[0])+ '_'+ str(dates[1]) + ':'+ str(dates[2])+ ':'+ str(window_size)
## load daily transaction types
## this function runs in parallel on all cpus
daily_transactions_type_df = transform_transactions_types.transform(dates[0], dates[1], window_size)
##load daily transactions
## this function runs in parallel on all cpus
daily_transactions_df = transfrom_daily_transactions.transform(dates[0], dates[1], window_size, max_number_of_instrument)
snapshot_date = dates[1]
## user status list
user_status_list = Classification_helpers.load_user_status_data_from_gbq(snapshot_date)
user_status_list
## Normalize the data
numeric_columns = daily_transactions_type_df.iloc[:,1:].columns.tolist()
other_columns = []
daily_transactions_type_df_norm = Classification_helpers.normalize_data_without_outliers(daily_transactions_type_df, numeric_columns, other_columns)
## Normalize the data
numeric_columns = daily_transactions_df.iloc[:,1:-6].columns.tolist()
other_columns = daily_transactions_df.iloc[:,-5:].columns.tolist()
daily_transactions_df_norm = Classification_helpers.normalize_data_without_outliers(daily_transactions_df,numeric_columns,other_columns)
data_frames = [daily_transactions_type_df_norm, daily_transactions_df_norm, user_status_list[['USER_ID', 'label']]]
df = Classification_helpers.create_labelled_data(data_frames)
numeric_columns = df.iloc[:,1:-6].columns.tolist()
other_columns = df.iloc[:,-6:-1].columns.tolist()
nthreads = -1
Classification_helpers.init_h2o(nthreads)
model, performance, predictions = Classification_helpers.train_XGboost(df, numeric_columns, other_columns, model_string)
print performance.auc()`
使用流接口观察操作:http://127.0.0.1:54321,并注意内存的使用。在
看到了吗 ^{你应该在看屏幕。您将看到每个节点上实时更新的可用内存量。在
如果没有更多的信息,一种猜测可能是内存不足,因为在for循环的每次迭代中都会使用更多的内存。在
如果是这样的话,很难在没有看到你在for循环内做什么的情况下给出建议;但是如果训练数据是相同的,那么就要确保它加载到for循环之外。在最坏的情况下,您应该在for循环中执行H2O init和shutdown(并在每次迭代结束时保存模型,以备以后使用)。在
哦,还有一种可能,正如您没有提到的那样:在您的H2O.init()调用中显式指定给H2O多少内存。你可能会发现你可以通过付出比默认值更多的代价来逃脱惩罚。(但是不要给机器的内存加水,否则一切都会变得不稳定!)在
我也有同样的问题。但是当您指定(example)
max_runtime_secs = 6000
时,不会有任何错误。那个指示器解决了我的问题。在顺便说一句,尝试在
h2o.xgboost
内更改参数,问题可能就在那里。在相关问题 更多 >
编程相关推荐