Skip to content

Commit be4c5ab

Browse files
committed
documentation
1 parent a67a2f0 commit be4c5ab

19 files changed

+181
-94
lines changed

_doc/api/batch.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
mlinsights.mlbatch
2+
==================
13

2-
Speed up batch training
3-
=======================
4+
This was written for older version of scikit-learn and never
5+
revisited since. It may not bring much value.
46

57
MLCache
68
+++++++

_doc/api/blaslapack.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11

2-
Blas & Lapack
3-
=============
2+
mlinsights.mlmodel.direct_blas_lapack
3+
=====================================
44

5-
.. contents::
6-
:local:
5+
A simple try to call scipy blas and lapack function from cython.
76

87
Lapack
98
++++++

_doc/api/helpers.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11

2-
Helpers
3-
=======
4-
5-
.. contents::
6-
:local:
2+
mlinsights.helpers
3+
==================
74

85
Formatting
96
++++++++++

_doc/api/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ API
1010
metrics
1111
batch
1212
mlmodel
13+
mlmodel_tree
14+
mlmodel_api
1315
tree
1416
search_rank
1517
blaslapack

_doc/api/metrics.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
metrics
3-
=======
1+
mlinsights.metrics
2+
==================
43

54
.. autofunction:: mlinsights.metrics.correlations.non_linear_correlations

_doc/api/mlmodel.rst

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
=======================
2-
Machine Learning Models
3-
=======================
4-
5-
.. contents::
6-
:local:
1+
==================
2+
mlinsights.mlmodel
3+
==================
74

85
Helpers
96
=======
@@ -67,12 +64,6 @@ PiecewiseRegressor
6764
.. autoclass:: mlinsights.mlmodel.piecewise_estimator.PiecewiseRegressor
6865
:members:
6966

70-
PiecewiseTreeRegressor
71-
++++++++++++++++++++++
72-
73-
.. autoclass:: mlinsights.mlmodel.piecewise_tree_regression.PiecewiseTreeRegressor
74-
:members:
75-
7667
QuantileMLPRegressor
7768
++++++++++++++++++++
7869

@@ -160,57 +151,9 @@ TraceableTfidfVectorizer
160151
.. autoclass:: mlinsights.mlmodel.sklearn_text.TraceableTfidfVectorizer
161152
:members:
162153

163-
Exploration
164-
===========
165-
166-
The following implementation play with :epkg:`scikit-learn`
167-
API, it overwrites the code handling parameters.
168-
169-
SkBaseTransformLearner
170-
++++++++++++++++++++++
171-
172-
.. autoclass:: mlinsights.sklapi.sklearn_base_transform_learner.SkBaseTransformLearner
173-
:members:
174-
175-
SkBaseTransformStacking
176-
+++++++++++++++++++++++
177-
178-
.. autoclass:: mlinsights.sklapi.sklearn_base_transform_stacking.SkBaseTransformStacking
179-
:members:
180-
181154
Exploration in C
182155
================
183156

184-
The following classes require :epkg:`scikit-learn` *>= 1.3.0*,
185-
otherwise, they do not get compiled.
186-
187-
SimpleRegressorCriterion
188-
++++++++++++++++++++++++
189-
190-
.. autoclass:: mlinsights.mlmodel.piecewise_tree_regression_criterion.SimpleRegressorCriterion
191-
:members:
192-
193-
SimpleRegressorCriterionFast
194-
++++++++++++++++++++++++++++
195-
196-
A similar design but a much faster implementation close to what
197-
:epkg:`scikit-learn` implements.
198-
199-
.. autoclass:: mlinsights.mlmodel.piecewise_tree_regression_criterion_fast.SimpleRegressorCriterionFast
200-
:members:
201-
202-
LinearRegressorCriterion
203-
++++++++++++++++++++++++
204-
205-
The next one implements a criterion which optimizes the mean square error
206-
assuming the points falling into one node of the tree are approximated by
207-
a line. The mean square error is the error made with a linear regressor
208-
and not a constant anymore. The documentation will be completed later.
209-
210-
`mlinsights.mlmodel.piecewise_tree_regression_criterion_linear.LinearRegressorCriterion`
211-
212-
`mlinsights.mlmodel.piecewise_tree_regression_criterion_linear_fast.SimpleRegressorCriterionFast`
213-
214157
Losses
215158
++++++
216159

