You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`fit`](@ref)|Fit a machine learning model with training data |
16
-
|[`predict`](@ref)|Given a fitted model, preidct labels, probabilities or scoring functions on test data |
17
-
|[`crval`](@ref)|Perform a cross-validation and store accuracies, error losses, confusion matrices, the results of a statistical test and other informations|
18
-
|[`cvSetup`](@ref)|Generate indexes for performing cross-validtions |
15
+
|[`fit`](@ref)|fit a machine learning model with training data |
16
+
|[`predict`](@ref)|given a fitted model, predict labels, probabilities or scoring functions on test data |
17
+
|[`crval`](@ref)|perform a cross-validation and store accuracies, error losses, confusion matrices, the results of a statistical test and other informations|
18
+
|[`cvSetup`](@ref)|generate indexes for performing cross-validtions |
Copy file name to clipboardExpand all lines: docs/src/tutorial.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,7 @@ it does not matter if they act directly on the manifold of positive definite mat
16
16
It also features
17
17
18
18
-**Pre-conditining pipelines**, which can drastically reduce the execution time
19
-
-**Adaptation** techniques, which, besides being very useful in cross-session and cross-subject settings,
20
-
are instrumental for implementing on-line modes of operation.
19
+
-**Adaptation** techniques, which, besides being very useful in cross-session and cross-subject settings, are instrumental for implementing on-line modes of operation.
21
20
22
21
Note that models acting on the tangent space can take as input Euclidean feature vectors instead of positive definite matrices, thus they can be used in many more situations.
23
22
@@ -138,12 +137,13 @@ See [`CVres`](@ref) for details on the fields of cross-validation objects.
138
137
139
138
Let's see how to adapt a pre-conditioning pipeline. Suppose you have data from two
140
139
sessions or two subjects, `s1` and `s2`.
141
-
We want to use `s1` to train a machine learning model on the tanget space and `s2` to test it.
142
-
A pipeline is fitted sor`s1` and we want this pipeline to adapt to `s2` for testing.
140
+
We want to use `s1` to train a machine learning model on the tangent space and `s2` to test it.
141
+
A pipeline is fitted on`s1` and we want this pipeline to adapt to `s2` for testing.
143
142
If the pipeline includes a recentering pre-conditioner, we need to make sure that
144
-
the dimensionality reduction determined on `s2` is that same as in `s1.
143
+
the dimensionality reduction determined on `s2` is the same as in `s1`.
145
144
146
145
**Get data**
146
+
147
147
Let us get some simulated data.
148
148
We generate random data and labels for session (or subject) 1 and 2.
The **elastic net logistic regression (ENLR)** classifier is an example of classifier acting on the tangent space. Besides the **metric**(see above) used to compute a base-point for projecting the data onto the tangent space, it has a parameter **alpha** and an hyperparameter **lambda**. The **alpha** parameter allows to trade off between a pure **ridge** LR model (``α=0``) and a pure **lasso** LR model (``α=1``), which is the default. Given an alpha value, the model is fitted with a number of values for the ``λ`` (regularization) hyperparameter. Thus, differently from the previous example, tuning the ``λ`` hyperparameter is necessary.
187
+
The **elastic net logistic regression (ENLR)** classifier is an example of classifier acting on the tangent space. Besides the **metric** used to compute a base-point for projecting the data onto the tangent space, it has a parameter **alpha** and an hyperparameter **lambda**. The **alpha** parameter allows to trade off between a pure **ridge** LR model (``α=0``) and a pure **lasso** LR model (``α=1``), which is the default. Given an alpha value, the model is fitted with a number of values for the ``λ`` (regularization) hyperparameter. Thus, differently from the previous example, tuning the ``λ`` hyperparameter is necessary.
188
188
189
189
Also, keep in mind
190
190
that the [`fit`](@ref) and [`predict`](@ref) methods for ENLR models accept optional keyword arguments that are specific to this model.
@@ -339,11 +339,12 @@ This last command can be invoked repeatedly.
339
339
340
340
First, let's see how to adapt the base point for projecting the data onto
341
341
the tangent space. Suppose you have data from two sessions or two subjects, `s1` and `s2`.
342
-
We want to use `s1` to train a machine learning model on the tanget space and `s2` to test it,
342
+
We want to use `s1` to train a machine learning model on the tangent space and `s2` to test it,
343
343
however, the barycenter `s1` cannot be assumed equal to the barycenter of `s2`.
344
344
The barycenter determines the base point, therefore, we adapt it.
345
345
346
346
**Get data**
347
+
347
348
Let us get some simulated data.
348
349
We generate random data and labels for session (or subject) 1 and 2.
349
350
@@ -373,7 +374,7 @@ with dimensionality reduction. While adapting the pipeline to `s2`,
373
374
we need to make sure that the matrices in `s2` are reduced to the same
374
375
dimension as the matrices in `s1`, otherwise the
375
376
machine learning model we fit on `s1` cannot operate
376
-
on `s2`. For this, we need to set the `eVar` argmument of the [`Recenter`]
377
+
on `s2`. For this, we need to set the `eVar` argmument of the [`Recenter`](@ref)
377
378
pre-conditioner to a integer matching the reduced dimension of `s1`.
378
379
Note that the adaptation may not work well if the class proportions
379
380
is different in `s1` and `s2`.
@@ -435,7 +436,7 @@ By default, a C-Support Vector Classification model is fitted:
435
436
m1 =fit(SVM(), PTr, yTr; w=:b)
436
437
```
437
438
438
-
Notice that as for the example above with for ENLR model, we have requested to compute a balanced mean for projecting the matrices in `PTr` onto the tangent space.
439
+
Notice that, as for the example above with for ENLR model, we have requested to compute a balanced mean for projecting the matrices in `PTr` onto the tangent space.
439
440
440
441
In order to fit a Nu-Support Vector Classification model:
0 commit comments