OmniSciDB
a5dc49c757
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DecisionTreeEntry.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 HEAVY.AI, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
struct
DecisionTreeEntry
{
20
double
value
;
21
int64_t
feature_index
;
22
int64_t
left_child_row_idx
;
23
int64_t
right_child_row_idx
;
24
25
// Constructor for a split node. Note that right_child_row_idx won't
26
// be known until later in the depth-first traversal that constructs
27
// the table of DecisionTreeEntrys, at which point that value will
28
// be populated
29
DecisionTreeEntry
(
const
double
value
,
30
const
int64_t
feature_index
,
31
const
int64_t
left_child_row_idx
)
32
: value(value)
33
, feature_index(feature_index)
34
, left_child_row_idx(left_child_row_idx) {}
35
36
// Constructor for a terminal/non-split node
37
DecisionTreeEntry
(
const
double
value
) : value(value),
feature_index
(-1) {}
38
39
inline
bool
isSplitNode
()
const
{
return
feature_index
>= 0; }
40
};
DecisionTreeEntry::value
double value
Definition:
DecisionTreeEntry.h:20
DecisionTreeEntry::left_child_row_idx
int64_t left_child_row_idx
Definition:
DecisionTreeEntry.h:22
DecisionTreeEntry::feature_index
int64_t feature_index
Definition:
DecisionTreeEntry.h:21
DecisionTreeEntry
Definition:
DecisionTreeEntry.h:19
DecisionTreeEntry::DecisionTreeEntry
DecisionTreeEntry(const double value)
Definition:
DecisionTreeEntry.h:37
DecisionTreeEntry::DecisionTreeEntry
DecisionTreeEntry(const double value, const int64_t feature_index, const int64_t left_child_row_idx)
Definition:
DecisionTreeEntry.h:29
DecisionTreeEntry::isSplitNode
bool isSplitNode() const
Definition:
DecisionTreeEntry.h:39
DecisionTreeEntry::right_child_row_idx
int64_t right_child_row_idx
Definition:
DecisionTreeEntry.h:23
QueryEngine
DecisionTreeEntry.h
Generated on Tue Aug 27 2024 00:12:40 for OmniSciDB by
1.8.5