.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/miscellaneous/plot_estimator_representation.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. or to run this example in your browser via JupyterLite or Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_miscellaneous_plot_estimator_representation.py: =========================================== عرض المنمذجات وأنابيب التوصيل المعقدة =========================================== يوضح هذا المثال طرقًا مختلفة لعرض المنمذجات وأنابيب التوصيل. .. GENERATED FROM PYTHON SOURCE LINES 8-18 .. code-block:: Python # المؤلفون: مطوري scikit-learn # معرف الترخيص: BSD-3-Clause from sklearn.compose import make_column_transformer from sklearn.impute import SimpleImputer from sklearn.linear_model import LogisticRegression from sklearn.pipeline import make_pipeline from sklearn.preprocessing import OneHotEncoder, StandardScaler .. GENERATED FROM PYTHON SOURCE LINES 19-25 تمثيل نصي مضغوط --------------------------- ستعرض المنمذجات فقط المعاملات التي تم ضبطها على قيم غير افتراضية عندما يتم عرضها كسلسلة نصية. هذا يقلل من التشويش البصري ويجعل من السهل ملاحظة الاختلافات عند مقارنة الحالات. .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: Python lr = LogisticRegression(penalty="l1") print(lr) .. rst-class:: sphx-glr-script-out .. code-block:: none LogisticRegression(penalty='l1') .. GENERATED FROM PYTHON SOURCE LINES 30-36 تمثيل HTML غني ------------------------ في دفاتر الملاحظات، ستستخدم المنمذجات وأنابيب التوصيل تمثيل HTML غني. وهذا مفيد بشكل خاص لتلخيص بنية أنابيب التوصيل والمنمذجات المركبة الأخرى، مع التفاعل لتوفير التفاصيل. انقر على الصورة التوضيحية أدناه لتوسيع عناصر أنبوب التوصيل. راجع: ref:`visualizing_composite_estimators` لمعرفة كيفية استخدام هذه الميزة. .. GENERATED FROM PYTHON SOURCE LINES 36-49 .. code-block:: Python num_proc = make_pipeline(SimpleImputer(strategy="median"), StandardScaler()) cat_proc = make_pipeline( SimpleImputer(strategy="constant", fill_value="missing"), OneHotEncoder(handle_unknown="ignore"), ) preprocessor = make_column_transformer( (num_proc, ("feat1", "feat3")), (cat_proc, ("feat0", "feat2")) ) clf = make_pipeline(preprocessor, LogisticRegression()) clf .. raw:: html
Pipeline(steps=[('columntransformer',
                     ColumnTransformer(transformers=[('pipeline-1',
                                                      Pipeline(steps=[('simpleimputer',
                                                                       SimpleImputer(strategy='median')),
                                                                      ('standardscaler',
                                                                       StandardScaler())]),
                                                      ('feat1', 'feat3')),
                                                     ('pipeline-2',
                                                      Pipeline(steps=[('simpleimputer',
                                                                       SimpleImputer(fill_value='missing',
                                                                                     strategy='constant')),
                                                                      ('onehotencoder',
                                                                       OneHotEncoder(handle_unknown='ignore'))]),
                                                      ('feat0', 'feat2'))])),
                    ('logisticregression', LogisticRegression())])
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.040 seconds) .. _sphx_glr_download_auto_examples_miscellaneous_plot_estimator_representation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/scikit-learn/scikit-learn/main?urlpath=lab/tree/notebooks/auto_examples/miscellaneous/plot_estimator_representation.ipynb :alt: Launch binder :width: 150 px .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../lite/lab/index.html?path=auto_examples/miscellaneous/plot_estimator_representation.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_estimator_representation.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_estimator_representation.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_estimator_representation.zip ` .. include:: plot_estimator_representation.recommendations .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_