{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Univariate plots\n\nFor a list of features separate in bins and analysis the target distribution in both Train and Test\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\n\nfrom dfds_ds_toolbox.analysis.plotting import plot_univariate_dependencies\n\n# Create a dataset to classify\nX, y = load_iris(return_X_y=True, as_frame=True)\nfeatures = list(X.columns)\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.4, random_state=42)\ndata_train = X_train.copy()\ndata_train[\"target\"] = y_train\n\ndata_test = X_test.copy()\ndata_test[\"target\"] = y_test\n\n# plots univariate plots of first 10 columns in data_train\nplot_univariate_dependencies(\n    data=data_train, target_col=\"target\", features_list=features, data_test=data_test\n)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "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.10.8"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}