_doc/api/mlmodel_tree.rst

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
==========================
2+
mlinsights.mlmodel (trees)
3+
==========================
4+
5+
.. _blog-internal-api-impurity-improvement:
6+
7+
Note about potentiel issues
8+
===========================
9+
10+
The main estimator `PiecewiseTreeRegressor` is based on the implementation
11+
on new criterion. It relies on a non-public API and as such is more likely
12+
to break. The unit test are unstable. They work when *scikit-learn*
13+
and this package are compiled with the same set of tools. If installed
14+
from PyPi, you can check which versions were used at compilation time.
15+
16+
.. runpython::
17+
:showcode:
18+
19+
from mlinsights._config import (
20+
CYTHON_VERSION,
21+
NUMPY_VERSION,
22+
SCIPY_VERSION,
23+
SKLEARN_VERSION,
24+
)
25+
print(f"CYTHON_VERSION: {CYTHON_VERSION}")
26+
print(f"NUMPY_VERSION: {NUMPY_VERSION}")
27+
print(f"SCIPY_VERSION: {SCIPY_VERSION}")
28+
print(f"SKLEARN_VERSION: {SKLEARN_VERSION}")
29+
30+
31+
The signature of method *impurity_improvement* has changed in version 0.24.
32+
That's usually easy to handle two versions of *scikit-learn* even overloaded
33+
in a class except that method is implemented in cython.
34+
The method must be overloaded the same way with the same signature.
35+
Tricks such as `*args` or `**kwargs` cannot be used.
36+
The way it was handled is implemented in
37+
PR `88 <https://github.com/sdpython/mlinsights/pull/88>`_.
38+
39+
Estimators
40+
==========
41+
42+
PiecewiseTreeRegressor
43+
++++++++++++++++++++++
44+
45+
.. autoclass:: mlinsights.mlmodel.piecewise_tree_regression.PiecewiseTreeRegressor
46+
:members:
47+
48+
Criterions
49+
==========
50+
51+
The following classes require :epkg:`scikit-learn` *>= 1.3.0*,
52+
otherwise, they do not get compiled.
53+
54+
SimpleRegressorCriterion
55+
++++++++++++++++++++++++
56+
57+
.. autoclass:: mlinsights.mlmodel.piecewise_tree_regression_criterion.SimpleRegressorCriterion
58+
:members:
59+
60+
SimpleRegressorCriterionFast
61+
++++++++++++++++++++++++++++
62+
63+
A similar design but a much faster implementation close to what
64+
:epkg:`scikit-learn` implements.
65+
66+
.. autoclass:: mlinsights.mlmodel.piecewise_tree_regression_criterion_fast.SimpleRegressorCriterionFast
67+
:members:
68+
69+
LinearRegressorCriterion
70+
++++++++++++++++++++++++
71+
72+
The next one implements a criterion which optimizes the mean square error
73+
assuming the points falling into one node of the tree are approximated by
74+
a line. The mean square error is the error made with a linear regressor
75+
and not a constant anymore. The documentation will be completed later.
76+
77+
`mlinsights.mlmodel.piecewise_tree_regression_criterion_linear.LinearRegressorCriterion`
78+
79+
`mlinsights.mlmodel.piecewise_tree_regression_criterion_linear_fast.SimpleRegressorCriterionFast`

_doc/api/plotting.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
2-
plotting
3-
========
1+
mlinsights.plotting
2+
===================
43

54
.. autofunction:: mlinsights.plotting.gallery.plot_gallery_images
65

_doc/api/search_rank.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
2-
search_rank
3-
===========
1+
mlinsights.search_rank
2+
======================
43

54
SearchEngineVectors
65
+++++++++++++++++++

_doc/api/sklapi.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
=================
2+
mlinsights.sklapi
3+
=================
4+
5+
The following implementation play with :epkg:`scikit-learn`
6+
API, it overwrites the code handling parameters. It is pretty much
7+
useless unless to check the stability of the API.
8+
9+
SkBase
10+
++++++
11+
12+
.. autoclass:: mlinsights.sklapi.sklearn_base.SkBase
13+
:members:
14+
15+
SkBaseClassifier
16+
++++++++++++++++
17+
18+
.. autoclass:: mlinsights.sklapi.sklearn_base_classifier.SkBaseClassifier
19+
:members:
20+
21+
SkException
22+
+++++++++++
23+
24+
.. autoclass:: mlinsights.sklapi.sklearn_parameters.SkException
25+
:members:
26+
27+
SkBaseLearner
28+
+++++++++++++
29+
30+
.. autoclass:: mlinsights.sklapi.sklearn_base_learner.SkBaseLearner
31+
:members:
32+
33+
SkLearnParameters
34+
+++++++++++++++++
35+
36+
.. autoclass:: mlinsights.sklapi.sklearn_parameters.SkLearnParameters
37+
:members:
38+
39+
SkBaseRegressor
40+
+++++++++++++++
41+
42+
.. autoclass:: mlinsights.sklapi.sklearn_base_regressor.SkBaseRegressor
43+
:members:
44+
45+
SkBaseTransform
46+
+++++++++++++++
47+
48+
.. autoclass:: mlinsights.sklapi.sklearn_base_transform.SkBaseTransform
49+
:members:
50+
51+
SkBaseTransformLearner
52+
++++++++++++++++++++++
53+
54+
.. autoclass:: mlinsights.sklapi.sklearn_base_transform_learner.SkBaseTransformLearner
55+
:members:
56+
57+
SkBaseTransformStacking
58+
+++++++++++++++++++++++
59+
60+
.. autoclass:: mlinsights.sklapi.sklearn_base_transform_stacking.SkBaseTransformStacking
61+
:members:

0 commit comments

Comments
 (0)