0
我想利用max_runtime_seconds,但要麼很難理解這應該是如何工作,或者我覺得更可能 - 有某種錯誤。h2o max_runtime_seconds - 似乎沒有任何影響?
我一直在測試隨機森林,它似乎從來沒有減少運行時間。
import h2o
h2o.init()
from h2o.estimators import H2ORandomForestEstimator
df=h2o.import_file('covtype.csv') #### https://archive.ics.uci.edu/ml/machine-learning-databases/covtype/
for i in df.names:
df[i]=df[i].asfactor()
df.types ## just showing everything is categorical
train,test = df.split_frame(ratios=[0.75], seed = 2017)
response = 'C55'
xvars = train.drop(["C55"]).col_names
mymodel = H2ORandomForestEstimator(
nfolds = 10,
max_runtime_secs = 30,
stopping_rounds = 5,
ntrees = 500
)
mymodel.train(
x = xvars,
y = response,
validation_frame = test,
training_frame = train)
## does not finish remotely close to <30 seconds
mymodel.actual_params()
注意,最大運行時間參數似乎沒有被保存在0 保持我使用H2O的「前沿」版現在〜3.13和蟒蛇。
我的猜測是'max_runtime_secs'指的是爲每個樹運行每個樹的最大分配秒數。因此,如果你有'ntrees = 100',那麼建立這個模型的最長時間是100棵樹x 90秒x 5倍,或45000秒。 –
如果您將發佈完全可重現的示例,則更有可能有人會嘗試幫助您調試問題:https://stackoverflow.com/help/mcve您甚至可以從文檔中複製該文檔:http:// docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/max_runtime_secs.html同時添加一些代碼來計時使用timeit模塊或類似的培訓將有助於證明這實際上是一個錯誤或不。 –
@ Scratch'N'Purr這是一個很好的猜測,但不是,文檔聲明它是整個模型(不是每個樹)的最大運行時間。所以'max_runtime_secs'變量應該在上面的代碼中強制執行一個90秒的時間限制。 –