:orphan: .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Machine learning ================ .. toctree:: :glob: :maxdepth: 1 :hidden: ** .. raw:: html
.. raw:: html
.. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Calibration and selection ~~~~~~~~~~~~~~~~~~~~~~~~~ How to tune a machine learning model and select the best one. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/calibration/images/thumb/sphx_glr_plot_calibration_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_calibration_plot_calibration.py` .. raw:: html
Calibration of a polynomial regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/calibration/images/thumb/sphx_glr_plot_selection_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_calibration_plot_selection.py` .. raw:: html
Machine learning algorithm selection example
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/calibration/plot_calibration /examples/mlearning/calibration/plot_selection .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Classification ~~~~~~~~~~~~~~ How to create a classification model. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/classification_model/images/thumb/sphx_glr_plot_classification_api_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_classification_model_plot_classification_api.py` .. raw:: html
Classification API
.. raw:: html
.. only:: html .. image:: /examples/mlearning/classification_model/images/thumb/sphx_glr_plot_knn_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_classification_model_plot_knn.py` .. raw:: html
K nearest neighbors classification
.. raw:: html
.. only:: html .. image:: /examples/mlearning/classification_model/images/thumb/sphx_glr_plot_random_forest_classification_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_classification_model_plot_random_forest_classification.py` .. raw:: html
Random forest classification
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/classification_model/plot_classification_api /examples/mlearning/classification_model/plot_knn /examples/mlearning/classification_model/plot_random_forest_classification .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Clustering ~~~~~~~~~~ How to create a clustering model. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/clustering_model/images/thumb/sphx_glr_plot_clustering_api_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_clustering_model_plot_clustering_api.py` .. raw:: html
API
.. raw:: html
.. only:: html .. image:: /examples/mlearning/clustering_model/images/thumb/sphx_glr_plot_gaussian_mixture_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_clustering_model_plot_gaussian_mixture.py` .. raw:: html
Gaussian Mixtures
.. raw:: html
.. only:: html .. image:: /examples/mlearning/clustering_model/images/thumb/sphx_glr_plot_kmeans_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_clustering_model_plot_kmeans.py` .. raw:: html
K-means
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/clustering_model/plot_clustering_api /examples/mlearning/clustering_model/plot_gaussian_mixture /examples/mlearning/clustering_model/plot_kmeans .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Dimension reduction ~~~~~~~~~~~~~~~~~~~ How to reduce the dimension of a high-dimensional variable. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/dimension_reduction/images/thumb/sphx_glr_plot_klsvd_burgers_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_dimension_reduction_plot_klsvd_burgers.py` .. raw:: html
KL-SVD on Burgers equation
.. raw:: html
.. only:: html .. image:: /examples/mlearning/dimension_reduction/images/thumb/sphx_glr_plot_moe_burgers_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_dimension_reduction_plot_moe_burgers.py` .. raw:: html
Mixture of experts with PCA on Burgers dataset
.. raw:: html
.. only:: html .. image:: /examples/mlearning/dimension_reduction/images/thumb/sphx_glr_plot_pca_burgers_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_dimension_reduction_plot_pca_burgers.py` .. raw:: html
PCA on Burgers equation
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/dimension_reduction/plot_klsvd_burgers /examples/mlearning/dimension_reduction/plot_moe_burgers /examples/mlearning/dimension_reduction/plot_pca_burgers .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Quality ~~~~~~~ It is important to evaluate the quality of a machine learning model before using it. |g| proposes numerical measures and visualizations for this purpose. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/quality_measure/images/thumb/sphx_glr_plot_cross_validation_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_quality_measure_plot_cross_validation.py` .. raw:: html
Cross-validation
.. raw:: html
.. only:: html .. image:: /examples/mlearning/quality_measure/images/thumb/sphx_glr_plot_from_surrogate_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_quality_measure_plot_from_surrogate.py` .. raw:: html
Error from surrogate discipline
.. raw:: html
.. only:: html .. image:: /examples/mlearning/quality_measure/images/thumb/sphx_glr_plot_leave_one_out_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_quality_measure_plot_leave_one_out.py` .. raw:: html
Leave-one-out
.. raw:: html
.. only:: html .. image:: /examples/mlearning/quality_measure/images/thumb/sphx_glr_plot_mse_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_quality_measure_plot_mse.py` .. raw:: html
MSE for regression models
.. raw:: html
.. only:: html .. image:: /examples/mlearning/quality_measure/images/thumb/sphx_glr_plot_r2_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_quality_measure_plot_r2.py` .. raw:: html
R2 for regression models
.. raw:: html
.. only:: html .. image:: /examples/mlearning/quality_measure/images/thumb/sphx_glr_plot_rmse_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_quality_measure_plot_rmse.py` .. raw:: html
RMSE for regression models
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/quality_measure/plot_cross_validation /examples/mlearning/quality_measure/plot_from_surrogate /examples/mlearning/quality_measure/plot_leave_one_out /examples/mlearning/quality_measure/plot_mse /examples/mlearning/quality_measure/plot_r2 /examples/mlearning/quality_measure/plot_rmse .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Regression ~~~~~~~~~~ How to create a regression model. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_regression_api_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_regression_api.py` .. raw:: html
API
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_advanced_moe_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_advanced_moe.py` .. raw:: html
Advanced mixture of experts
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_gp_regression_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_gp_regression.py` .. raw:: html
GP regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_linear_regression_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_linear_regression.py` .. raw:: html
Linear regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_moe_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_moe.py` .. raw:: html
Mixture of experts
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_pce_regression_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_pce_regression.py` .. raw:: html
PCE regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_polynomial_regression_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_polynomial_regression.py` .. raw:: html
Polynomial regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_rbf_regression_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_rbf_regression.py` .. raw:: html
RBF regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_random_forest_regression_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_random_forest_regression.py` .. raw:: html
Random forest regression
.. raw:: html
.. only:: html .. image:: /examples/mlearning/regression_model/images/thumb/sphx_glr_plot_save_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_regression_model_plot_save.py` .. raw:: html
Save and Load
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/regression_model/plot_regression_api /examples/mlearning/regression_model/plot_advanced_moe /examples/mlearning/regression_model/plot_gp_regression /examples/mlearning/regression_model/plot_linear_regression /examples/mlearning/regression_model/plot_moe /examples/mlearning/regression_model/plot_pce_regression /examples/mlearning/regression_model/plot_polynomial_regression /examples/mlearning/regression_model/plot_rbf_regression /examples/mlearning/regression_model/plot_random_forest_regression /examples/mlearning/regression_model/plot_save .. Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Data transformation ~~~~~~~~~~~~~~~~~~~ Fitting a model from transformed data rather than raw data can facilitate the training and improve the quality of the machine learning model. Every machine learning model has a ``transformer`` argument to set the transformation policy (none by default). In the special case of regression models, the function :func:`.create_surrogate` and the :class:`.SurrogateDiscipline` class use :attr:`.MLRegressionAlgo.DEFAULT_TRANSFORMER` by default, i.e. :class:`.MinMaxScaler` for both inputs and outputs. .. raw:: html
.. raw:: html
.. only:: html .. image:: /examples/mlearning/transformer/images/thumb/sphx_glr_plot_pipeline_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_transformer_plot_pipeline.py` .. raw:: html
Pipeline
.. raw:: html
.. only:: html .. image:: /examples/mlearning/transformer/images/thumb/sphx_glr_plot_scaler_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_transformer_plot_scaler.py` .. raw:: html
Scalers
.. raw:: html
.. only:: html .. image:: /examples/mlearning/transformer/images/thumb/sphx_glr_plot_scaling_data_thumb.png :alt: :ref:`sphx_glr_examples_mlearning_transformer_plot_scaling_data.py` .. raw:: html
Scaling
.. raw:: html
.. toctree:: :hidden: /examples/mlearning/transformer/plot_pipeline /examples/mlearning/transformer/plot_scaler /examples/mlearning/transformer/plot_scaling_data .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-gallery .. container:: sphx-glr-download sphx-glr-download-python :download:`Download all examples in Python source code: mlearning_python.zip ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download all examples in Jupyter notebooks: mlearning_jupyter.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_