{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Compact estimator representations\n\nThis example illustrates the use of the print_changed_only global parameter.\n\nSetting print_changed_only to True will alternate the representation of\nestimators to only show the parameters that have been set to non-default\nvalues. This can be used to have more compact representations.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from sklearn.linear_model import LogisticRegression\nfrom sklearn import set_config\n\n\nlr = LogisticRegression(penalty=\"l1\")\nprint(\"Default representation:\")\nprint(lr)\n# LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n#                    intercept_scaling=1, l1_ratio=None, max_iter=100,\n#                    multi_class='auto', n_jobs=None, penalty='l1',\n#                    random_state=None, solver='warn', tol=0.0001, verbose=0,\n#                    warm_start=False)\n\nset_config(print_changed_only=True)\nprint(\"\\nWith changed_only option:\")\nprint(lr)\n# LogisticRegression(penalty='l1')"
      ]
    }
  ],
  "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.9.13"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}