Generate your Insights
Details the process of generating insights from the input data.
Show Topics
The show_topics
method allows you to retrieve a list of available analysis topics or subtopics. These topics represent specific questions or areas of interest that can be explored using the library's analysis capabilities. It returns a dict.
Output Response
analysis
str
Name of the analysis for the topic.
Possible Values: "Descriptor","Change","Trend","Compare", "Target","Budget"
name
str
Name of the topic.
description
str
Description of the topic.
Get Insights
The get_insights
method allows you to transform data into actionable knowledge. It enables you to uncover insights about specific topics or provides in-depth information on your data based on selected analysis type. It identifies hidden patterns, trends, and key information within your dataset.
Method Signature:
on
list/str
Analysis Name/Topics that are to be used to create a summary. This is the most important parameter of the function.
Analysis Name Accepted Values : "descriptor","change","trend", "compare_measure",compare_dimension,
"target","budget"
It should be passed as a string.
focus_on_value
list/str
Narrow down the analysis to a specific value/values within the chosen dimension. Enables you to target a particular data point.
For Example, If dimension is set as "Region", specifying focus_on_value
as "South" will direct the function to specifically analyze and summarize feedback related to South Region.
It can be either a string or list of values.
It is an optional parameter.
compare_value_1
str
Used to contrast or compare against the value provided in compare_value_2
.
To be used with compare_dimension analysis and topics like compare_by_contribution, compare_by_performance and compare_by_rank.
Should be kept blank for other analyses and topics.
compare_value_2
str
Used to contrast or compare against the value provided in compare_value_1
.
To be used with compare_dimension analysis and topics like compare_by_contribution, compare_by_performance and compare_by_rank.
Should be kept blank for other analyses and topics.
formatted_sentence
bool
Add formatted_sentence key which has html text styling applied to important text and numbers in the output sentence.
Default: False
It is an optional parameter.
forecast_meta
dict
Output Response
sections
list
Contains multiple dictionaries for each metric that is passed.
name
str
Name of the metric for which the insights are generated.
insights
list
Contains multiple dictionaries where each dictionary has one insight and title.
title
str
Title for the generated insight.
sentence
str
Generated insight in plain text.
formatted_sentence
str
Generated insight with HTML tags applied around important text and numbers. Can be directly rendered in HTML.
type
str
Specifies whether the insight generation process was successful or encountered an error during execution.
Possible Values: "generated", "error"
time_taken
float
Time taken for generation(in seconds).
Examples
Get Insights using Analysis
The following snippets shows how can you generate insights for Trend Analysis
To get insights on Trend of particular value/values in your data you can specify the value/values using focus_on_value
. Let's consider that we want to get trend of Sales for West Region, we can achieve that using following snippet:
Get Insight using Topics
The following snippet shows how can you generate insights for specific topics of Change analysis:
We can get insights on a particular value/values of data by passing them to focus_on_value
parameter.
Last updated