Analysis Classes - a Unified Interface to Analysis Results

MVG comes with a set of analysis classes which provide a unified interface to analysis results irrespective of the specific feature. Note that the analysis classes are helper classes, as such the mvg class does not depend on them.

Except for step (1) requesting the specific feature analysis, the following generic workflow holds: - (1) Request a specific analysis - (2) Retrieve results and parse them into an analysis_class object - (3) Use generic methods like plot(), summary() or to_df()

One application is to use the analysis classes interactively from a Python REPL session.

Or in (pseudo) code

result = parse_results(session.get_analysis_results(request_id))  # call API to get results
result.plot() # plot results
result.summary() # print summary table
df = result.to_df() # convert to DataFrame
result.save_pkl() # save to pickle file

Prerequisites

For running the examples in this notebook: * Installed mvg package * A token for API access from Viking Analytics * The database needs to be populated with our example assets. This can be achieved by running the “Sources and Measurement” example.

Example flow

Importing the required packages, classes and functions

[1]:
import os
import json
from requests import HTTPError

# import mvg library with python bindings to mvg-API
from mvg import MVG, analysis_classes
# import analysis classes
from mvg.analysis_classes import parse_results

Create a Session and test API access

Note that the TOKEN is used both for authorization and authentication. Thus, each unique token represents a unique user and each user has their own unique database on the Viking Analytics MultiViz Vibration service.

You need to insert your token received from Viking Analytics here:

[2]:
# Replace by your own Token
TOKEN = os.environ["TEST_TOKEN"] # use our own token
ENDPOINT = "https://api.beta.multiviz.com"
session = MVG(ENDPOINT, TOKEN)
print(json.dumps(session.check_version(), indent=4)) # Check if API is accessible
{
    "api_version": "0.2.0",
    "mvg_highest_tested_version": "0.2.0",
    "mvg_version": "0.9.0"
}

Running the Analyses

Once the API session is live, we start by checking if the source u0001 we will use is available in the database:

[3]:
SOURCE_ID = "u0001"
s_info = session.get_source(SOURCE_ID)
print(json.dumps(s_info, sort_keys=False, indent=4))
{
    "source_id": "u0001",
    "meta": {
        "assetId": "assetA",
        "measPoint": "mloc01",
        "location": "paris",
        "updated": "YES! I have been updated"
    },
    "properties": {
        "data_class": "waveform",
        "channels": [
            "acc"
        ]
    }
}

Requsting the Analysis

We will now request an analysis (first two lines, uncomment one of them) and wait for the results to become available.

The results as returned will be stored in a dictionary named raw_result. The raw results are shown in the results cell, mainly to show that they are not optimized for readability or interpretation.

[4]:
# Specifc part : Select one of two anlysis here by un/commenting
selected_feature = "RMS"
# selected_feature = "ModeId"

# Generic Part: request analysis and wait for results
analysis_request = session.request_analysis(SOURCE_ID, selected_feature)
print(f"Waiting for {analysis_request}")
session.wait_for_analyses([analysis_request["request_id"]])

