Gaia
normalize.h
1 /*
2  * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Gaia
5  *
6  * Gaia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef GAIA_NORMALIZE_H
21 #define GAIA_NORMALIZE_H
22 
23 #include "analyzer.h"
24 
25 namespace gaia2 {
26 
59 class Normalize : public Analyzer {
60 
61  public:
62  Normalize(const ParameterMap& params);
63  virtual ~Normalize() {};
64 
65  Transformation analyze(const DataSet* data, const Region& region) const;
66 
67 
68  protected:
69  Real _outliers;
70 
71 
72  void getStats(const DataSet& dataset, const Region& region,
73  Point& mmin, Point& mmax,
74  Point& mean, Point& var) const;
75 
76  void getStatsWithOutliers(const DataSet& dataset, const Region& region,
77  Point& mmin, Point& mmax,
78  Point& mean, Point& var) const;
79 
80  ParameterMap getNormalizationCoeffs(const QString& descriptorName,
81  const Point& mmin, const Point& mmax,
82  const Point& mean, const Point& var) const;
83 
84 };
85 
86 } // namespace gaia2
87 
88 #endif // GAIA_NORMALIZE_H
T mean(const T *array, uint n)
Computes the mean of an array.
Definition: gaiamath.h:81
A region is a physical location in the point layout which consists in a list of segments.
Definition: region.h:125
Class containing all info pertaining to a specific transformation, ie: the name of the analyzer class...
Definition: transformation.h:41
The Normalize analyzer normalizes real descriptors.
Definition: normalize.h:59
This class represents a dataset and all related information.
Definition: dataset.h:91
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
the Analyzer abstract base class.
Definition: analyzer.h:43
Definition: parameter.h:34
Definition: point.h:106