-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSOM.h
More file actions
107 lines (101 loc) · 3.45 KB
/
SOM.h
File metadata and controls
107 lines (101 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
///////////////////////////////////////////////////////////
// SOM.h
// Implementation of the Class SOM
// Created on: 07-Lie-2013 20:07:32
// Original author: Povilas
///////////////////////////////////////////////////////////
/*! \file SOM class
\brief A class of methods and attributes for SOM algorithm.
*/
#if !defined(SOM_H)
#define SOM_H
#include "ObjectMatrix.h"
#include "DimReductionMethod.h"
class SOM : public DimReductionMethod
{
public:
/*! \fn SOM();
* \brief A default constructor.
*/
SOM();
/*! \fn virtual ~SOM();
* \brief A destructor.
*/
virtual ~SOM();
/*! \fn SOM(int rows, int columns, int eHat);
* \brief An overloaded constructor that accepts: number of rows, number of columns and hat value.
* \param int rows - number of som rows
* \param int columns - number of som columns
* \param int eHat - learning epoch
*/
SOM(int rows, int columns, int eHat);
/*! \fn SOM(int rows, int columns, int eHat);
* \brief An overloaded constructor that accepts: number of rows, number of columns and hat value.
* \param int rows - number of som rows
* \param int columns - number of som columns
* \param int eHat - learning epoch
* \param int retWinners - if called SOMMDS then winners aree returned
*/
SOM(int rows, int columns, int eHat, bool retWinners);
/*
* An overloaded constructor that accepts: number of rows, number of columns, hat value and initial matrix.
*/
/*! \fn SOM(int rows, int columns, int eHat, ObjectMatrix X);
* \brief An overloaded constructor that accepts: number of rows, number of columns, hat value and object matrix.
* \param int rows - number of som rows
* \param int columns - number of som columns
* \param int eHat - learning epoch
* \param ObjectMatrix - initial matrix for SOM
*/
SOM(int rows, int columns, int eHat, ObjectMatrix X);
/*! \fn double getQuantizationError();
* \brief Returns the quantization error.
* \return error - the quantization error.
*/
double getQuantizationError();
/*! \fn double getStress();
* \brief Returns the quantization error.
* \return error - the quantization error.
*/
double getStress();
/*! \fn virtual ObjectMatrix getProjection();
* \brief Returns the projection matrix \a Y of matrix \a X.
* \return Y - the projection matrix.
*/
virtual ObjectMatrix getProjection();
private:
/*! \fn double Max(double number1, double number2);
* \brief Returns the bigger number.
* \param number1 - The first number.
* \param number2 - The second number.
* \return max
*/
double Max(double number1, double number2);
/*! \fn ObjectMatrix Different(ObjectMatrix matrix);
* \brief Returns different DataObjects from the ObjectMatrix.
* \param matrix - The ObjectMatrix
* \return uniqeMatrix - The ObjectMatrix with unique DataObjects.
*/
ObjectMatrix Different(ObjectMatrix matrix);
/*!
* Number of object features i.e. equals to object columns (k_y)
*/
int k_y;
/*!
* Number of learning epoch
*/
int eHat;
/*!
* Neuron winner matrix
*/
ObjectMatrix nWinner;
/*!
* Number or rows is equal to number of ObjectMatrix rows (k_x)
*/
int k_x;
/*!
* If initial matrix with classes or winners mus be returned
*/
bool returnWinners;
};
#endif // !defined(SOM_H)