<jupyter_start><jupyter_text>Azure Analysis Example This is a demo notebook showing how to use **azure** pipeline on a signal using the `orion.analysis.analyze` function. For more information about the usage of microsoft's anomaly detection API, view their documentation [here](https://docs.microsoft.com/en-us/azure/cognitive-services/anomaly-detector/).  1. Load the dataIn the first step, we load the signal that we want to process.To do so, we need to import the `orion.data.load_signal` function and call it passingeither the path to the CSV file or the name of the signal to fetch fromm the `s3 bucket`.In this case, we will be loading the `S-1`.<jupyter_code>from orion.data import load_signal

signal_path = 'S-1'

data = load_signal(signal_path)
data.head()<jupyter_output><empty_output><jupyter_text>2. Setup the pipelineTo use `azure` pipeline, we first need two important information: `subscription_key` and `endpoint`. In order to obtain them, you must setup an Anomaly Detection resource on Azure portal, follow the steps mentioned [here](https://docs.microsoft.com/en-us/azure/cognitive-services/anomaly-detector/quickstarts/client-libraries?pivots=programming-language-python&tabs=linux) to setup your resource instance.Once that's accomplished, update the hyperparameter dictionary specified to the values of your instance.<jupyter_code># your subscription key and endpoint

subscription_key = None
endpoint = None
hyperparameters = {
    "mlprimitives.custom.timeseries_preprocessing.time_segments_aggregate#1": {
        "interval": 21600,
    },
    "orion.primitives.azure_anomaly_detector.split_sequence#1": {
        "sequence_size": 6000,
        "overlap_size": 2640
    },
    "orion.primitives.azure_anomaly_detector.detect_anomalies#1": {
        "subscription_key": subscription_key,
        "endpoint": endpoint,
        "overlap_size": 2640,
        "interval": 21600,
        "granularity": "hourly",
        "custom_interval": 6
    }
}<jupyter_output><empty_output><jupyter_text>The `split_sequence` primitive takes the signal and splits it into multiple signals based on the `sequence_size` and `overlap_size`. Since the method uses a rolling window sequence approach, we use the `overlap_size` to maintain historical information when splitting the sequence.It is custom to set the `overlap_size` as the same value in both `split_sequence` and `detect_anomalies` primitives. In addition, we require the frequency of the signal to be recorded in timestamp interval, as well as convention based where `granularity` refers to the aggregation unit (e.g. hourly, minutely, etc) and `custom_interval` refers to the quantity (in this case, 6 hours).  3. Detect anomalies using azure pipelineOnce we have the data and setup, we use the azure pipeline to analyze it and search for anomalies.In order to do so, we will have import the `orion.analysis.analyze` function and pass itthe loaded data and the path to the pipeline JSON that we want to use.In this case, we will be using the `azure.json` pipeline from inside the `orion` folder.The output will be a ``pandas.DataFrame`` containing a table with the detected anomalies.<jupyter_code>from orion.analysis import analyze

pipeline_path = 'azure'

if subscription_key and endpoint:
    anomalies = analyze(pipeline_path, data, hyperparams=hyperparameters)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07758620689655173, 'fraction_numerical': 0.009809750297265161, 'mean_word_length': 4.976909413854352, 'pattern_counts': {'":': 12, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '301207', 'license': 'MIT', 'n_tokens_mistral': 973, 'n_tokens_neox': 922, 'n_words': 371, 'path': 'tutorials/pipelines/azure.ipynb', 'repo_name': 'ricklentz/Orion', 'size': '3364'}