org.wso2.extension.siddhi.execution.streamingml.util

## Class CoreUtils

- java.lang.Object
- - org.wso2.extension.siddhi.execution.streamingml.util.CoreUtils

-     public class CoreUtils
      extends Object

  Common utils for Streaming Machine Learning tasks.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CoreUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static io.siddhi.core.executor.VariableExpressionExecutor` | `extractAndValidateClassLabel(io.siddhi.query.api.definition.AbstractDefinition inputDefinition, io.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors, int classIndex)` Validate and extract Class label executor
    `static List<io.siddhi.core.executor.VariableExpressionExecutor>` | `extractAndValidateFeatures(io.siddhi.query.api.definition.AbstractDefinition inputDefinition, io.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors, int startIndex, int noOfFeatures)` Validate and extract feature attribute executors
    `static boolean` | `isLabelType(io.siddhi.query.api.definition.Attribute.Type attributeType)` Check label attribute to be a valid type
    `static boolean` | `isNumeric(io.siddhi.query.api.definition.Attribute.Type attributeType)` Check feature attribute to be a numeric

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CoreUtils

          public CoreUtils()

  - ### Method Detail

    - #### extractAndValidateFeatures

          public static List<io.siddhi.core.executor.VariableExpressionExecutor> extractAndValidateFeatures(io.siddhi.query.api.definition.AbstractDefinition inputDefinition,
                                                                                                            io.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors,
                                                                                                            int startIndex,
                                                                                                            int noOfFeatures)

      Validate and extract feature attribute executors
      Parameters:
        `inputDefinition` - the incoming stream definition
        `attributeExpressionExecutors` - the executors of each function parameters
        `startIndex` - starting index of the feature attributes
        `noOfFeatures` - number of feature attributes
      Returns:
        list of VariableExpressionExecutors

    - #### isNumeric

          public static boolean isNumeric(io.siddhi.query.api.definition.Attribute.Type attributeType)

      Check feature attribute to be a numeric
      Parameters:
        `attributeType` - feature attribute type
      Returns:
        true/false

    - #### isLabelType

          public static boolean isLabelType(io.siddhi.query.api.definition.Attribute.Type attributeType)

      Check label attribute to be a valid type
      Parameters:
        `attributeType` - label feature attribute type
      Returns:
        true/false

    - #### extractAndValidateClassLabel

          public static io.siddhi.core.executor.VariableExpressionExecutor extractAndValidateClassLabel(io.siddhi.query.api.definition.AbstractDefinition inputDefinition,
                                                                                                        io.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors,
                                                                                                        int classIndex)

      Validate and extract Class label executor
      Parameters:
        `inputDefinition` - the incoming stream definition
        `attributeExpressionExecutors` - the executors of each function parameters
        `classIndex` - index of the class label attribute
      Returns:
        class label VariableExpressionExecutor

Copyright © 2019 WSO2. All rights reserved.