h2o build_tree_one_node понимание того, когда использовать для производительности - PullRequest
0 голосов
/ 20 апреля 2020

в H2o есть опция использования параметра build_tree_one_node для gbm и случайного леса. Документация гласит следующее:

Включите эту опцию, чтобы указать, что алгоритм будет работать на одном узле. Эта опция подходит для небольших наборов данных, так как нет нагрузки на сеть, но используется меньшее количество процессоров.

Может ли кто-нибудь привести какой-то контекст или примеры того, когда производительность будет выше при использовании этого набора на ИСТИНА ? Я ничего не могу найти в inte rnet по этому поводу.

from h2o.estimators.gbm import H2OGradientBoostingEstimator
h2o.init()

# import the cars dataset:
# this dataset is used to classify whether or not a car is economical based on
# the car's displacement, power, weight, and acceleration, and the year it was made
cars = h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/junit/cars_20mpg.csv")

# convert response column to a factor
cars["economy_20mpg"] = cars["economy_20mpg"].asfactor()

# set the predictor names and the response column name
predictors = ["displacement","power","weight","acceleration","year"]
response = "economy_20mpg"

# split into train and validation sets
train, valid = cars.split_frame(ratios = [.8], seed = 1234)

# try turning on the `build_tree_one_node` parameter:
# initialize your estimator
cars_gbm = H2OGradientBoostingEstimator(build_tree_one_node = True, seed = 1234)

# then train your model
cars_gbm.train(x = predictors, y = response, training_frame = train, validation_frame = valid)

# print the auc for the validation data
cars_gbm.auc(valid=True)```
...