# Generic Part: Displaying unparsed results
raw_result = session.get_analysis_results(analysis_request["request_id"])
print(json.dumps(raw_result, sort_keys=False, indent=4)) # Pretty but pretty long
Waiting for {'request_id': '99c500893a6184b4f3dcd4a7a3b1565b', 'request_status': 'queued'}
{
    "status": "successful",
    "request_id": "99c500893a6184b4f3dcd4a7a3b1565b",
    "feature": "RMS",
    "results": {
        "acc": {
            "rms": [
                0.6471233090087871,
                0.6466190328578604,
                0.6468729279266724,
                0.646642518814507,
                0.646717205894838,
                0.6470927806487413,
                0.6474220671843843,
                0.6468903895762858,
                0.6476938342498252,
                0.6470808565115466,
                0.6472050737356406,
                0.6467427853732756,
                0.6473221821058875,
                0.6474336931665048,
                0.6476212217700588,
                0.6471112840086102,
                0.4848921153840481,
                0.48484094333329586,
                0.4847516723441296,
                0.4845635972925438,
                0.4850011098332846,
                0.48501271794981815,
                0.48525436544651607,
                0.4851567285533576,
                0.6278945984238412,
                0.6281390462008642,
                0.6283081249535385,
                0.6280197922186243,
                0.6280192424935491,
                0.6282832071296321,
                0.6281522276066059,
                0.627965516388511,
                0.6277353544965071,
                0.6278700835347193,
                0.6286806371261001,
                0.6281269536708333,
                0.6281217503270786,
                0.6277798778644176,
                0.6278461900382379,
                0.6285363191287605,
                0.6283971912344217,
                0.6283066377247811,
                0.628142404218728,
                0.6285404729543963,
                0.628117681739836,
                0.6284285531715674,
                0.628440782618211,
                0.6286006002142941,
                0.6279629684369982
            ],
            "rms_dc": [
                0.6621829958188445,
                0.6616518915968526,
                0.6619229399260815,
                0.6617138187667061,
                0.6617088713545417,
                0.6621712182715772,
                0.6624628340232414,
                0.661977447702136,
                0.6627544903873464,
                0.6620207993082551,
                0.662241081744421,
                0.661799506359354,
                0.6623544164712631,
                0.6624120892580125,
                0.6626660580828794,
                0.6620974380917977,
                0.498214159978348,
                0.49823204245121355,
                0.4981883248148897,
                0.49798748569938905,
                0.4983621583589863,
                0.4983645131550537,
                0.49866331698402155,
                0.49849425732991726,
                0.6374436148716767,
                0.6377106362522227,
                0.6377963245451337,
                0.6375594045830764,
                0.6374337096669657,
                0.6378045217930529,
                0.6376521190146351,
                0.637442235802496,
                0.6373332350391726,
                0.6373635157843435,
                0.6381945643264252,
                0.6376292497131597,
                0.6376899092541004,
                0.6372860080258722,
                0.6373424476924897,
                0.6380636089021572,
                0.637839000655549,
                0.6377363375921016,
                0.6376999348751861,
                0.6381092936591727,
                0.6376180440233918,
                0.6378754730392424,
                0.6378695336896755,
                0.6379947683984636,
                0.6373637582315667
            ],
            "dc": [
                -0.14041988067626954,
                -0.14023926696777345,
                -0.14034740295410156,
                -0.14042304229736327,
                -0.1400552963256836,
                -0.1405050018310547,
                -0.1403626495361328,
                -0.14052389526367187,
                -0.14048562774658202,
                -0.13984957580566407,
                -0.14031693725585936,
                -0.14036508178710938,
                -0.1403116729736328,
                -0.14006922912597655,
                -0.1404031967163086,
                -0.14007142333984374,
                -0.11444206237792968,
                -0.11473634033203126,
                -0.11492355346679688,
                -0.11484622802734375,
                -0.11462444915771484,
                -0.11458556365966797,
                -0.1148621109008789,
                -0.11454026947021484,
                -0.10992149658203125,
                -0.11007358551025391,
                -0.10960406799316406,
                -0.10987781829833984,
                -0.10914927978515625,
                -0.10979444274902343,
                -0.10965857849121094,
                -0.10950759887695312,
                -0.11019064025878907,
                -0.10959657592773438,
                -0.10978596649169922,
                -0.10967037048339844,
                -0.11005220184326171,
                -0.10966257781982422,
                -0.1096109359741211,
                -0.10985110168457031,
                -0.10934148712158204,
                -0.10926300964355469,
                -0.10999239501953124,
                -0.11009243621826172,
                -0.1096583236694336,
                -0.10937400360107422,
                -0.10926904754638672,
                -0.10908074951171876,
                -0.10906452484130859
            ],
            "utilization": [
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1
            ]
        },
        "timestamps": [
            1570273260,
            1570359660,
            1570446060,
            1570532460,
            1570618860,
            1570705260,
            1570791660,
            1570878060,
            1570964460,
            1571050860,
            1571137260,
            1571223660,
            1571310060,
            1571396460,
            1571482860,
            1571569260,
            1571655660,
            1571742060,
            1571828460,
            1571914860,
            1572001260,
            1572087660,
            1572177660,
            1572264060,
            1572350460,
            1572436860,
            1572523260,
            1572609660,
            1572696060,
            1572782460,
            1572868860,
            1572955260,
            1573041660,
            1573128060,
            1573214460,
            1573300860,
            1573387260,
            1573473660,
            1573560060,
            1573646460,
            1573732860,
            1573819260,
            1573905660,
            1573992060,
            1574078460,
            1574164860,
            1574251260,
            1574337660,
            1574424060
        ]
    },
    "inputs": {
        "request_id": "99c500893a6184b4f3dcd4a7a3b1565b",
        "feature": "RMS",
        "experiment": "RMS",
        "sw-commit": {
            "api": "v0.2.0",
            "feature": "1.0.0"
        },
        "dataType": "waveform",
        "db_def": "/pipeline/dev_client_1/dev_site_1/data/dev_site_1Db/database.json",
        "UUID": "u0001",
        "timestamps": [
            1570273260,
            1570359660,
            1570446060,
            1570532460,
            1570618860,
            1570705260,
            1570791660,
            1570878060,
            1570964460,
            1571050860,
            1571137260,
            1571223660,
            1571310060,
            1571396460,
            1571482860,
            1571569260,
            1571655660,
            1571742060,
            1571828460,
            1571914860,
            1572001260,
            1572087660,
            1572177660,
            1572264060,
            1572350460,
            1572436860,
            1572523260,
            1572609660,
            1572696060,
            1572782460,
            1572868860,
            1572955260,
            1573041660,
            1573128060,
            1573214460,
            1573300860,
            1573387260,
            1573473660,
            1573560060,
            1573646460,
            1573732860,
            1573819260,
            1573905660,
            1573992060,
            1574078460,
            1574164860,
            1574251260,
            1574337660,
            1574424060
        ],
        "params": {
            "utilization_threshold": 0.1
        }
    },
    "error_info": "",
    "debug_info": ""
}

