Shark machine learning library
About Shark
News!
Contribute
Credits and copyright
Downloads
Getting Started
Installation
Using the docs
Documentation
Tutorials
Quick references
Class list
Global functions
FAQ
Showroom
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
* <http://shark-ml.org/>
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
class
NormalizeComponentsWhitening
:
public
AbstractUnsupervisedTrainer
<LinearModel<RealVector> >
52
{
53
public
:
54
SHARK_EXPORT_SYMBOL
NormalizeComponentsWhitening
(
double
targetVariance = 1.0);
55
56
/// \brief From INameable: return the class name.
57
SHARK_EXPORT_SYMBOL
std::string
name
()
const
;
58
59
SHARK_EXPORT_SYMBOL
void
train
(
ModelType
& model,
UnlabeledData<RealVector>
const
& input);
60
61
private
:
62
double
m_targetVariance;
63
};
64
65
66
}
67
#endif