Feature Selection Toolbox
FST4
UTIA · Czech Academy of Sciences
Home
Introduction
Usage
FST4 CLI
Demos
API Reference
Download
History
References
Legacy
FAQ
Contacts
Toggle main menu visibility
Loading...
Searching...
No Matches
_src_criteria
model.hpp
Go to the documentation of this file.
1
#ifndef FSTMODEL_H
2
#define FSTMODEL_H
3
/*
27
=========================================================================
28
Copyright and license:
29
* FST4 software (with the exception of any bundled or externally linked
30
third-party components) is Copyright (C) 2000-present Institute of
31
Information Theory and Automation of the Czech Academy of Sciences (UTIA).
32
* FST4 is free software: you can redistribute it and/or modify it under
33
the terms of the GNU Affero General Public License as published by the
34
Free Software Foundation, version 3. The full text of the license is in
35
the file LICENSE in the distribution root and at
36
https://www.gnu.org/licenses/agpl-3.0.html.
37
* FST4 is distributed in the hope that it will be useful, but WITHOUT ANY
38
WARRANTY; without even the implied warranty of MERCHANTABILITY or
39
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
40
License for more details.
41
* Closed-source use without the AGPL's copyleft obligations requires a
42
commercial license from UTIA; in case of interest write to
43
utia@utia.cas.cz. LICENSING.md in the distribution root explains both
44
options, the contributor license agreement that every contribution
45
requires, and the contacts (technical questions and pull requests:
46
somol@utia.cas.cz, with "FST" in the subject line).
47
========================================================================== */
48
49
#include <memory>
50
#include <iostream>
51
#include "
error.hpp
"
52
#include "
global.hpp
"
53
54
/*============== Template parameter type naming conventions ==============
55
--------- Numeric types: -------------------------------------------------
56
DATATYPE - data sample values - usually real numbers (but may be integers
57
in text processing etc.)
58
REALTYPE - must be real numbers - for representing intermediate results of
59
calculations like mean, covariance etc.
60
IDXTYPE - index values for enumeration of data samples - (nonnegative) integers,
61
extent depends on numbers of samples in data
62
DIMTYPE - index values for enumeration of features (dimensions), or classes (not
63
class sizes) - (nonnegative) integers, usually lower extent than IDXTYPE,
64
but be aware of expressions like _classes*_features*_features !
65
in linearized representations of feature matrices for all classes
66
BINTYPE - feature selection marker type - represents ca. <10 different feature
67
states (selected, deselected, sel./desel. temporarily 1st nested loop, 2nd...)
68
RETURNTYPE - criterion value: real value, but may be extended in future to support
69
multiple values
70
--------- Class types: ---------------------------------------------------
71
SUBSET - class of class type Subset
72
CLASSIFIER - class implementing interface defined in abstract class Classifier
73
EVALUATOR - class implementing interface defined in abstract class Sequential_Step
74
DISTANCE - class implementing interface defined in abstract class Distance
75
DATAACCESSOR - class implementing interface defined in abstract class Data_Accessor
76
INTERVALCONTAINER - class of class type Data_Intervaller
77
CONTAINER - STL container of class type Data_Interval
78
========================================================================== */
79
80
namespace
FST
{
81
89
template
<
class
SUBSET,
class
DATAACCESSOR>
90
class
Model {
91
public
:
92
typedef
std::shared_ptr<DATAACCESSOR>
PDataAccessor
;
93
typedef
std::shared_ptr<SUBSET>
PSubset
;
94
Model() {
notify
(
"Model constructor"
);}
95
virtual
~Model
() {
notify
(
"Model destructor"
);}
101
virtual
void
learn
(
PDataAccessor
da) =0;
105
virtual
void
narrow_to
(
const
PSubset
sub) =0;
// access to data will be mapped to sub-matrix
107
virtual
void
denarrow
() =0;
// access is reset to the full matrix
108
};
109
110
}
// namespace
111
#endif
// FSTMODEL_H ///:~
FST::Model
abstract class, defines interface for data model implementations
Definition
model.hpp:90
FST::Model::denarrow
virtual void denarrow()=0
Undoes narrow_to(): model access reverts to the full dimensionality it was learned at.
FST::Model::learn
virtual void learn(PDataAccessor da)=0
Fits the model's parameters from da's training data, over all its features. Concrete models may addit...
FST::Model::PSubset
std::shared_ptr< SUBSET > PSubset
shared pointer to a feature subset, as consumed by narrow_to()
Definition
model.hpp:93
FST::Model::narrow_to
virtual void narrow_to(const PSubset sub)=0
FST::Model::PDataAccessor
std::shared_ptr< DATAACCESSOR > PDataAccessor
shared pointer to the data accessor supplying training data
Definition
model.hpp:92
error.hpp
FST4 specific error passing class.
global.hpp
Global definitions.
FST
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition
data_accessor.hpp:80
FST::notify
void notify(const std::string msg)
Prints msg followed by a newline via syncout::print(); a no-op unless the preprocessor macro DEBUG is...
Definition
global.hpp:112
Generated by
1.17.0