Skip to content

Commit

Permalink
Update ExpertMixture_doc.i.in
Browse files Browse the repository at this point in the history
Fixes wrong use of parentheses.
Use mathematical notations.
The mixture is a function: there is no need to convert it.
  • Loading branch information
mbaudin47 committed May 14, 2024
1 parent 0bd8313 commit 5d7e455
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions python/src/ExpertMixture_doc.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
"Expert mixture defining a piecewise function according to a classifier.

This implements an expert mixture which is a piecewise function :math:`f`
defined by the collection of functions :math:`(f_i)_{i=1, \ldots, N}` given in
defined by the collection of functions :math:`(f_i)_{i=1, \ldots, n_c}` given in
*basis* and according to a *classifier*:

.. math::

f(\vect{x}) &= f_1(\vect{x}) \hspace{1em} \forall \vect{z} \in \text{Class} 1 \\
&= f_k(\vect{x}) \hspace{1em} \forall \vect{z} \in \text{Class} k \\
&= f_N(\vect{x}) \hspace{1em} \forall \vect{z} \in \text{Class} N

where the :math:`N` classes are defined by the classifier.
f(\vect{x}) = f_i(\vect{x})

if :math:`\vect{z} \in \text{Class}_i` where the :math:`n_c \in \Nset` classes are defined by the classifier.

In supervised mode the classifier partitions the input and output space at once:

Expand All @@ -33,7 +31,7 @@ classifier : :class:`~openturns.Classifier`
A classifier
supervised : bool (default=True)
In supervised mode, the classifier partitions the space
of :math:`(\vect(x), f(\vect(x)))` whereas in non-supervised mode the
of :math:`(\vect{x}, f(\vect{x}))` whereas in non-supervised mode the
classifier only partitions the input space.

Examples
Expand All @@ -49,11 +47,10 @@ Examples
>>> f1 = ot.SymbolicFunction(['x'], ['-x'])
>>> f2 = ot.SymbolicFunction(['x'], ['x'])
>>> experts = [f1, f2]
>>> evaluation = ot.ExpertMixture(experts, classifier)
>>> moe = ot.Function(evaluation)
>>> print(moe([-0.3]))
>>> mixtureOfExperts = ot.ExpertMixture(experts, classifier)
>>> print(mixtureOfExperts([-0.3]))
[0.3]
>>> print(moe([0.1]))
>>> print(mixtureOfExperts([0.1]))
[0.1]

Notes
Expand All @@ -72,7 +69,7 @@ Classifier, MixtureClassifier"
Returns
-------
basis : collection of :class:`~openturns.Function`
The collection of functions :math:`(f_i)_{i=1, \ldots, N}`."
The collection of functions :math:`(f_i)_{i=1, \ldots, n_c}`."

// ---------------------------------------------------------------------

Expand All @@ -82,7 +79,7 @@ basis : collection of :class:`~openturns.Function`
Parameters
----------
basis : :class:`~openturns.Basis`
The collection of functions :math:`(f_i)_{i=1, \ldots, N}`."
The collection of functions :math:`(f_i)_{i=1, \ldots, n_c}`."

// ---------------------------------------------------------------------

Expand Down

0 comments on commit 5d7e455

Please sign in to comment.