{ "metadata": { "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.7-final" }, "orig_nbformat": 2, "kernelspec": { "name": "Python 3.7.7 64-bit ('py37': conda)", "display_name": "Python 3.7.7 64-bit ('py37': conda)", "metadata": { "interpreter": { "hash": "8a09d050f863db8ad263dfeb2d0542738b0c5ac95d8f2f206711295a3f98cf5e" } } } }, "nbformat": 4, "nbformat_minor": 2, "cells": [ { "source": [ "# User Guide" ], "cell_type": "markdown", "metadata": {} }, { "source": [ "## Using \"Core Features\"\n", "The main, \"core\" features of data-describe are exported, meaning they can be utilized without any special import paths:\n", "```\n", "import data_describe as dd\n", "dd.data_summary(df)\n", "```\n", "When running this in a Jupyter Notebook, if it is on the last line of a cell, the plot or other default output will be displayed automatically. " ], "cell_type": "markdown", "metadata": {} }, { "source": [ "## The \"Widget\" class\n", "For most functions in data-describe, the output is actually a subclass of a data-describe Widget. This class serves as a container for all inputs, intermediate calculations, the default visualization, and also secondary outputs or plots related to the feature.\n", "\n", "For example, let's say that one is using the clustering feature:\n", "```\n", "import data_describe as dd\n", "clustering_output = dd.cluster(df) # clustering_output is a \"ClusterWidget\".\n", "```\n", "\n", "Having the output variable (`ClusterWidget`) as the last line of a cell will display the default output i.e. the cluster plot in 2D:\n", "```\n", "clustering_output # Shows the cluster plot\n", "```\n", "\n", "Since the default logic for the `cluster` is to perform a search over multiple `k` values for K-means, one can display the cluster search plot:\n", "```\n", "clustering_output.cluster_search_plot() # Displays the cluster search plot, showing k versus some goodness-of-fit metric for clusters\n", "```\n", "\n", "One can also check the API Reference section in the documentation for a detailed list of what you can do with this `Widget`, or you can inspect the object using the Python builtin `dir()`:\n", "```\n", "dir(clustering_output) # List the attributes and methods on this \"Widget\"\n", "```" ], "cell_type": "markdown", "metadata": {} }, { "source": [ "## Backends\n", "data-describe makes use of multiple \"backends\" for computation and visualization. This allows users to change the framework in which a feature operates. The backend implementation used for a function follows the following logic:\n", "\n", "1. The parameter `compute_backend` or `viz_backend` directly specified in the calling function, e.g. `dd.cluster(compute_backend=\"pandas\")`\n", "2. (Compute only) Inferred from the input data type\n", "3. The default as set in the data-describe configuration options, i.e. `dd.options.backends.compute = \"pandas\"`\n", "\n", "### compute\n", "**pandas**: \"pandas\" is used as the catch-all for computation that runs in memory with no/limited parallel processing. Note: The actual implementation may sometimes utilize operations in NumPy or otherwise outside of a Pandas dataframe for performance reasons.\n", "\n", "**modin**: \"Scale your pandas workflows by changing one line of code\". data-describe provides wrappers for operating on your Modin dataframes.\n", "\n", "### visualization\n", "**seaborn**: \"seaborn\" is used as the catch-all for `matplotlib`-based plots. Plots generated by this backend typically use the `seaborn` API with additional tweaks added using the `matplotlib` API.\n", "\n", "**plotly**: \"The interactive graphing library for Python\". `plotly` is generally used for interactive visualizations.\n", "\n", "### Extending data-describe\n", "data-describe uses a plugin architecture for these backends, so implementations for other frameworks can be created (for example, Bokeh for visualization). See the data-describe Developer Guide for more information." ], "cell_type": "markdown", "metadata": {} }, { "source": [ "## Using other features\n", "data-describe has several other features that are not considered \"core\" functionality, such as sensitive data detection or text preprocessing. To use these features, one will need to specifically import them from the proper location, e.g.:\n", "\n", "```\n", "from data_describe.text.text_preprocessing import preprocess_texts\n", "```\n", "\n", "## Optional Dependencies\n", "Some features of data-describe may use other Python dependencies considered optional. These optional dependencies (e.g. `hdbscan`) are not automatically installed with data-describe. To install these optional dependencies, see the Installation page." ], "cell_type": "markdown", "metadata": {} } ] }