Showing and Browsing the results using analysis_classes

To make the results more accessible, we’ll use the analysis_classes. The parse_results function will take the raw_results of (any) analysis and represent them in a python object with a number of convenience methods for summarising, plotting and exporting. For the full list of provided methods check the documentation.

The parse function will automatically determine the kind (feature) of analysis based on the raw_results. Once the results are parsed, we can summarize them using the summary() method irrespective of which analysis them stem from. To verify this you can rerun the cell above by selecting another feature for the analysis.

Timestamps

The Vibration API requires timestamps to be represented in EPOCH time. To display human interpertable timestamps a timezone and a time unit (specifying if the timestamps are seconds ‘s’ or milliseconds ‘ms’ from EPOCH). This information can be given in the parse_results calls 2nd and 3rd argument). If they are left blank EPOCH times are kept. When exporting the results to a DataFrame, a column called “datetime” will be appended to show the human interpretable times.

[5]:
# Parse
pretty_result = parse_results(raw_result, "Europe/Stockholm", "s")
# pretty_result = parse_results(raw_result) # show only raw timestamps
# Show summary
pretty_result.summary()
=== RMS ===
request_id 99c500893a6184b4f3dcd4a7a3b1565b
from 20191005-13:01.00 to 20191122-13:01.00

+-------+--------------+------------+------------+------------+---------------+
|       |   timestamps |        rms |     rms_dc |         dc |   utilization |
|-------+--------------+------------+------------+------------+---------------|
| count | 49           | 49         | 49         | 49         |            49 |
| mean  |  1.57235e+09 |  0.610969  |  0.622908  | -0.120479  |             1 |
| std   |  1.2361e+06  |  0.0568938 |  0.0566906 |  0.0140601 |             0 |
| min   |  1.57027e+09 |  0.484564  |  0.497987  | -0.140524  |             1 |
| 25%   |  1.57131e+09 |  0.627895  |  0.637364  | -0.140071  |             1 |
| 50%   |  1.57235e+09 |  0.628307  |  0.637796  | -0.110191  |             1 |
| 75%   |  1.57339e+09 |  0.646743  |  0.6618    | -0.109659  |             1 |
| max   |  1.57442e+09 |  0.647694  |  0.662754  | -0.109065  |             1 |
+-------+--------------+------------+------------+------------+---------------+
[5]:
timestamps rms rms_dc dc utilization
count 4.900000e+01 49.000000 49.000000 49.000000 49.0
mean 1.572349e+09 0.610969 0.622908 -0.120479 1.0
std 1.236102e+06 0.056894 0.056691 0.014060 0.0
min 1.570273e+09 0.484564 0.497987 -0.140524 1.0
25% 1.571310e+09 0.627895 0.637364 -0.140071 1.0
50% 1.572350e+09 0.628307 0.637796 -0.110191 1.0
75% 1.573387e+09 0.646743 0.661800 -0.109659 1.0
max 1.574424e+09 0.647694 0.662754 -0.109065 1.0

