Advanced data analysis

This section describes how to generate advanced data analysis in AI & Analytics Engine.

from aiaengine import Dataset, DistributionAnalysisTask

# get the dataset we want to run the analysis
dataset = Dataset(id='62822335-a611-4619-b4a9-7b07e8e23554')

# run a Data Distribution analysis, group by `Sales_Channel` column
# analysis = dataset.run_analysis(task=DistributionAnalysisTask(grouping_column='Sales_Channel'))
# print(analysis.result)

# we can also get all the analysis results that we have already run
analyses = dataset.list_analyses()
for analysis in analyses:
    print('-'*80)
    print(analysis.config)
    print(analysis.result)
package com.aiaengine.examples.dataset;

import com.aiaengine.Dataset;
import com.aiaengine.Engine;
import com.aiaengine.dataset.DatasetAnalysis;
import com.aiaengine.dataset.DistributionAnalysisTask;
import com.aiaengine.dataset.request.RunAnalysisRequest;

import java.io.FileNotFoundException;
import java.util.List;

public class RunAnalysisApp {
    public static void main(String[] args) throws FileNotFoundException {
        Engine engine = new Engine();
        Dataset ds = engine.getDataset("f55717be-14dd-40ea-8cad-f71370d5b961");
        DatasetAnalysis analysisResult = ds.runAnalysis(RunAnalysisRequest.builder()
                .task(new DistributionAnalysisTask("project_id"))
                .build());
        System.out.println(analysisResult.getResult());
        System.out.println(analysisResult.getConfig());

        //we can also get all the analysis results that we have already run
        List<DatasetAnalysis> results = ds.listAnalyses();
        results.forEach(datasetAnalysis -> {
            System.out.println(datasetAnalysis.getResult());
            System.out.println(datasetAnalysis.getConfig());
        });
    }
}