trees with one leaf set missing to left to avoid unnecessary is_nan check (#435)

This commit is contained in:
Supun Nakandala 2021-01-29 14:05:39 -08:00 коммит произвёл GitHub
Родитель 95f01ea83d
Коммит c04a3a2efe
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -210,7 +210,7 @@ def get_parameters_for_tree_trav_common(lefts, rights, features, thresholds, val
features = [0, 0, 0]
thresholds = [0, 0, 0]
if missings is not None:
missings = [2, -1, -1]
missings = [1, -1, -1]
n_classes = values.shape[1] if type(values) is np.ndarray else 1
values = np.array([np.zeros(n_classes), values[0], values[0]])
values.reshape(3, n_classes)
@ -328,13 +328,13 @@ def get_parameters_for_gemm_common(lefts, rights, features, thresholds, values,
features = [0, 0, 0]
thresholds = [0, 0, 0]
if missings is not None:
missings = [2, -1, -1]
missings = [1, -1, -1]
n_classes = values.shape[1]
values = np.array([np.zeros(n_classes), values[0], values[0]])
values.reshape(3, n_classes)
if missings is None:
missings = rights
missings = lefts
# First hidden layer has all inequalities.
hidden_weights = []