Plotting

For visual representation of the results there is the ‘plot’ method:

[6]:
pretty_result.plot()
../../_images/content_examples_analysis_classes_12_0.png
[6]:
''

Export results to DataFrame

The to_df() method will export results to a DataFrame. Note that the format of the DataFrame depends on the specific analysis and that not all of the results can be represented as a data frame.

[7]:
pretty_result.to_df()
[7]:
timestamps rms rms_dc dc utilization datetime
0 1570273260 0.647123 0.662183 -0.140420 1 2019-10-05 13:01:00+02:00
1 1570359660 0.646619 0.661652 -0.140239 1 2019-10-06 13:01:00+02:00
2 1570446060 0.646873 0.661923 -0.140347 1 2019-10-07 13:01:00+02:00
3 1570532460 0.646643 0.661714 -0.140423 1 2019-10-08 13:01:00+02:00
4 1570618860 0.646717 0.661709 -0.140055 1 2019-10-09 13:01:00+02:00
5 1570705260 0.647093 0.662171 -0.140505 1 2019-10-10 13:01:00+02:00
6 1570791660 0.647422 0.662463 -0.140363 1 2019-10-11 13:01:00+02:00
7 1570878060 0.646890 0.661977 -0.140524 1 2019-10-12 13:01:00+02:00
8 1570964460 0.647694 0.662754 -0.140486 1 2019-10-13 13:01:00+02:00
9 1571050860 0.647081 0.662021 -0.139850 1 2019-10-14 13:01:00+02:00
10 1571137260 0.647205 0.662241 -0.140317 1 2019-10-15 13:01:00+02:00
11 1571223660 0.646743 0.661800 -0.140365 1 2019-10-16 13:01:00+02:00
12 1571310060 0.647322 0.662354 -0.140312 1 2019-10-17 13:01:00+02:00
13 1571396460 0.647434 0.662412 -0.140069 1 2019-10-18 13:01:00+02:00
14 1571482860 0.647621 0.662666 -0.140403 1 2019-10-19 13:01:00+02:00
15 1571569260 0.647111 0.662097 -0.140071 1 2019-10-20 13:01:00+02:00
16 1571655660 0.484892 0.498214 -0.114442 1 2019-10-21 13:01:00+02:00
17 1571742060 0.484841 0.498232 -0.114736 1 2019-10-22 13:01:00+02:00
18 1571828460 0.484752 0.498188 -0.114924 1 2019-10-23 13:01:00+02:00
19 1571914860 0.484564 0.497987 -0.114846 1 2019-10-24 13:01:00+02:00
20 1572001260 0.485001 0.498362 -0.114624 1 2019-10-25 13:01:00+02:00
21 1572087660 0.485013 0.498365 -0.114586 1 2019-10-26 13:01:00+02:00
22 1572177660 0.485254 0.498663 -0.114862 1 2019-10-27 13:01:00+01:00
23 1572264060 0.485157 0.498494 -0.114540 1 2019-10-28 13:01:00+01:00
24 1572350460 0.627895 0.637444 -0.109921 1 2019-10-29 13:01:00+01:00
25 1572436860 0.628139 0.637711 -0.110074 1 2019-10-30 13:01:00+01:00
26 1572523260 0.628308 0.637796 -0.109604 1 2019-10-31 13:01:00+01:00
27 1572609660 0.628020 0.637559 -0.109878 1 2019-11-01 13:01:00+01:00
28 1572696060 0.628019 0.637434 -0.109149 1 2019-11-02 13:01:00+01:00
29 1572782460 0.628283 0.637805 -0.109794 1 2019-11-03 13:01:00+01:00
30 1572868860 0.628152 0.637652 -0.109659 1 2019-11-04 13:01:00+01:00
31 1572955260 0.627966 0.637442 -0.109508 1 2019-11-05 13:01:00+01:00
32 1573041660 0.627735 0.637333 -0.110191 1 2019-11-06 13:01:00+01:00
33 1573128060 0.627870 0.637364 -0.109597 1 2019-11-07 13:01:00+01:00
34 1573214460 0.628681 0.638195 -0.109786 1 2019-11-08 13:01:00+01:00
35 1573300860 0.628127 0.637629 -0.109670 1 2019-11-09 13:01:00+01:00
36 1573387260 0.628122 0.637690 -0.110052 1 2019-11-10 13:01:00+01:00
37 1573473660 0.627780 0.637286 -0.109663 1 2019-11-11 13:01:00+01:00
38 1573560060 0.627846 0.637342 -0.109611 1 2019-11-12 13:01:00+01:00
39 1573646460 0.628536 0.638064 -0.109851 1 2019-11-13 13:01:00+01:00
40 1573732860 0.628397 0.637839 -0.109341 1 2019-11-14 13:01:00+01:00
41 1573819260 0.628307 0.637736 -0.109263 1 2019-11-15 13:01:00+01:00
42 1573905660 0.628142 0.637700 -0.109992 1 2019-11-16 13:01:00+01:00
43 1573992060 0.628540 0.638109 -0.110092 1 2019-11-17 13:01:00+01:00
44 1574078460 0.628118 0.637618 -0.109658 1 2019-11-18 13:01:00+01:00
45 1574164860 0.628429 0.637875 -0.109374 1 2019-11-19 13:01:00+01:00
46 1574251260 0.628441 0.637870 -0.109269 1 2019-11-20 13:01:00+01:00
47 1574337660 0.628601 0.637995 -0.109081 1 2019-11-21 13:01:00+01:00
48 1574424060 0.627963 0.637364 -0.109065 1 2019-11-22 13:01:00+01:00

