diff --git a/examples/ds_agents/eda_tools_agent.ipynb b/examples/ds_agents/eda_tools_agent.ipynb index c98839d..befe993 100644 --- a/examples/ds_agents/eda_tools_agent.ipynb +++ b/examples/ds_agents/eda_tools_agent.ipynb @@ -488,7 +488,7 @@ { "data": { "text/plain": [ - "ChatOpenAI(client=, async_client=, root_client=, root_async_client=, model_name='gpt-4o-mini', model_kwargs={}, openai_api_key=SecretStr('**********'))" + "ChatOpenAI(client=, async_client=, root_client=, root_async_client=, model_name='gpt-4o-mini', model_kwargs={}, openai_api_key=SecretStr('**********'))" ] }, "execution_count": 2, @@ -523,7 +523,7 @@ "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAALEAAADqCAIAAABiAjOmAAAAAXNSR0IArs4c6QAAHmZJREFUeJztnWlAE8cCxyfJ5j6AEA4hQDgEBBSwqIB31aoILd7gWVtraa2tVdpn1bZaj1Z7YFufr1ZftS14oVWEVlGL4m09ngceHAIidw6SkITceR92X8qLAalN3BXm9wn3mPwNP2ZnZmd3SBaLBUAg7SDjHQBCOKATEFugExBboBMQW6ATEFugExBbELwDdBVdm0lar9e0mjStRqPRYtQ/E11oC5VGZvEQFpfC41NdBFS883QJEsHHJ9RKQ/k1dVWJWi7R89ypLC6FxUV4fKpBZ8Y72uOxAItBZ9EojZpWE0IlKWXGwCh2cD+2px8D72idQVwnzCbL+XyppF7n7kMLiuL4hjDxTvR3kTboqkrU8maDTmtOTHF386Thncg+BHXi9kXFqVxxYop77Ag3vLM4nspbqvP50uBoTsIEd7yz2IGITpzKbWawyPETBHgHcS5lV1uvF8unLfHDO4gthHPieHaTdyCj72AXvIM8DZpqtAe+qc3YGEwmk/DO8ifEcuLQlrqQGE5UYo8QAsWgN3+/rHLhVyF4B/kTAjlx5pCY60qNGeGKd5CnjbhW9/ueprRMf7yDYBBlzKr0WitCJfdAIQAAHkJ63Gj+ucMSvINgEMWJ4lxx/+d7ohAoITGcmlKNpE6HdxBAFCeunmiJGsyjMyl4B8GTwSmCc/mEq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 -573,14 +573,17 @@ { "data": { "text/markdown": [ - "Here is a table of the tools I have access to:\n", + "Here's a table summarizing the tools I have access to:\n", "\n", - "| Tool Name | Description |\n", - "|----------------------------|----------------------------------------------------------------------------------------------------------------|\n", - "| `describe_dataset` | Converts raw data into a pandas DataFrame and computes summary statistics using the DataFrame's describe() method. |\n", - "| `visualize_missing` | Generates missing data visualizations (matrix, bar, and heatmap) and returns base64-encoded PNG images. |\n", - "| `correlation_funnel` | Computes the correlation funnel with respect to a specified target level and applies binarization. |\n", - "| `generate_sweetviz_report` | Generates an EDA report using Sweetviz and saves it as an HTML file in a specified directory. |" + "| Tool Name | Description |\n", + "|----------------------------|-----------------------------------------------------------------------------------------------------------------------|\n", + "| explain_data | Provides a detailed narrative summary of a DataFrame, including shape, column types, missing values, and sample rows. |\n", + "| describe_dataset | Computes and returns summary statistics for the dataset using pandas' describe() method. |\n", + "| visualize_missing | Generates missing value analysis plots, including a matrix plot, bar plot, and heatmap plot. |\n", + "| correlation_funnel | Performs correlation analysis using the correlation funnel method, binarizing the data and computing correlation. |\n", + "| generate_sweetviz_report | Creates an Exploratory Data Analysis (EDA) report using the Sweetviz library. |\n", + "\n", + "If you have specific tasks or analyses in mind, feel free to ask!" ], "text/plain": [ "" @@ -606,7 +609,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -621,43 +624,44 @@ { "data": { "text/markdown": [ - "The correlation funnel tool is designed for performing correlation analysis between a target column and other features in a dataset. It helps to understand how different variables relate to a specific target variable by binarizing the data and computing the correlation.\n", + "The correlation funnel tool is designed to analyze the correlation between different features in a dataset, particularly focusing on a specified target variable. Here's an overview of its key components and functionality:\n", "\n", - "### Key Parameters:\n", + "### Purpose\n", + "- The tool aims to identify how various features relate to a target variable, allowing for insights into which features might be influential or predictive in a given context.\n", "\n", + "### Key Parameters\n", "1. **target**: \n", - " - This is the base target column name (e.g., 'Member_Status'). The tool will look for columns that begin with this string followed by '__' (e.g., 'Member_Status__Gold', 'Member_Status__Platinum').\n", + " - This is the name of the target column that you want to analyze. The tool looks for columns that start with this target name followed by a double underscore (e.g., 'target__Category1', 'target__Category2').\n", "\n", - "2. **target_bin_index**: \n", - " - This parameter can either be an integer or a string. If it's an integer, it selects the target level by position from the matching columns. If it's a string (e.g., \"Yes\"), it attempts to match it to the suffix of a column name (i.e., 'target__Yes'). The default value is -1, which typically means the last level.\n", + "2. **target_bin_index**:\n", + " - This can be an integer or a string. If it's an integer, it selects the target level by position from the matching columns. If it's a string (like \"Yes\"), it matches to the suffix of a column name to determine which level of the target to analyze.\n", "\n", - "3. **corr_method**: \n", - " - This specifies the correlation method to be used. Options include 'pearson', 'kendall', or 'spearman'. The default method is 'pearson'.\n", + "3. **corr_method**:\n", + " - This specifies the method of correlation to use: 'pearson', 'kendall', or 'spearman'. The default method is 'pearson'.\n", "\n", - "4. **n_bins**: \n", - " - This parameter determines the number of bins to use for binarization of the data. The default is set to 4.\n", + "4. **n_bins**:\n", + " - The number of bins used for binarizing the data. The default is 4, which divides the data into four categories for analysis.\n", "\n", - "5. **thresh_infreq**: \n", - " - This is the threshold for infrequent levels. The default value is 0.01, meaning levels that occur less frequently than this threshold will be considered infrequent.\n", + "5. **thresh_infreq**:\n", + " - This threshold determines what constitutes infrequent levels in the data. The default is set at 0.01, meaning any level occurring less than 1% of the time will be treated as infrequent.\n", "\n", - "6. **name_infreq**: \n", - " - This parameter allows you to specify the name to use for infrequent levels. The default name is '-OTHER'.\n", + "6. **name_infreq**:\n", + " - This is a label that can be applied to infrequent levels, with the default name set as '-OTHER'.\n", "\n", - "### Purpose:\n", - "The correlation funnel tool is particularly useful for exploratory data analysis (EDA) as it provides insights into how various features correlate with the target variable. By transforming categorical variables into a binary format, it allows for easier comparison and understanding of relationships within the data.\n", + "### Functionality\n", + "- The correlation funnel tool helps in visualizing and quantifying how features relate to the target variable, which can be particularly useful in exploratory data analysis (EDA).\n", + "- It can reveal patterns and relationships that may not be immediately obvious, thus aiding in feature selection and model development.\n", "\n", - "### Applications:\n", - "- Identifying the strength and direction of relationships between variables.\n", - "- Helping to inform feature selection and engineering for predictive modeling.\n", - "- Supporting data-driven decision-making based on the relationships observed in the data. \n", + "### Use Cases\n", + "- This tool can be especially useful in fields such as marketing, finance, and healthcare, where understanding the relationship between input features and outcomes is crucial for decision-making.\n", "\n", - "This tool is particularly valuable in fields such as marketing, finance, and healthcare, where understanding correlations can lead to better strategies and outcomes." + "Overall, the correlation funnel tool is a valuable asset in data analysis, providing insights that can guide further analysis and modeling efforts." ], "text/plain": [ "" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -679,12 +683,73 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Example 1: Describe data set tool" + "#### Example 1: Explain data tool" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "---EXPLORATORY DATA ANALYST AGENT----\n", + " * RUN REACT TOOL-CALLING AGENT FOR EDA\n", + " * Tool: explain_data\n", + " * POST-PROCESSING EDA RESULTS\n" + ] + }, + { + "data": { + "text/markdown": [ + "Here are the first 5 rows of the dataset:\n", + "\n", + "| customerID | gender | SeniorCitizen | Partner | Dependents | tenure | PhoneService | MultipleLines | InternetService | OnlineSecurity | OnlineBackup | DeviceProtection | TechSupport | StreamingTV | StreamingMovies | Contract | PaperlessBilling | PaymentMethod | MonthlyCharges | TotalCharges | Churn |\n", + "|--------------|--------|---------------|---------|------------|--------|--------------|--------------------|-----------------|----------------|--------------|------------------|-------------|-------------|-----------------|------------------|------------------|------------------------------|----------------|--------------|-------|\n", + "| 7590-VHVEG | Female | 0 | Yes | No | 1 | No | No phone service | DSL | No | Yes | No | No | No | No | Month-to-month | Yes | Electronic check | 29.85 | 29.85 | No |\n", + "| 5575-GNVDE | Male | 0 | No | No | 34 | Yes | No | DSL | Yes | No | Yes | No | No | No | One year | No | Mailed check | 56.95 | 1889.5 | No |\n", + "| 3668-QPYBK | Male | 0 | No | No | 2 | Yes | No | DSL | Yes | Yes | No | No | No | No | Month-to-month | Yes | Mailed check | 53.85 | 108.15 | Yes |\n", + "| 7795-CFOCW | Male | 0 | No | No | 45 | No | No phone service | DSL | Yes | No | Yes | Yes | No | No | One year | No | Bank transfer (automatic) | 42.30 | 1840.75 | No |\n", + "| 9237-HQITU | Female | 0 | No | No | 2 | Yes | No | Fiber optic | No | No | No | No | No | No | Month-to-month | Yes | Electronic check | 70.70 | 151.65 | Yes |\n", + "\n", + "### Key Attributes:\n", + "- **customerID**: Unique identifier for each customer.\n", + "- **gender**: Gender of the customer.\n", + "- **SeniorCitizen**: Indicates if the customer is a senior citizen (1 for Yes, 0 for No).\n", + "- **Partner**: Indicates if the customer has a partner (Yes/No).\n", + "- **Dependents**: Indicates if the customer has dependents (Yes/No).\n", + "- **tenure**: Number of months the customer has been with the service.\n", + "- **Churn**: Indicates if the customer has churned (Yes/No)." + ], + "text/plain": [ + "" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "exploratory_agent.invoke_agent(\n", + " user_instructions=\"What are the first 5 rows of the data?\",\n", + " data_raw=df,\n", + ")\n", + "exploratory_agent.get_ai_message(markdown=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Example 2: Describe data set tool" + ] + }, + { + "cell_type": "code", + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -700,13 +765,13 @@ { "data": { "text/markdown": [ - "The dataset has been described using summary statistics, which include measures such as count, mean, standard deviation, minimum, maximum, and various percentiles. If you need specific statistical details or insights, please let me know!" + "Summary statistics for the dataset have been computed. If you need specific details about the statistics, please let me know!" ], "text/plain": [ "" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -721,7 +786,29 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict_keys(['describe_df'])" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "artifacts = exploratory_agent.get_artifacts()\n", + "\n", + "artifacts.keys()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -1107,25 +1194,25 @@ "[11 rows x 21 columns]" ] }, - "execution_count": 6, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "exploratory_agent.get_artifacts(as_dataframe=True)" + "pd.DataFrame(artifacts['describe_df'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "#### Example 2: Missing data tool\n" + "#### Example 3: Missing data tool\n" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -1141,7 +1228,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/Users/mdancho/Desktop/course_code/ai-data-science-team/ai_data_science_team/tools/eda.py:87: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.\n", + "/Users/mdancho/Desktop/course_code/ai-data-science-team/ai_data_science_team/tools/eda.py:130: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.\n", " plt.tight_layout()\n", "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/seaborn/matrix.py:309: UserWarning: Attempting to set identical low and high xlims makes transformation singular; automatically expanding.\n", " ax.set(xlim=(0, self.data.shape[1]), ylim=(0, self.data.shape[0]))\n", @@ -1159,13 +1246,13 @@ { "data": { "text/markdown": [ - "The missing data visualizations (matrix, bar, and heatmap) have been successfully generated. If you would like to see the plots or need further analysis, please let me know!" + "The missing data visualizations (matrix plot, bar plot, and heatmap) have been successfully generated. If you need to see the visualizations or further insights, please let me know!" ], "text/plain": [ "" ] }, - "execution_count": 5, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" }, @@ -1199,7 +1286,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -1208,7 +1295,7 @@ "dict_keys(['matrix_plot', 'bar_plot', 'heatmap_plot'])" ] }, - "execution_count": 7, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -1220,7 +1307,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -1239,7 +1326,7 @@ "(
, )" ] }, - "execution_count": 12, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -1252,7 +1339,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -1271,7 +1358,7 @@ "(
, )" ] }, - "execution_count": 13, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -1284,7 +1371,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -1303,7 +1390,7 @@ "(
, )" ] }, - "execution_count": 14, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -1318,12 +1405,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Example 3: Correlation Funnel Tool" + "#### Example 4: Correlation Funnel Tool" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -1352,7 +1439,7 @@ "If you believe this warning to be a false positive, you can set the `POLARS_SKIP_CPU_CHECK` environment variable to bypass this check.\n", "\n", "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/plotnine/ggplot.py:587: PlotnineWarning: Saving 7 x 6.0 in image.\n", - "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/plotnine/ggplot.py:588: PlotnineWarning: Filename: <_io.BytesIO object at 0x7fbfd21927a0>\n", + "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/plotnine/ggplot.py:588: PlotnineWarning: Filename: <_io.BytesIO object at 0x7feaa9da6700>\n", "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/plotnine/layer.py:364: PlotnineWarning: geom_point : Removed 2 rows containing missing values.\n", "/Users/mdancho/opt/anaconda3/envs/ds4b_301p_dev/lib/python3.10/site-packages/plotnine/layer.py:364: PlotnineWarning: geom_text : Removed 2 rows containing missing values.\n" ] @@ -1367,13 +1454,13 @@ { "data": { "text/markdown": [ - "The correlation funnel analysis has been successfully computed using the Pearson method for the target level 'Churn__Yes'. If you need further insights or specific details from the analysis, please let me know!" + "The correlation funnel analysis has been successfully computed using the Pearson method for the target level 'Churn__Yes'. The base target was 'Churn'. If you need further insights or visualizations from this analysis, please let me know!" ], "text/plain": [ "" ] }, - "execution_count": 7, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -1388,7 +1475,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -1397,7 +1484,7 @@ "dict_keys(['correlation_data', 'plot_image', 'plotly_figure'])" ] }, - "execution_count": 27, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -1408,7 +1495,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -1831,18 +1918,18 @@ "54 TotalCharges -OTHER NaN" ] }, - "execution_count": 8, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "pd.DataFrame(exploratory_agent.get_artifacts(as_dataframe=False)['correlation_data'])" + "pd.DataFrame(exploratory_agent.get_artifacts()['correlation_data'])" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { @@ -1866,18 +1953,18 @@ "(
, )" ] }, - "execution_count": 9, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "matplotlib_from_base64(exploratory_agent.get_artifacts(as_dataframe=False)['plot_image'])" + "matplotlib_from_base64(exploratory_agent.get_artifacts()['plot_image'])" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -3133,7 +3220,7 @@ } ], "source": [ - "plotly_from_dict(exploratory_agent.get_artifacts(as_dataframe=False)['plotly_figure'])" + "plotly_from_dict(exploratory_agent.get_artifacts()['plotly_figure'])" ] }, { @@ -3147,12 +3234,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Example 4: Sweetviz Tool" + "#### Example 5: Sweetviz Tool" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -3161,13 +3248,14 @@ "text": [ "---EXPLORATORY DATA ANALYST AGENT----\n", " * RUN REACT TOOL-CALLING AGENT FOR EDA\n", - " * Tool: generate_sweetviz_report\n" + " * Tool: generate_sweetviz_report\n", + " * Using temporary directory: /var/folders/3s/bjq91lxs0jq9_zcw2q4l95gh0000gn/T/tmpaedo566u\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "6720e55b393c440cae7ed91787ae7ad1", + "model_id": "22a1b83ae414430dae508ab3a3576a57", "version_major": 2, "version_minor": 0 }, @@ -3182,20 +3270,20 @@ "name": "stdout", "output_type": "stream", "text": [ - "Report /Users/mdancho/Desktop/course_code/ai-data-science-team/reports/sweetviz_report.html was generated! NOTEBOOK/COLAB USERS: the web browser MAY not pop up, regardless, the report IS saved in your notebook/colab files.\n", + "Report /var/folders/3s/bjq91lxs0jq9_zcw2q4l95gh0000gn/T/tmpaedo566u/sweetviz_report.html was generated.\n", " * POST-PROCESSING EDA RESULTS\n" ] }, { "data": { "text/markdown": [ - "The Sweetviz EDA report has been generated successfully and saved as [sweetviz_report.html](sandbox:/Users/mdancho/Desktop/course_code/ai-data-science-team/reports/sweetviz_report.html). You can open this file to explore the detailed analysis of the dataset with the \"Churn\" feature as the target." + "The Sweetviz EDA report has been generated successfully and saved as [sweetviz_report.html](sandbox:/var/folders/3s/bjq91lxs0jq9_zcw2q4l95gh0000gn/T/tmpaedo566u/sweetviz_report.html) in a temporary directory. You can download and view the report to explore the dataset with the \"Churn\" feature as the target." ], "text/plain": [ "" ] }, - "execution_count": 21, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -3208,6 +3296,35 @@ "exploratory_agent.get_ai_message(markdown=True)" ] }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict_keys(['report_file', 'report_html'])" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "exploratory_agent.get_artifacts().keys()" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "open_html_file_in_browser(exploratory_agent.get_artifacts()['report_file'])" + ] + }, { "cell_type": "markdown", "metadata": {},