def _get_shape_for_attribute(attribute_data, labels, class_weights, feature_name, criterion, splitter,
max_depth, min_samples_split, min_samples_leaf, min_weight_fraction_leaf,
max_features, random_state, max_leaf_nodes, presort):
dtr = DecisionTreeRegressor(criterion=criterion,
splitter=splitter,
max_depth=max_depth,
min_samples_split=min_samples_split,
min_samples_leaf=min_samples_leaf,
min_weight_fraction_leaf=min_weight_fraction_leaf,
max_features=max_features,
random_state=random_state,
max_leaf_nodes=max_leaf_nodes,
presort=presort)
dtr.fit(attribute_data.reshape(-1, 1), labels)
return feature_name, _get_sum_of_gamma_correction(dtr.tree_, attribute_data, labels, class_weights, feature_name)
评论列表
文章目录