Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches
FST4 Documentation

This is Doxygen-generated documentation of the C++ Feature Selection Toolbox 4 library. The library implements several cutting edge feature selection methods as well as feature selection criteria + supporting data modeling tools and classifiers

The library makes extensive use of templates. It is header-only and depends only on the C++17 standard library (unlike FST3, no Boost is needed). The toolbox functionality is also available without C++ coding through the fst4 command-line tool — see the fst4 CLI flag reference (shipped in the distribution as doc/FST4_CLI.md). The compiled demo programs, shown with their sources cross-referenced to the classes they use, are collected under Examples.

This is the documentation of library version 4.2.0.


Data format(s)
Since FST3 version 3.0.1 the ARFF format (format of Weka machine learning library) is supported.

FST4 adds delimited text (CSV/TSV, the simplest spreadsheet-export path), read by the fst4 tool with --format csv (inferred from a .csv/.tsv name): the delimiter (comma, semicolon or tab) and a header row are detected automatically, decimal commas are accepted whenever the delimiter is not the comma, and the class label is taken from the last column unless --csv-class names another column (by 0-based index or header name). Rows with missing values are skipped unless --csv-missing-to maps the missing cells to a numeric code. See the fst4 CLI reference for the flags and the class FST::Data_File_CSV for the parsing rules.

The original FST3 data file format has been TRN. TRN is a trivial textual format, where the class-ordered collection of vectors of C-style numerical values separated by whitespace is preceded by a simple textual header. The data section (everything after header) may not contain anything else than N white-space-separated numerical values, where N=D*(S1+S2+...+Sc) for D-dimensional data representing c-classes of sizes S1,...,Sc. An example of a TRN file is shown below.

    ##datafile 
    ##title Medical data 
    ; 2-class 33-dimensional data representing tissue samples 
    ; 128 samples of benign tissue, 222 samples of malignant tissue 
    ##features       33 
    ##classes        2       128,222 
    ##data 
    13.54  14.36  87.46  566.3  0.09779  0.08129 
    0.06664  0.04781  0.1885  0.05766  0.2699  0.7886 
    2.058  23.56  0.008462  0.0146  0.02387  0.01315 
    . 
    . 

All keywords must be placed at the beginning of lines. The first line must contain the ##datafile keyword. The ##title line is optional. The ##features and ##classes lines are mandatory. The ##features keyword must be followed by a value depicting the number of features, separated by whitespace. The ##classes keyword must be followed by a value depicting the number of classes, then by whitespace, and then by a series of class sizes separated by commas. The ";" character at the beginning of a line depicts comment. Comments may appear anywhere inside header, but not after the header. No keywords, comments or special characters may occur after the ##data keyword, which depicts the start of the actual data.
Compiling FST4
FST4 requires a C++17 conforming compiler and has no required external library dependencies (LibSVM is optional and needed for the wrapper-svm criterion only; Eigen is optional and used for cross-validating the linear-algebra core; CLI11 is bundled and used by the fst4 command-line tool only). Build with CMake: cmake -S . -B build-mac -DCMAKE_BUILD_TYPE=Release then cmake --build build-mac --parallel (use build-win / build-linux as the build-tree name on Windows / Linux, by convention); executables are placed in build-mac/bin (etc). For Visual C++ manual project setup and further details see README.md in the distribution root.

General FST4 template parameter naming conventions:

Basic numeric types: (these are template parameters – the library never fixes them; the concrete type given with each name is the one the fst4 tool and the demos instantiate it with, a sound default for new applications)

IDXTYPE
index values for enumeration of data samples - (nonnegative) integers, extent depends on numbers of samples in data; concrete type: unsigned int
DIMTYPE
index values for enumeration of features (dimensions), or classes (not class sizes) - (nonnegative) integers, usually lower extent than IDXTYPE, but be aware of expressions like _classes*_features*_features ! (should be able to address linearized representations of feature matrices for all classes); concrete type: unsigned int
BINTYPE
feature selection marker type - should allow representing ca. <10 different feature states (selected, deselected, selected/deselected temporarily 1st nested loop, 2nd nested loop...); concrete type: short
REALTYPE
must be real numbers - for representing intermediate results of calculations like mean, covariance etc.; concrete type: double
DATATYPE

data sample values - usually real numbers, but may be integers in text processing etc.; concrete type: double

RETURNTYPE
criterion value: real numerical value, but may be extended in future to support multiple values; concrete type: double

Class types:

SUBSET
class of class type Subset
CLASSIFIER
class implementing interface defined in abstract class Classifier
EVALUATOR
class implementing interface defined in abstract class Sequential_Step
DISTANCE
class implementing interface defined in abstract class Distance
DATAACCESSOR
class implementing interface defined in abstract class Data_Accessor
INTERVALCONTAINER
class of class type Data_Intervaller
CONTAINER
STL container of class type Data_Interval

Citing FST4:

If FST4 contributes to your research, please cite the toolbox paper: Petr Somol and Pavel Pudil, Feature Selection Toolbox, Pattern Recognition 35(12):2749-2759, 2002.
The budgeted stochastic (sampled) sequential search (Sequential_Step_Sampled) is described in: Petr Somol and Jiri Grim, Stochastic Sequential Search in Very-High-Dimensional Feature Selection, arXiv:2608.01502, 2026.

Maintainer:

Dept. of Pattern Recognition
UTIA, Institute of Information Theory and Automation
Pod vodarenskou vezi 4
18208 Praha 8
Czech Republic
(see Contacts at https://fst.utia.cz)

Authorship:

FST4 builds on the human-written FST3 codebase. Version 4 was developed by Petr Somol with Anthropic Claude models as coding assistants: Claude Fable 5 for most of the 2026 development (with minor contributions by Claude Opus 5), Claude Fable 5.1 for the full-codebase reviews before publication, and Claude Opus 4.5 for the December 2025 audit of the FST3 codebase. Design, decisions, review and the acceptance of every change are human work.

Copyright and license:

Copyright © 2000–present Institute of Information Theory and Automation of the Czech Academy of Sciences (UTIA), Prague.
FST4 is dual-licensed: it is free software under the GNU Affero General Public License, version 3 (the full text ships as LICENSE), and closed-source use without the AGPL's copyleft obligations requires a commercial license from UTIA. LICENSING.md in the distribution root explains both options and the contributor license agreement that every contribution requires. In case of interest in a commercial license, or with any licensing question, write to utia@.nosp@m.utia.nosp@m..cas..nosp@m.cz; technical questions and pull requests go to somol.nosp@m.@uti.nosp@m.a.cas.nosp@m..cz (please put "FST" in the subject line).

Copyright © 2000–present ÚTIA, Institute of Information Theory and Automation of the Czech Academy of Sciences · Contacts · This site sets no cookies and uses no analytics.