Shark machine learning library
Installation
Tutorials
Benchmarks
Documentation
Quick references
Class list
Global functions
include
shark
Algorithms
Trainers
NormalizeComponentsWhitening.h
Go to the documentation of this file.
1
//===========================================================================
2
/*!
3
*
4
*
5
* \brief Data normalization to zero mean, unit variance and zero covariance
6
*
7
*
8
*
9
*
10
* \author T. Glasmachers,O.Krause
11
* \date 2016
12
*
13
*
14
* \par Copyright 1995-2017 Shark Development Team
15
*
16
* <BR><HR>
17
* This file is part of Shark.
18
* <https://shark-ml.github.io/Shark/>
19
*
20
* Shark is free software: you can redistribute it and/or modify
21
* it under the terms of the GNU Lesser General Public License as published
22
* by the Free Software Foundation, either version 3 of the License, or
23
* (at your option) any later version.
24
*
25
* Shark is distributed in the hope that it will be useful,
26
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
* GNU Lesser General Public License for more details.
29
*
30
* You should have received a copy of the GNU Lesser General Public License
31
* along with Shark. If not, see <http://www.gnu.org/licenses/>.
32
*
33
*/
34
//===========================================================================
35
36
37
#ifndef SHARK_ALGORITHMS_TRAINERS_NORMALIZECOMPONENTSWHITENING_H
38
#define SHARK_ALGORITHMS_TRAINERS_NORMALIZECOMPONENTSWHITENING_H
39
40
#include <
shark/Core/DLLSupport.h
>
41
#include <
shark/Models/LinearModel.h
>
42
#include <
shark/Algorithms/Trainers/AbstractTrainer.h
>
43
44
namespace
shark
{
45
46
47
/// \brief Train a linear model to whiten the data.
48
///
49
/// computes a linear model that normlizes the data to be 0 mean, a given target variance and covariance 0.
50
/// By default the trainer makes the data unit variance, but the target variance can be changed as well.
51
/// \ingroup unsupervised_trainer
52
class
NormalizeComponentsWhitening
:
public
AbstractUnsupervisedTrainer
<LinearModel<RealVector> >
53
{
54
public
:
55
SHARK_EXPORT_SYMBOL
NormalizeComponentsWhitening
(
double
targetVariance = 1.0);
56
57
/// \brief From INameable: return the class name.
58
SHARK_EXPORT_SYMBOL
std::string
name
()
const
;
59
60
SHARK_EXPORT_SYMBOL
void
train
(
ModelType
& model,
UnlabeledData<RealVector>
const
& input);
61
62
private
:
63
double
m_targetVariance;
64
};
65
66
67
}
68
#endif