示例#1
0
    def build_ui(cls):

        # define arguments that behave as function inputs
        inputs = []
        inputs.append(UISingleItem(
                name='input_item1',
                datatype=str,
                description='String encoded array of sensor readings'
                ))

        inputs.append(UISingleItem(
                name='input_item2',
                datatype=str,
                description='String encoded array of sensor readings'
                ))

        inputs.append(UISingleItem(
                name='input_item3',
                datatype=str,
                description='String encoded array of sensor readings'
                ))

        # define arguments that behave as function outputs
        outputs = []
        outputs.append(UIFunctionOutSingle(
                name='output_item',
                datatype=float,
                description='L2 norm of the string encoded sensor readings'
                ))
        return (inputs, outputs)
示例#2
0
    def build_ui(cls):
        #define arguments that behave as function inputs
        inputs = []
        inputs.append(
            UIMultiItem(name='feature', datatype=float, required=True))
        inputs.append(
            UISingleItem(name='target', datatype=float, required=True))
        #define arguments that behave as function outputs
        outputs = []
        outputs.append(
            UISingleItem(name='difference', datatype=float, required=True))

        return (inputs, outputs)
示例#3
0
    def build_ui(cls):
        inputs = []
        inputs.append(
            UISingleItem(name='input_item',
                         datatype=float,
                         description='Item to base anomaly on'))

        inputs.append(
            UISingle(
                name='factor',
                datatype=int,
                description=
                'Frequency of anomaly e.g. A value of 3 will create anomaly every 3 datapoints',
                default=10))

        inputs.append(
            UISingle(name='width',
                     datatype=int,
                     description='Width of the anomaly created',
                     default=5))

        outputs = []
        outputs.append(
            UIFunctionOutSingle(
                name='output_item',
                datatype=float,
                description='Generated Item With Flatline anomalies'))
        return (inputs, outputs)
示例#4
0
    def build_ui(cls):
        inputs = []
        inputs.append(
            UISingleItem(name='input_item',
                         datatype=float,
                         description='Item to base anomaly on'))

        inputs.append(
            UISingle(
                name='factor',
                datatype=int,
                description=
                'Frequency of anomaly e.g. A value of 3 will create anomaly every 3 datapoints',
                default=5))

        inputs.append(
            UISingle(
                name='size',
                datatype=int,
                description=
                'Size of extreme anomalies to be created. e.g. 10 will create 10x size extreme \
                             anomaly compared to the normal variance',
                default=10))

        outputs = []
        outputs.append(
            UIFunctionOutSingle(
                name='output_item',
                datatype=float,
                description='Generated Item With Extreme anomalies'))
        return (inputs, outputs)
示例#5
0
    def build_ui(cls):
        # define arguments that behave as function inputs
        inputs = []
        inputs.append(UISingleItem(name='dimension_name', datatype=str))
        inputs.append(
            UISingle(name='dimension_value',
                     datatype=str,
                     description='Dimension Filter Value'))
        inputs.append(
            UIExpression(
                name='expression',
                description="Define alert expression using pandas systax. \
                                                Example: df['inlet_temperature']>50. ${pressure} will be substituted \
                                                with df['pressure'] before evaluation, ${} with df[<dimension_name>]"
            ))
        inputs.append(
            UISingle(name='pulse_trigger',
                     description=
                     "If true only generate alerts on crossing the threshold",
                     datatype=bool))

        # define arguments that behave as function outputs
        outputs = []
        outputs.append(
            UIFunctionOutSingle(name='alert_name',
                                datatype=bool,
                                description='Output of alert function'))
        outputs.append(
            UIFunctionOutSingle(name='alert_end',
                                datatype=dt.datetime,
                                description='End of pulse triggered alert'))
        return (inputs, outputs)
示例#6
0
    def build_ui(cls):

        # define arguments that behave as function inputs
        inputs = []
        inputs.append(UISingleItem(
                name='input_item',
                datatype=str,
                description='String encoded array of sensor readings'
                ))
        # define arguments that behave as function outputs
        outputs = []
        return (inputs, outputs)
示例#7
0
    def build_ui(cls):
        # define arguments that behave as function inputs
        inputs = []
        inputs.append(UISingleItem(name='dimension_name', datatype=str))
        inputs.append(UISingle(name='dimension_value', datatype=str,
                               description='Dimension Filter Value'))
        inputs.append(UIExpression(name='expression',
                                   description="Define alert expression using pandas systax. \
                                                Example: df['inlet_temperature']>50. ${pressure} will be substituted \
                                                with df['pressure'] before evaluation, ${} with df[<dimension_name>]"))

        # define arguments that behave as function outputs
        outputs = []
        outputs.append(UIFunctionOutSingle(name='alert_name', datatype=bool, description='Output of alert function'))
        return (inputs, outputs)
示例#8
0
    def build_ui(cls):
        inputs = [
            UISingleItem(
                name='source',
                datatype=None,
                description='Choose data item to run data quality checks on'),
            UIMulti(name='checks_with_string_output',
                    datatype=str,
                    description='Select quality checks '
                    'to run. These checks return string output ',
                    values=cls.STR_QUALITY_CHECKS,
                    required=False),
            UIMulti(name='checks_with_numerical_output',
                    datatype=str,
                    description='Select quality '
                    'checks to run. These checks return numerical output ',
                    values=cls.NUMERICAL_QUALITY_CHECKS,
                    required=False),
            UIMulti(name='checks_with_boolean_output',
                    datatype=str,
                    description='Select quality checks '
                    'to run. These checks return boolean output',
                    values=cls.BOOLEAN_QUALITY_CHECKS,
                    required=False)
        ]
        outputs = [
            UIFunctionOutMulti(
                'name',
                cardinality_from='checks_with_string_output',
                datatype=str,
                description='quality check returns string output'),
            UIFunctionOutMulti(
                'name',
                cardinality_from='checks_with_numerical_output',
                datatype=float,
                description='quality check returns numerical output'),
            UIFunctionOutMulti(
                'name',
                cardinality_from='checks_with_boolean_output',
                datatype=bool,
                description='quality check returns boolean output')
        ]

        return inputs, outputs