Check is working and returned WARNING, Message: Cannot check: ARRAY is not numeric

Registered Posts: 6

Hello Dataiku community,

I've created a custom metric which returns len(example_variable) and I am using this metric as the value I want to check, however I am getting the below warning.

Message: Cannot check: ARRAY is not numeric

I am not sure why I'm getting this message as the metric is an INT.

What am I doing wrong?

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,321 Neuron
    edited July 2024 Answer ✓

    Try with this metric probe, it should be added on the dataset you want it to run:

    def process(dataset):
        df = dataset.get_dataframe()
        empty_columns = []
        for col in df:
            if len(df[col].value_counts()) == 0:
                empty_columns.append(col)            
        return {'metric_name' : len(empty_columns)}

Answers

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,321 Neuron

    Please post the code of your Python probe.

  • Registered Posts: 6
    edited July 2024

    # Define here a function that returns the metric.
    import dataiku
    
    def process():
        example_dataset = dataiku.Dataset("example_dataset")
        df = example_dataset.get_dataframe()
        empty_columns = []
        for col in df:
            if len(df[col].value_counts()) == 0:
                empty_columns.append(col)
        return len(empty_columns)

  • Registered Posts: 6

    Unfortunately, did not work. I am still getting the same error on the check side.

  • Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Registered, Neuron 2023 Posts: 54 Neuron

    I was able to get the check working with @Turribeach
    's probe. I can recreate your error by returning the list instead of the len(list).

    Can you double check that you have the right metric selected in the check? Since the fix returns a dict it might have created a new metric.

  • Registered Posts: 6

    Oh, yes you're right, it works now, thank you!

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,321 Neuron

    Final tip: don’t forget to add your scenario step to calculate metrics and checks or alternatively you can set them to compute at build time.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.