trainedml 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. trainedml-0.1.1/LICENCE +21 -0
  2. trainedml-0.1.1/MANIFEST.in +12 -0
  3. trainedml-0.1.1/PKG-INFO +145 -0
  4. trainedml-0.1.1/README.md +112 -0
  5. trainedml-0.1.1/doc/Makefile +20 -0
  6. trainedml-0.1.1/doc/make.bat +35 -0
  7. trainedml-0.1.1/doc/source/_static/basic.css +3 -0
  8. trainedml-0.1.1/doc/source/_static/figures/building-predictive-models-logistic-regression-in-python_01.png +0 -0
  9. trainedml-0.1.1/doc/source/_static/figures/knn.png +0 -0
  10. trainedml-0.1.1/doc/source/_static/figures/random-forest-2-768x492.png +0 -0
  11. trainedml-0.1.1/doc/source/conf.py +40 -0
  12. trainedml-0.1.1/doc/source/index.rst +100 -0
  13. trainedml-0.1.1/doc/source/modules.rst +27 -0
  14. trainedml-0.1.1/doc/source/trainedml/analyzer.rst +7 -0
  15. trainedml-0.1.1/doc/source/trainedml/bivariate.rst +7 -0
  16. trainedml-0.1.1/doc/source/trainedml/boxplot.rst +7 -0
  17. trainedml-0.1.1/doc/source/trainedml/correlation.rst +7 -0
  18. trainedml-0.1.1/doc/source/trainedml/distribution.rst +7 -0
  19. trainedml-0.1.1/doc/source/trainedml/heatmap.rst +7 -0
  20. trainedml-0.1.1/doc/source/trainedml/histogram.rst +7 -0
  21. trainedml-0.1.1/doc/source/trainedml/line.rst +7 -0
  22. trainedml-0.1.1/doc/source/trainedml/missing.rst +7 -0
  23. trainedml-0.1.1/doc/source/trainedml/models/knn.rst +44 -0
  24. trainedml-0.1.1/doc/source/trainedml/models/logistic.rst +40 -0
  25. trainedml-0.1.1/doc/source/trainedml/models/random_forest.rst +43 -0
  26. trainedml-0.1.1/doc/source/trainedml/multicollinearity.rst +7 -0
  27. trainedml-0.1.1/doc/source/trainedml/normality.rst +7 -0
  28. trainedml-0.1.1/doc/source/trainedml/outliers.rst +7 -0
  29. trainedml-0.1.1/doc/source/trainedml/profiling.rst +7 -0
  30. trainedml-0.1.1/doc/source/trainedml/target.rst +7 -0
  31. trainedml-0.1.1/doc/source/trainedml/visualization.rst +7 -0
  32. trainedml-0.1.1/doc/source/trainedml/vizs.rst +7 -0
  33. trainedml-0.1.1/pyproject.toml +43 -0
  34. trainedml-0.1.1/requirements.txt +14 -0
  35. trainedml-0.1.1/setup.cfg +4 -0
  36. trainedml-0.1.1/src/trainedml/__init__.py +178 -0
  37. trainedml-0.1.1/src/trainedml/__main__.py +7 -0
  38. trainedml-0.1.1/src/trainedml/analyzer.py +481 -0
  39. trainedml-0.1.1/src/trainedml/benchmark.py +251 -0
  40. trainedml-0.1.1/src/trainedml/cli.py +183 -0
  41. trainedml-0.1.1/src/trainedml/data/__init__.py +6 -0
  42. trainedml-0.1.1/src/trainedml/data/loader.py +206 -0
  43. trainedml-0.1.1/src/trainedml/evaluation.py +172 -0
  44. trainedml-0.1.1/src/trainedml/figure.py +209 -0
  45. trainedml-0.1.1/src/trainedml/models/__init__.py +84 -0
  46. trainedml-0.1.1/src/trainedml/models/base.py +182 -0
  47. trainedml-0.1.1/src/trainedml/models/factory.py +54 -0
  48. trainedml-0.1.1/src/trainedml/models/knn.py +93 -0
  49. trainedml-0.1.1/src/trainedml/models/logistic.py +102 -0
  50. trainedml-0.1.1/src/trainedml/models/random_forest.py +101 -0
  51. trainedml-0.1.1/src/trainedml/models/regressors.py +132 -0
  52. trainedml-0.1.1/src/trainedml/utils/__init__.py +5 -0
  53. trainedml-0.1.1/src/trainedml/utils/factory.py +13 -0
  54. trainedml-0.1.1/src/trainedml/visualization.py +487 -0
  55. trainedml-0.1.1/src/trainedml/viz/__init__.py +20 -0
  56. trainedml-0.1.1/src/trainedml/viz/bivariate.py +68 -0
  57. trainedml-0.1.1/src/trainedml/viz/boxplot.py +64 -0
  58. trainedml-0.1.1/src/trainedml/viz/correlation.py +102 -0
  59. trainedml-0.1.1/src/trainedml/viz/distribution.py +63 -0
  60. trainedml-0.1.1/src/trainedml/viz/heatmap.py +102 -0
  61. trainedml-0.1.1/src/trainedml/viz/histogram.py +98 -0
  62. trainedml-0.1.1/src/trainedml/viz/line.py +56 -0
  63. trainedml-0.1.1/src/trainedml/viz/missing.py +57 -0
  64. trainedml-0.1.1/src/trainedml/viz/multicollinearity.py +70 -0
  65. trainedml-0.1.1/src/trainedml/viz/normality.py +81 -0
  66. trainedml-0.1.1/src/trainedml/viz/outliers.py +92 -0
  67. trainedml-0.1.1/src/trainedml/viz/profiling.py +59 -0
  68. trainedml-0.1.1/src/trainedml/viz/target.py +26 -0
  69. trainedml-0.1.1/src/trainedml/viz/vizs.py +109 -0
  70. trainedml-0.1.1/src/trainedml.egg-info/PKG-INFO +145 -0
  71. trainedml-0.1.1/src/trainedml.egg-info/SOURCES.txt +89 -0
  72. trainedml-0.1.1/src/trainedml.egg-info/dependency_links.txt +1 -0
  73. trainedml-0.1.1/src/trainedml.egg-info/entry_points.txt +2 -0
  74. trainedml-0.1.1/src/trainedml.egg-info/requires.txt +20 -0
  75. trainedml-0.1.1/src/trainedml.egg-info/top_level.txt +1 -0
  76. trainedml-0.1.1/tests/__init__.py +1 -0
  77. trainedml-0.1.1/tests/test_analyzer.py +114 -0
  78. trainedml-0.1.1/tests/test_benchmark.py +63 -0
  79. trainedml-0.1.1/tests/test_cli.py +52 -0
  80. trainedml-0.1.1/tests/test_evaluation.py +77 -0
  81. trainedml-0.1.1/tests/test_heatmap.py +25 -0
  82. trainedml-0.1.1/tests/test_histogram.py +25 -0
  83. trainedml-0.1.1/tests/test_knn.py +30 -0
  84. trainedml-0.1.1/tests/test_line.py +25 -0
  85. trainedml-0.1.1/tests/test_logistic.py +30 -0
  86. trainedml-0.1.1/tests/test_multicollinearity.py +27 -0
  87. trainedml-0.1.1/tests/test_normality.py +27 -0
  88. trainedml-0.1.1/tests/test_outliers.py +26 -0
  89. trainedml-0.1.1/tests/test_profiling.py +28 -0
  90. trainedml-0.1.1/tests/test_random_forest.py +30 -0
  91. trainedml-0.1.1/tests/test_regressors.py +59 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2025] [diamankayero]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ include README.md