Full results

In case the full server results are needed in the form they were returned, we can obtain them with the results() method:

[8]:
print(json.dumps(pretty_result.results(), sort_keys=False, indent=4)) # Pretty but long
{
    "timestamps": [
        1570273260,
        1570359660,
        1570446060,
        1570532460,
        1570618860,
        1570705260,
        1570791660,
        1570878060,
        1570964460,
        1571050860,
        1571137260,
        1571223660,
        1571310060,
        1571396460,
        1571482860,
        1571569260,
        1571655660,
        1571742060,
        1571828460,
        1571914860,
        1572001260,
        1572087660,
        1572177660,
        1572264060,
        1572350460,
        1572436860,
        1572523260,
        1572609660,
        1572696060,
        1572782460,
        1572868860,
        1572955260,
        1573041660,
        1573128060,
        1573214460,
        1573300860,
        1573387260,
        1573473660,
        1573560060,
        1573646460,
        1573732860,
        1573819260,
        1573905660,
        1573992060,
        1574078460,
        1574164860,
        1574251260,
        1574337660,
        1574424060
    ],
    "rms": [
        0.6471233090087871,
        0.6466190328578604,
        0.6468729279266724,
        0.646642518814507,
        0.646717205894838,
        0.6470927806487413,
        0.6474220671843843,
        0.6468903895762858,
        0.6476938342498252,
        0.6470808565115466,
        0.6472050737356406,
        0.6467427853732756,
        0.6473221821058875,
        0.6474336931665048,
        0.6476212217700588,
        0.6471112840086102,
        0.4848921153840481,
        0.48484094333329586,
        0.4847516723441296,
        0.4845635972925438,
        0.4850011098332846,
        0.48501271794981815,
        0.48525436544651607,
        0.4851567285533576,
        0.6278945984238412,
        0.6281390462008642,
        0.6283081249535385,
        0.6280197922186243,
        0.6280192424935491,
        0.6282832071296321,
        0.6281522276066059,
        0.627965516388511,
        0.6277353544965071,
        0.6278700835347193,
        0.6286806371261001,
        0.6281269536708333,
        0.6281217503270786,
        0.6277798778644176,
        0.6278461900382379,
        0.6285363191287605,
        0.6283971912344217,
        0.6283066377247811,
        0.628142404218728,
        0.6285404729543963,
        0.628117681739836,
        0.6284285531715674,
        0.628440782618211,
        0.6286006002142941,
        0.6279629684369982
    ],
    "rms_dc": [
        0.6621829958188445,
        0.6616518915968526,
        0.6619229399260815,
        0.6617138187667061,
        0.6617088713545417,
        0.6621712182715772,
        0.6624628340232414,
        0.661977447702136,
        0.6627544903873464,
        0.6620207993082551,
        0.662241081744421,
        0.661799506359354,
        0.6623544164712631,
        0.6624120892580125,
        0.6626660580828794,
        0.6620974380917977,
        0.498214159978348,
        0.49823204245121355,
        0.4981883248148897,
        0.49798748569938905,
        0.4983621583589863,
        0.4983645131550537,
        0.49866331698402155,
        0.49849425732991726,
        0.6374436148716767,
        0.6377106362522227,
        0.6377963245451337,
        0.6375594045830764,
        0.6374337096669657,
        0.6378045217930529,
        0.6376521190146351,
        0.637442235802496,
        0.6373332350391726,
        0.6373635157843435,
        0.6381945643264252,
        0.6376292497131597,
        0.6376899092541004,
        0.6372860080258722,
        0.6373424476924897,
        0.6380636089021572,
        0.637839000655549,
        0.6377363375921016,
        0.6376999348751861,
        0.6381092936591727,
        0.6376180440233918,
        0.6378754730392424,
        0.6378695336896755,
        0.6379947683984636,
        0.6373637582315667
    ],
    "dc": [
        -0.14041988067626954,
        -0.14023926696777345,
        -0.14034740295410156,
        -0.14042304229736327,
        -0.1400552963256836,
        -0.1405050018310547,
        -0.1403626495361328,
        -0.14052389526367187,
        -0.14048562774658202,
        -0.13984957580566407,
        -0.14031693725585936,
        -0.14036508178710938,
        -0.1403116729736328,
        -0.14006922912597655,
        -0.1404031967163086,
        -0.14007142333984374,
        -0.11444206237792968,
        -0.11473634033203126,
        -0.11492355346679688,
        -0.11484622802734375,
        -0.11462444915771484,
        -0.11458556365966797,
        -0.1148621109008789,
        -0.11454026947021484,
        -0.10992149658203125,
        -0.11007358551025391,
        -0.10960406799316406,
        -0.10987781829833984,
        -0.10914927978515625,
        -0.10979444274902343,
        -0.10965857849121094,
        -0.10950759887695312,
        -0.11019064025878907,
        -0.10959657592773438,
        -0.10978596649169922,
        -0.10967037048339844,
        -0.11005220184326171,
        -0.10966257781982422,
        -0.1096109359741211,
        -0.10985110168457031,
        -0.10934148712158204,
        -0.10926300964355469,
        -0.10999239501953124,
        -0.11009243621826172,
        -0.1096583236694336,
        -0.10937400360107422,
        -0.10926904754638672,
        -0.10908074951171876,
        -0.10906452484130859
    ],
    "utilization": [
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1
    ]
}

