DECISION_TREE


Applies to: CELONIS 4.3 CELONIS 4.4

Description

Create a decision tree, learn classification rules based on training data, and use it to classify new data rows.
Like other machine learning functions (such as linear regression or k means), the Decision Tree consists of two steps.
The first step consists of training the decision tree model. This will learn the classification rules of the decision tree (see https://en.wikipedia.org/wiki/Decision_tree) based on the provided training data. In this step, the user can specify which columns the model should use, and on which subset of the data the system should be trained on. Additionally, an extra max_depth parameter can be provided in order to avoid overfitting to the training data.
In a second step, once the model is trained, the user can use it to classify new rows based on the model input columns.

Создайте дерево решений, изучите правила классификации на основе данных обучения и используйте его для классификации новых строк данных.
Как и другие функции машинного обучения (такие как линейная регрессия или k означает), дерево решений состоит из двух этапов.
Первый шаг состоит из обучения модели дерева решений. Это изучит правила классификации дерева решений (см. Https://en.wikipedia.org/wiki/Decision_tree) на основе предоставленных обучающих данных. На этом этапе пользователь может указать, какие столбцы должна использовать модель, и на каком подмножестве данных должна быть обучена система. Кроме того, может быть предоставлен дополнительный параметр max_depth, чтобы избежать наложения на тренировочные данные.
На втором этапе, когда модель обучена, пользователь может использовать ее для классификации новых строк на основе входных столбцов модели.

Syntax


DECISION_TREE ( TRAIN_[FILTERED_]DT ( [ EXCLUDED ( table.exclude_column, ... ), ] INPUT ( table.input_column, ... ), OUTPUT ( table.output_column ) [, max_depth ], PREDICT ( table.predict_column, ... ) )

  • TRAIN_DT: Constructs the decision tree. Authorization objects are still respected.
* Создает дерево решений. Объекты авторизации все еще соблюдаются.
  • TRAIN_FILTERED_DT: Constructs the decision tree, filtering the training data with current filters.
Создает дерево решений, фильтруя данные обучения с текущими фильтрами.
  • EXCLUDED: These are dimension columns (columns that are not aggregations) that should be used as grouping columns for the INPUT columns of the model training. These columns will be ignored by the training algorithm and won't be part of the trained model.
Это столбцы измерения (столбцы, которые не являются агрегатами), которые следует использовать в качестве столбцов группировки для столбцов INPUT модели обучения. Эти столбцы будут игнорироваться алгоритмом обучения и не будут являться частью обученной модели.
  • INPUT: One or more columns, which is used to train the model.
Один или несколько столбцов, которые используются для обучения модели.
  • OUTPUT: One column containing the labels associated to each row that the model should train upon.
Один столбец, содержащий метки, связанные с каждой строкой, на которой должна тренироваться модель.
  • max_depth: Default=3. This specifies the maximal depth allowed for the learned tree, this can be used to prevent overfitting. If max_depth=0, no limit will be set on the depth of the tree.
По умолчанию = 3. Это определяет максимальную глубину, разрешенную для изученного дерева, это может быть использовано для предотвращения переоснащения. Если max_depth = 0, для глубины дерева не будет установлено никаких ограничений.
  • PREDICT: One or more columns, should be semantically the same as the ones provided as the model INPUT parameter, contains the class assignments based on the trained decision tree rules.
Один или несколько столбцов, которые должны быть семантически такими же, как те, которые указаны в параметре INPUT модели, содержат назначения классов на основе обученных правил дерева решений.
All columns in TRAIN_DT have to be joinable. The columns in PREDICT do not have to be joinable with the columns in TRAIN_DT.
The input of the model training is regarded as an independent sub query. This means if an aggregation is used, it is independent of the dimensions defined in the rest of the query. This also means that the columns within TRAIN_DT have to be joinable, but not with the columns used in the rest of the query.

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

Filter behavior

Standard Decision Tree

If rows of a column are filtered, it does not affect the decision tree, as long as the decision tree model is not trained on aggregation results. This means independent of filters and selections, the underlying model stays the same. If you want to restrict the input data of a model you can use a CASE WHEN statement and map the values you want to be ignored to null. If a model is trained on results of an aggregation it still changes with the filtering because the result of the aggregation is affected by the filtering.
Если строки столбца фильтруются, это не влияет на дерево решений, если модель дерева решений не обучена результатам агрегации. Это означает, что независимо от фильтров и выборок базовая модель остается неизменной. Если вы хотите ограничить входные данные модели, вы можете использовать оператор CASE WHEN и сопоставить значения, которые вы хотите игнорировать, с нулем. Если модель обучается на результатах агрегации, она все еще изменяется с фильтрацией, потому что фильтрация влияет на результат агрегации.

Filtered Decision Tree

If a filter or selection changes, the model is retrained and the resulting function adopts to the new of view of data. This has a serious performance impact.
Если фильтр или выбор изменяется, модель переобучается, и результирующая функция адаптируется к новому представлению данных. Это оказывает серьезное влияние на производительность.

Result

The Decision Tree splitting rules are constructed to reduce the entropy within subsets of the data created at each splitting point.
Правила разбиения дерева решений построены так, чтобы уменьшить энтропию в подмножествах данных, создаваемых в каждой точке разделения.

User Interface

Here is the configuration panel for the decision tree component. The Target Column field corresponds to the OUTPUT and the Features to the INPUT query elements previously described.
Вот панель конфигурации для компонента дерева решений. Поле Target Column соответствует OUTPUT, а Feature - элементам запроса INPUT, описанным ранее.
Decision Tree user interface
Пользовательский интерфейс дерева решений
This is the tree displayed by the decision tree component configured with the above configuration screen
Это дерево, отображаемое компонентом дерева решений, настроенным с помощью приведенного выше экрана конфигурации
Decision Tree example
Пример дерева решений
This visualization helps understand the model that was built from the classification problem and thus give new insights to the data being analysed. Each of the rows (defined by the provided dimensions, or Case if no dimension is provided) will flow through this decision tree when being classified, following the green or red path at each rule of the tree depending on whether it satisfied (green) or does not satisfy (red) the decision rule displayed in the box.
The leafs of the tree indicate the class being assigned to the row reaching it. The numbers in parenthesis are statistics about the performance of the decision tree on the training data, the denominator indicates the total of rows that have reached the node, and the numerator indicates how many of the rows that have reached this node were classified properly.
As we can see in this example, every row is classified as being of the class 0 which can be explained when looking at the number in parenthesis, indicating that this is done because of a sur-representation of the class 0 in the training data, leading to best performance when assigning the 0 label to each row.

Эта визуализация помогает понять модель, построенную на основе проблемы классификации, и, таким образом, дает новое понимание анализируемых данных. Каждая из строк (определяемых предоставленными измерениями или регистром, если измерение не указано) будет проходить через это дерево решений при классификации, следуя зеленому или красному пути в каждом правиле дерева в зависимости от того, удовлетворено ли оно (зеленое) или не удовлетворяет (красный) правилу решения, отображаемому в поле.
Листья дерева указывают на класс, который присваивается ряду, достигшему его. Числа в скобках представляют собой статистические данные о производительности дерева решений для обучающих данных, знаменатель указывает общее количество строк, которые достигли узла, а числитель указывает, сколько строк, которые достигли этого узла, были классифицированы надлежащим образом.
Как мы видим в этом примере, каждая строка классифицируется как принадлежащая к классу 0, что можно объяснить, посмотрев на число в скобках, указывая, что это сделано из-за избыточного представления класса 0 в обучающих данных, приводя к лучшей производительности при назначении метки 0 для каждой строки.

Example


Содержание

  1. Data Types
  2. DATE
  3. FLOAT
  4. INT
  5. STRING
  6. Functions
  7. Aggregation Functions
  8. GLOBAL
  9. Pull Up Aggregation Functions
  10. PU_AVG
  11. PU_COUNT
  12. PU_COUNT_DISTINCT
  13. PU_FIRST
  14. PU_LAST
  15. PU_MAX
  16. PU_MEDIAN
  17. PU_MIN
  18. PU_QUANTILE
  19. PU_SUM
  20. Standard Aggregation Functions
  21. AVG
  22. COUNT
  23. COUNT_TABLE
  24. COUNT DISTINCT
  25. MAX
  26. MEDIAN
  27. MIN
  28. QUANTILE
  29. STDEV
  30. SUM
  31. TRIMMED_MEAN
  32. VAR
  33. Moving Aggregation Functions
  34. MOVING_AVG
  35. MOVING_COUNT
  36. MOVING_COUNT_DISTINCT
  37. MOVING_MAX
  38. MOVING_MEDIAN
  39. MOVING_MIN
  40. MOVING_STDEV
  41. MOVING_SUM
  42. MOVING_TRIMMED_MEAN
  43. RUNNING_TOTAL
  44. HOUR_NOW
  45. TODAY
  46. DATE_BETWEEN
  47. DAYS_BETWEEN
  48. HOURS_BETWEEN
  49. MILLIS_BETWEEN
  50. MINUTES_BETWEEN
  51. MONTHS_BETWEEN
  52. SECONDS_BETWEEN
  53. WORKDAYS_BETWEEN
  54. YEARS_BETWEEN
  55. ADD_DAYS
  56. ADD_HOURS
  57. ADD_MILLIS
  58. ADD_MINUTES
  59. ADD_MONTHS
  60. ADD_SECONDS
  61. ADD_WORKDAYS
  62. ADD_YEARS
  63. CALENDAR_WEEK
  64. DATE_MATCH
  65. DAY
  66. DAY_OF_WEEK
  67. HOURS
  68. MILLIS
  69. MINUTES
  70. MONTH
  71. QUARTER
  72. REMAP_TIMESTAMP
  73. SECONDS
  74. TO_TIMESTAMP
  75. YEAR
  76. DateTime Rounding Functions
  77. ROUND_DAY
  78. ROUND_HOUR
  79. ROUND_MINUTE
  80. ROUND_MONTH
  81. ROUND_QUARTER
  82. ROUND_SECOND
  83. ROUND_WEEK
  84. ROUND_YEAR
  85. DECISION_TREE
  86. KMEANS
  87. LINEAR_REGRESSION
  88. Math Functions
  89. ABC
  90. ABS
  91. CEIL
  92. FLOOR
  93. LOG
  94. POWER
  95. ROUND
  96. SQRT
  97. SQUARE
  98. ISNULL
  99. Process Functions
  100. ACTIVATION_COUNT
  101. CALC_CROP
  102. CALC_CROP_TO_NULL
  103. CALC_REWORK
  104. CALC_THROUGHPUT
  105. MATCH_PROCESS
  106. PROCESS_ORDER
  107. PROCESS EQUALS
  108. SOURCE / TARGET
  109. VARIANT
  110. Statistic Functions
  111. QNORM
  112. ZSCORE
  113. CONCAT
  114. LEFT
  115. LEN
  116. LOWER
  117. LTRIM
  118. REVERSE
  119. RIGHT
  120. RTRIM
  121. STR_TO_INT
  122. SUBSTRING
  123. UPPER
  124. Operators
  125. CASE WHEN
  126. FILTER
  127. Math Operators
  128. Addition Operator
  129. Division Operator
  130. MODULO
  131. Multiplication Operator
  132. Subtraction Operator
  133. Predicate Operators
  134. IN
  135. LIKE
  136. Ссылки на мануалы