2
+ include LICENCE
3
+ include requirements.txt
4
+ recursive-include src *.py
5
+ recursive-include tests *.py
6
+ recursive-include doc/source *.rst *.py *.css
7
+ global-exclude *.pyc
8
+ global-exclude __pycache__
9
+ prune build
10
+ prune dist
11
+ prune doc/build
12
+ prune venv
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: trainedml
3
+ Version: 0.1.1
4
+ Summary: Simple ML training framework
5
+ Author-email: diamankayero <diamanka.tck@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/diamankayero/trainedml
8
+ Project-URL: Issues, https://github.com/diamankayero/trainedml
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENCE
14
+ Requires-Dist: numpy
15
+ Requires-Dist: pandas
16
+ Requires-Dist: scikit-learn
17
+ Requires-Dist: matplotlib
18
+ Requires-Dist: seaborn
19
+ Requires-Dist: plotly
20
+ Requires-Dist: tqdm
21
+ Requires-Dist: requests
22
+ Requires-Dist: pooch
23
+ Requires-Dist: statsmodels
24
+ Requires-Dist: joblib
25
+ Requires-Dist: scipy
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: streamlit; extra == "dev"
29
+ Provides-Extra: doc
30
+ Requires-Dist: sphinx; extra == "doc"
31
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
32
+ Dynamic: license-file
33
+
34
+ # trainedml
35
+
36
+ `trainedml` est un package Python qui fournit des outils simples pour **charger des jeux de données publics**, **entraîner et comparer des modèles de machine learning**, et **visualiser les résultats** de manière intuitive.
37
+
38
+ ---
39
+
40
+ ## 📦 Installation
41
+
42
+ ### 🔹 Installation depuis **TestPyPI** (recommandé pour les tests)
43
+
44
+ ```bash
45
+ python -m pip install --index-url https://test.pypi.org/simple/ trainedml --upgrade
46
+ # oubien
47
+ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple trainedml
48
+ ```
49
+
50
+ > ⚠️ L’option `--no-deps` est nécessaire car TestPyPI ne contient pas toujours toutes les dépendances.
51
+
52
+ Si besoin, installe ensuite les dépendances séparément :
53
+
54
+ ```bash
55
+ pip install -r requirements.txt
56
+ ```
57
+
58
+ ---
59
+
60
+ ### 🔹 Installation classique (depuis les sources)
61
+
62
+ ```bash
63
+ git clone https://github.com/diamankayero/trainedml.git
64
+ cd trainedml
65
+ pip install -r requirements.txt
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 🚀 Fonctionnalités principales
71
+
72
+ * Chargement de jeux de données publics (ex : **Iris**)
73
+ * Modèles implémentés :
74
+
75
+ * KNN (classification et régression)
76
+ * Régression logistique
77
+ * Random Forest (classification et régression)
78
+ * Régression linéaire, Ridge, Lasso
79
+ * Visualisations :
80
+
81
+ * Heatmap
82
+ * Histogrammes
83
+ * Courbes
84
+ * Boxplots, bivarié, valeurs manquantes, outliers, normalité, multicolinéarité, profiling
85
+ * API simple pour :
86
+ * Exemples avancés :
87
+
88
+ * Benchmark de modèles de régression
89
+ * Analyse exploratoire complète (profiling, multicolinéarité, normalité)
90
+ * Visualisation de la distribution de la cible (régression)
91
+
92
+ * l’entraînement
93
+ * l’évaluation
94
+ * la comparaison de modèles
95
+
96
+ ---
97
+
98
+ ## 🧪 Exemple d’utilisation
99
+
100
+ ```python
101
+ from trainedml.data.loader import DataLoader
102
+ from trainedml.models.knn import KNNModel
103
+ from trainedml.visualization import Visualizer
104
+
105
+ # Chargement des données
106
+ iris = DataLoader().load_iris()
107
+
108
+ # Entraînement d'un modèle
109
+ X = iris.drop(columns=['species'])
110
+ y = iris['species']
111
+
112
+ model = KNNModel()
113
+ model.fit(X, y)
114
+
115
+ # Visualisation
116
+ viz = Visualizer(iris)
117
+ fig = viz.heatmap()
118
+ fig.show()
119
+ ```
120
+
121
+ ---
122
+
123
+ ## ✅ Tests
124
+
125
+ Pour exécuter les tests unitaires :
126
+
127
+ ```bash
128
+ python -m unittest discover tests
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 🆕 Nouveauté 2026
134
+
135
+ - Ajout du workflow GitHub Actions pour tests automatiques et publication sur TestPyPI.
136
+ - Amélioration de la documentation et de la structure du projet.
137
+
138
+ ---
139
+
140
+ ## 📌 Statut du projet
141
+
142
+ * ✔️ Version de test publiée sur **TestPyPI**
143
+ * 🔄 En développement actif
144
+ * 🚀 Publication sur PyPI prévue après validation
145
+ # trainedml_module
@@ -0,0 +1,112 @@
1
+ # trainedml
2
+
3
+ `trainedml` est un package Python qui fournit des outils simples pour **charger des jeux de données publics**, **entraîner et comparer des modèles de machine learning**, et **visualiser les résultats** de manière intuitive.
4
+
5
+ ---
6
+
7
+ ## 📦 Installation
8
+
9
+ ### 🔹 Installation depuis **TestPyPI** (recommandé pour les tests)
10
+
11
+ ```bash
12
+ python -m pip install --index-url https://test.pypi.org/simple/ trainedml --upgrade
13
+ # oubien
14
+ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple trainedml
15
+ ```
16
+
17
+ > ⚠️ L’option `--no-deps` est nécessaire car TestPyPI ne contient pas toujours toutes les dépendances.
18
+
19
+ Si besoin, installe ensuite les dépendances séparément :
20
+
21
+ ```bash
22
+ pip install -r requirements.txt
23
+ ```
24
+
25
+ ---
26
+
27
+ ### 🔹 Installation classique (depuis les sources)
28
+
29
+ ```bash
30
+ git clone https://github.com/diamankayero/trainedml.git
31
+ cd trainedml
32
+ pip install -r requirements.txt
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 🚀 Fonctionnalités principales
38
+
39
+ * Chargement de jeux de données publics (ex : **Iris**)
40
+ * Modèles implémentés :
41
+
42
+ * KNN (classification et régression)
43
+ * Régression logistique
44
+ * Random Forest (classification et régression)
45
+ * Régression linéaire, Ridge, Lasso
46
+ * Visualisations :
47
+
48
+ * Heatmap
49
+ * Histogrammes
50
+ * Courbes
51
+ * Boxplots, bivarié, valeurs manquantes, outliers, normalité, multicolinéarité, profiling
52
+ * API simple pour :
53
+ * Exemples avancés :
54
+
55
+ * Benchmark de modèles de régression
56
+ * Analyse exploratoire complète (profiling, multicolinéarité, normalité)
57
+ * Visualisation de la distribution de la cible (régression)
58
+
59
+ * l’entraînement
60
+ * l’évaluation
61
+ * la comparaison de modèles
62
+
63
+ ---
64
+
65
+ ## 🧪 Exemple d’utilisation
66
+
67
+ ```python
68
+ from trainedml.data.loader import DataLoader
69
+ from trainedml.models.knn import KNNModel
70
+ from trainedml.visualization import Visualizer
71
+
72
+ # Chargement des données
73
+ iris = DataLoader().load_iris()
74
+
75
+ # Entraînement d'un modèle
76
+ X = iris.drop(columns=['species'])
77
+ y = iris['species']
78
+
79
+ model = KNNModel()
80
+ model.fit(X, y)
81
+
82
+ # Visualisation
83
+ viz = Visualizer(iris)
84
+ fig = viz.heatmap()
85
+ fig.show()
86
+ ```
87
+
88
+ ---
89
+
90
+ ## ✅ Tests
91
+
92
+ Pour exécuter les tests unitaires :
93
+
94
+ ```bash
95
+ python -m unittest discover tests
96
+ ```
97
+
98
+ ---
99
+
100
+ ## 🆕 Nouveauté 2026
101
+
102
+ - Ajout du workflow GitHub Actions pour tests automatiques et publication sur TestPyPI.
103
+ - Amélioration de la documentation et de la structure du projet.
104
+
105
+ ---
106
+
107
+ ## 📌 Statut du projet
108
+
109
+ * ✔️ Version de test publiée sur **TestPyPI**
110
+ * 🔄 En développement actif
111
+ * 🚀 Publication sur PyPI prévue après validation
112
+ # trainedml_module
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,3 @@
1
+ a.api-link {
2
+ color: #d32f2f !important; /* rouge vif */
3
+ }
@@ -0,0 +1,40 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ project = 'trainedml'
10
+ copyright = '2025, Yéro Diamanka'
11
+ author = 'Yéro Diamanka'
12
+ release = '0.01'
13
+
14
+ # -- General configuration ---------------------------------------------------
15
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
16
+
17
+ extensions = [
18
+ 'sphinx.ext.autodoc',
19
+ 'sphinx.ext.napoleon',
20
+ ]
21
+ import os
22
+ import sys
23
+ sys.path.insert(0, os.path.abspath('../../src'))
24
+
25
+ templates_path = ['_templates']
26
+ exclude_patterns = []
27
+
28
+ language = 'fr'
29
+
30
+ # -- Options for HTML output -------------------------------------------------
31
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
32
+
33
+ html_theme = 'sphinx_rtd_theme'
34
+ html_static_path = ['_static']
35
+
36
+ # -- Extension configuration ------------------------------------------------
37
+ extensions += [
38
+ 'sphinx.ext.viewcode',
39
+ 'sphinx.ext.autosectionlabel',
40
+ ]
@@ -0,0 +1,100 @@
1
+ .. trainedml documentation master file, created by
2
+ sphinx-quickstart on Mon Dec 22 02:19:59 2025.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ trainedml
7
+ =========
8
+
9
+ .. image:: https://img.shields.io/badge/python-3.8+-blue.svg
10
+ :target: https://www.python.org/
11
+ :alt: Python Version
12
+
13
+ **trainedml** est une bibliothèque Python modulaire pour l'apprentissage automatique supervisé, conçue pour l'enseignement, la recherche et le prototypage rapide.
14
+
15
+ - Chargement flexible de jeux de données publics ou personnalisés
16
+ - Modèles classiques (Random Forest, KNN, Régression Logistique)
17
+ - Visualisations intégrées (heatmap, histogramme, courbe)
18
+ - API simple pour l'intégration web/applications
19
+ - Documentation API complète et tests unitaires
20
+
21
+ .. contents:: Sommaire
22
+ :depth: 2
23
+ :local:
24
+
25
+ Guide de démarrage rapide
26
+ =========================
27
+
28
+ .. code-block:: python
29
+
30
+ from trainedml import Trainer
31
+ trainer = Trainer(dataset="iris", model="random_forest")
32
+ trainer.fit()
33
+ print(trainer.evaluate())
34
+ y_pred = trainer.predict([[5.1, 3.5, 1.4, 0.2]])
35
+
36
+ Installation
37
+ ============
38
+
39
+ .. code-block:: bash
40
+
41
+ pip install -r requirements.txt
42
+ pip install .
43
+
44
+ Utilisation en ligne de commande
45
+ ================================
46
+
47
+ .. code-block:: bash
48
+
49
+ python -m trainedml --dataset iris --model random_forest --show
50
+
51
+
52
+ Sections de la documentation
53
+ ============================
54
+
55
+ .. toctree::
56
+ :maxdepth: 2
57
+ :caption: API
58
+
59
+ modules
60
+
61
+
62
+ Explications mathématiques des méthodes
63
+ =======================================
64
+
65
+
66
+ .. rubric:: Explications mathématiques des méthodes
67
+
68
+
69
+ .. note::
70
+ Les explications mathématiques détaillées pour chaque méthode sont disponibles dans la section API détaillée :
71
+
72
+ - :doc:`k-Nearest Neighbors (kNN) <trainedml/models/knn>`
73
+ - :doc:`Régression Logistique <trainedml/models/logistic>`
74
+ - :doc:`Random Forest <trainedml/models/random_forest>`
75
+
76
+ (voir aussi "modules" dans le menu de gauche)
77
+
78
+ .. Les blocs mathématiques sont désormais déplacés dans les pages dédiées de l'API.
79
+
80
+
81
+ FAQ
82
+ ---
83
+
84
+ **Q : Comment ajouter un nouveau dataset ?**
85
+
86
+ R : Utilisez la classe DataLoader avec l'URL de votre CSV et le nom de la colonne cible.
87
+
88
+ **Q : Puis-je utiliser mes propres modèles ?**
89
+
90
+ R : Oui, il suffit d'implémenter la classe BaseModel et de l'ajouter à MODEL_MAP.
91
+
92
+ Contribuer
93
+ ----------
94
+
95
+ Les contributions sont les bienvenues ! Merci de soumettre vos issues et pull requests sur GitHub.
96
+
97
+ Licence
98
+ -------
99
+
100
+ Ce projet est distribué sous licence MIT.
@@ -0,0 +1,27 @@
1
+ trainedml - API détaillée
2
+ =========================
3
+
4
+ .. toctree::
5
+ :maxdepth: 1
6
+
7
+ trainedml/models/knn
8
+ trainedml/models/logistic
9
+ trainedml/models/random_forest
10
+ trainedml/visualization
11
+ trainedml/analyzer
12
+ trainedml/vizs
13
+ trainedml/heatmap
14
+ trainedml/histogram
15
+ trainedml/line
16
+ trainedml/distribution
17
+ trainedml/correlation
18
+ trainedml/missing
19
+ trainedml/outliers
20
+ trainedml/target
21
+ trainedml/boxplot
22
+ trainedml/bivariate
23
+ trainedml/normality
24
+ trainedml/multicollinearity
25
+ trainedml/profiling
26
+
27
+ # Les automodule détaillés sont retirés pour éviter les doublons
@@ -0,0 +1,7 @@
1
+ DataAnalyzer
2
+ ============
3
+
4
+ .. automodule:: trainedml.analyzer
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Bivariate
2
+ =========
3
+
4
+ .. automodule:: trainedml.viz.bivariate
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Boxplot
2
+ =======
3
+
4
+ .. automodule:: trainedml.viz.boxplot
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Correlation
2
+ ===========
3
+
4
+ .. automodule:: trainedml.viz.correlation
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Distribution
2
+ ============
3
+
4
+ .. automodule:: trainedml.viz.distribution
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Heatmap
2
+ =======
3
+
4
+ .. automodule:: trainedml.viz.heatmap
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Histogram
2
+ =========
3
+
4
+ .. automodule:: trainedml.viz.histogram
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Line
2
+ ====
3
+
4
+ .. automodule:: trainedml.viz.line
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,7 @@
1
+ Missing Values
2
+ ==============
3
+
4
+ .. automodule:: trainedml.viz.missing
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,44 @@
1
+ k-Nearest Neighbors (kNN)
2
+ =========================
3
+
4
+ .. currentmodule:: trainedml.models.knn
5
+
6
+ Principe (kNN)
7
+ --------------
8
+
9
+ Le kNN est un algorithme de classification supervisée basé sur la proximité des exemples dans l’espace des caractéristiques. Pour une observation :math:`x`, on recherche les :math:`k` voisins les plus proches selon une distance (souvent euclidienne) :
10
+
11
+ .. math::
12
+ d(x, x_i) = \sqrt{\sum_{j=1}^p (x_j - x_{i,j})^2}
13
+
14
+ La classe prédite est la plus fréquente parmi les :math:`k` voisins :
15
+
16
+ .. math::
17
+ \hat{y} = \operatorname{mode}\left(\{y_i\}_{i \in V_k(x)}\right)
18
+
19
+ .. math::
20
+
21
+ V_k(x)\ \text{ est l’ensemble des } k \text{ plus proches voisins de } x.
22
+
23
+ **Avantages** : simple, non paramétrique, efficace pour les petits jeux de données.
24
+
25
+ **Limites** : sensible à l’échelle des variables, coûteux pour de grands jeux de données.
26
+
27
+ Illustration (kNN)
28
+ ------------------
29
+
30
+ .. image:: ../../_static/figures/knn.png
31
+ :alt: Schéma kNN
32
+ :width: 400px
33
+ :align: center
34
+
35
+ Exemple illustré (kNN)
36
+ ----------------------
37
+
38
+ Supposons un jeu de données avec trois points :math:`A=(1,2)`, :math:`B=(2,3)`, :math:`C=(4,2)` et une nouvelle observation :math:`X=(2,2)`. Pour :math:`k=2`, les deux plus proches voisins de :math:`X` sont :math:`A` et :math:`B`. Si :math:`A` est de classe 0 et :math:`B` de classe 1, la classe prédite sera la plus fréquente parmi ces deux voisins.
39
+
40
+ Pour aller plus loin (kNN)
41
+ --------------------------
42
+
43
+ - Documentation scikit-learn : https://scikit-learn.org/stable/modules/neighbors.html
44
+ - Cours OpenClassrooms : https://openclassrooms.com/fr/courses/4425111-initiez-vous-au-machine-learning/5028281-classifiez-avec-les-k-plus-proches-voisins-knn