Black Sheep Analysis example

The BlackSheep is a population analysis and has a somewhat different call signature as it requires a number of assets to be submitted to analysis.

[9]:
# Specific signature for BlackSheep
POPULATION_SOURCES = ["u0001","u0001","u0001","u0001","u0001","u0001","u0001","u0001","u0001","u0004","u0002","u0003","u0001"]
analysis_request = session.request_population_analysis(POPULATION_SOURCES, "BlackSheep", parameters={"atypical_threshold": 0.15})

# Generic part, same as above
print(f"Waiting for {analysis_request}")
session.wait_for_analyses([analysis_request["request_id"]])
raw_result = session.get_analysis_results(analysis_request["request_id"])
print(json.dumps(raw_result, sort_keys=False, indent=4)) # Pretty but long
Waiting for {'request_id': 'e0b73e97cf46102ea692af98ccb011a0', 'request_status': 'queued'}
{
    "status": "successful",
    "request_id": "e0b73e97cf46102ea692af98ccb011a0",
    "feature": "BlackSheep",
    "results": {
        "atypical_assets": [
            {
                "timestamps": [
                    1570186860,
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    0,
                    9,
                    7,
                    7,
                    7,
                    7,
                    7,
                    7,
                    7,
                    9,
                    7,
                    0,
                    4,
                    4,
                    4,
                    4,
                    4,
                    4,
                    4,
                    8,
                    8,
                    8,
                    6,
                    8,
                    8,
                    3,
                    10,
                    8,
                    10,
                    10,
                    3,
                    3,
                    8,
                    6,
                    3,
                    3,
                    8,
                    8,
                    8,
                    8,
                    8,
                    6,
                    8,
                    10,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8
                ],
                "atypical": [
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0004"
            },
            {
                "timestamps": [
                    1570186860,
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    5,
                    2,
                    2,
                    2,
                    2,
                    6,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8,
                    8,
                    3,
                    3,
                    2,
                    2,
                    2,
                    2,
                    7,
                    9,
                    7,
                    9,
                    0,
                    7,
                    7,
                    7,
                    7,
                    0,
                    0,
                    7,
                    0,
                    9
                ],
                "atypical": [
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    true,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    true,
                    true,
                    false,
                    true,
                    false
                ],
                "source_id": "u0002"
            },
            {
                "timestamps": [
                    1570186860,
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    6,
                    8,
                    8,
                    8,
                    8,
                    2,
                    2,
                    2,
                    2,
                    2,
                    2,
                    2,
                    2,
                    2,
                    2,
                    8,
                    10,
                    10,
                    8,
                    8,
                    10,
                    8,
                    3,
                    8,
                    3,
                    8,
                    3,
                    10,
                    8,
                    8,
                    1,
                    1,
                    1,
                    11,
                    1,
                    1,
                    11,
                    11,
                    11,
                    1,
                    11,
                    11,
                    1,
                    1,
                    1,
                    1,
                    11,
                    11,
                    11,
                    1
                ],
                "atypical": [
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0003"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            },
            {
                "timestamps": [
                    1570273260,
                    1570359660,
                    1570446060,
                    1570532460,
                    1570618860,
                    1570705260,
                    1570791660,
                    1570878060,
                    1570964460,
                    1571050860,
                    1571137260,
                    1571223660,
                    1571310060,
                    1571396460,
                    1571482860,
                    1571569260,
                    1571655660,
                    1571742060,
                    1571828460,
                    1571914860,
                    1572001260,
                    1572087660,
                    1572177660,
                    1572264060,
                    1572350460,
                    1572436860,
                    1572523260,
                    1572609660,
                    1572696060,
                    1572782460,
                    1572868860,
                    1572955260,
                    1573041660,
                    1573128060,
                    1573214460,
                    1573300860,
                    1573387260,
                    1573473660,
                    1573560060,
                    1573646460,
                    1573732860,
                    1573819260,
                    1573905660,
                    1573992060,
                    1574078460,
                    1574164860,
                    1574251260,
                    1574337660,
                    1574424060
                ],
                "labels": [
                    9,
                    0,
                    7,
                    7,
                    9,
                    0,
                    9,
                    7,
                    7,
                    9,
                    9,
                    7,
                    9,
                    7,
                    7,
                    0,
                    11,
                    1,
                    11,
                    1,
                    11,
                    1,
                    1,
                    1,
                    10,
                    3,
                    6,
                    10,
                    10,
                    3,
                    8,
                    3,
                    6,
                    3,
                    3,
                    8,
                    8,
                    3,
                    8,
                    6,
                    8,
                    8,
                    10,
                    8,
                    6,
                    8,
                    10,
                    8,
                    6
                ],
                "atypical": [
                    false,
                    true,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false,
                    false
                ],
                "source_id": "u0001"
            }
        ]
    },
    "inputs": {
        "experiment": "BlackSheep",
        "feature": "BlackSheep",
        "dataType": "waveform",
        "UUID": [
            "u0001",
            "u0001",
            "u0001",
            "u0001",
            "u0001",
            "u0001",
            "u0001",
            "u0001",
            "u0001",
            "u0004",
            "u0002",
            "u0003",
            "u0001"
        ],
        "black_sheep": true,
        "data-commit": "",
        "n_trials": 12,
        "force_create_model": true,
        "load_model": "",
        "save": false,
        "complex": false,
        "preprocessor_functions": [
            "downselect"
        ],
        "preproc_params": {
            "MINIMUM_REQUIRED_ROWS": 20,
            "DFT_FREQ_RESOLUTION": 0.2,
            "CORRELATION_THRESHOLD": 0.5
        },
        "timestamps": [
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570186860,
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570186860,
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570186860,
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ],
            [
                1570273260,
                1570359660,
                1570446060,
                1570532460,
                1570618860,
                1570705260,
                1570791660,
                1570878060,
                1570964460,
                1571050860,
                1571137260,
                1571223660,
                1571310060,
                1571396460,
                1571482860,
                1571569260,
                1571655660,
                1571742060,
                1571828460,
                1571914860,
                1572001260,
                1572087660,
                1572177660,
                1572264060,
                1572350460,
                1572436860,
                1572523260,
                1572609660,
                1572696060,
                1572782460,
                1572868860,
                1572955260,
                1573041660,
                1573128060,
                1573214460,
                1573300860,
                1573387260,
                1573473660,
                1573560060,
                1573646460,
                1573732860,
                1573819260,
                1573905660,
                1573992060,
                1574078460,
                1574164860,
                1574251260,
                1574337660,
                1574424060
            ]
        ],
        "algo_params": {
            "look_back": 1,
            "number_of_modes": [
                2,
                12
            ],
            "model_sparsity_factor": 0.11,
            "smoothening_factor": 1,
            "max_iterations": 20,
            "threshold": 0
        }
    },
    "error_info": "",
    "debug_info": ""
}

Using the analysis classes

We use exactly the same code as above to inspect the results:

[10]:
# Parse
pretty_result = analysis_classes.parse_results(raw_result, "Europe/Stockholm", "s")
# Show summary
pretty_result.summary()
pretty_result.plot()
=== BlackSheep ===
request_id e0b73e97cf46102ea692af98ccb011a0

+----+----------+------------+
|    | source   | atypical   |
|----+----------+------------|
|  0 | u0001    | True       |
|  1 | u0001    | True       |
|  2 | u0001    | True       |
|  3 | u0001    | True       |
|  4 | u0001    | True       |
|  5 | u0001    | True       |
|  6 | u0001    | True       |
|  7 | u0001    | True       |
|  8 | u0001    | True       |
|  9 | u0004    | True       |
| 10 | u0002    | True       |
| 11 | u0003    | True       |
| 12 | u0001    | True       |
+----+----------+------------+

+------------+-----+
| atypical   |   N |
|------------+-----|
| True       |  13 |
+------------+-----+
/home/tuix/.local/lib/python3.8/site-packages/mvg/features/analysis.py:111: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  dframe["datetime"] = dt_col
../../_images/content_examples_analysis_classes_20_2.png
[10]:
''

Serializing

Finally, we can save the object including the results to pickle. If no name is given it is saved under the name <request_id>.pkl.

[11]:
pretty_result.save_pkl()



Saving BlackSheep object to e0b73e97cf46102ea692af98ccb011a0.pkl
[11]:
'e0b73e97cf46102ea692af98ccb011a0.pkl'