Frequently asked questions
General
What is FST4 and what can I use it for?
FST4, the Feature Selection Toolbox 4, is a standalone C++17 library and command-line tool for feature selection: choosing, out of all the variables a data set measures, the subset a model should actually use. Use it to improve the accuracy and generalization of classifiers and regressors trained on limited data, to cut the cost of acquiring inputs (sensors, lab tests, compute), and to keep models interpretable — the selected variables remain the original measurements, unlike the mixed components of projection methods. FST4 implements the complete classical search family (optimal Branch & Bound and exhaustive search; sequential, floating, oscillating and retreating search; Monte Carlo; individual and dependency-aware ranking; a budgeted stochastic search for very high dimensionality), filter criteria and wrapper criteria around a dozen built-in classification and regression models plus bridges to your own, nested data splitting for honest estimation, and stability and overfitting diagnostics — all deterministic and reproducible across platforms. Typical uses: researchers comparing selection methods under a controlled protocol, practitioners reducing a feature set before deployment, and teaching. The introduction tells the full story; the Usage page gets you to a first result in one command.
Do I need to write C++ to use FST4?
No. Since 4.0 the fst4 command-line tool exposes the whole
toolbox — every published demo scenario is a flag set or a config file, and
results come as text, JSON or CSV (every flag is documented on the
FST4 CLI page). C++ remains available for
integrating the header-only library into your own programs; see the
API Reference.
Why FST4 rather than the feature selection in scikit-learn or Weka?
Two things, mainly. First, the search family: FST4 implements the optimal searches (exhaustive, four Branch & Bound variants) and the full floating/oscillating/retreating family (SFFS/SBFS, OS, DOS, SFRS/SBRS) — methods largely absent from mainstream ML stacks. Second, determinism as a contract: threaded runs are bit-identical to sequential at any thread count, seeded runs reproduce seed-for-seed across platforms, and every release is gated on byte-exact outputs of 112 scenarios on Windows, macOS and Linux.
May I use FST4 commercially?
Yes. FST4 is free software under the GNU Affero General Public License,
version 3, for everyone including commercial users, provided that modified
versions you distribute or make available over a network stay under the
AGPL with their complete source code. If you want FST4 inside a
closed-source product without those obligations, a commercial license from
UTIA is the other option; in case of interest, write to
utia@utia.cas.cz. The details are
in LICENSING.md in the repository.
Building
What do I need to build FST4?
A C++17 compiler and CMake 3.16+. Nothing else — the library is header-only. Boost, required by FST3, is not used at all since FST4.
Do I need LibSVM?
No. The native wrapper-linsvm and
wrapper-rbfsvm criteria cover linear and RBF-kernel SVM
selection without any external library, deterministically. LibSVM is
needed only for the LibSVM-backed wrapper-svm (used by the
FST3 parity configs and the poly/sigmoid kernels); it is not distributed
with FST4 — fetch svm.cpp/svm.h per the
instructions in the package's libsvm/readme.txt.
How do I build in Visual C++ without CMake?
Create an Empty Project, add the .hpp files as headers and
one demo .cpp (or fst4.cpp) as source, and set
the C++ language standard to C++17 or newer. No external include or
library paths are needed. For threaded code add FST_THREADED
to the preprocessor definitions; _USE_MATH_DEFINES and
_CRT_SECURE_NO_WARNINGS make the build cleaner. Details ship
in the package's README.md.
Data
What data formats does FST4 read?
TRN (the FST flat text format), ARFF (Weka; dense and sparse), and
CSV/TSV. CSV is the simplest path from Excel: delimiter and header row are
auto-detected — including European semicolon-delimited exports with
decimal commas — and the class column defaults to the last
(--csv-class overrides by index or header name). The dataset
can also arrive on standard input (--data -).
How are missing values handled?
Three ways, explicit by design: rows with missing values are skipped
loudly (the default); --csv-missing-to CODE keeps such rows
with the missing cells mapped to a numeric code (which a tree-based
wrapper can split on as a missingness indicator); and
--missing-value CODE substitutes per-feature training-part
averages for the coded cells — the classic demo62 protocol.
My data has more than two classes and the filter criteria fail. Why?
The normal-model filter criteria (Bhattacharyya, Divergence, Generalized Mahalanobis) are defined for two-class problems only — that has been true in every FST generation. On multi-class data use a wrapper criterion (kNN, logistic regression, Random Forest, LDA, SVM…) or the multinomial filters on count data. Note also that normal-model components fail loudly on constant features and on subsets larger than the sample count (singular covariance) — the error names the features responsible.
Results and reproducibility
Are selected feature indices 0-based or 1-based?
0-based, everywhere: a reported subset 3 10 16 means the
4th, 11th and 17th feature columns of your data file in file order.
Why do two runs give identical results even with --threads 8?
By design. Threaded evaluation is scheduled so that results are
bit-identical to the sequential run at any thread count — threading buys
speed, never changes the answer. Randomized components draw from a seeded
toolbox-owned generator (--seed), reproducible seed-for-seed
across Windows, macOS and Linux.
Can I reproduce published FST3 results with FST4?
Protocol-wise yes: every published FST3 demo ships as a parity config (see Demos) producing the same results through the CLI where the data is unchanged. Two data-set caveats: the FST3-era speech data left the distribution (those demos now run on WDBC), and the sonar data's class split was corrected to the official UCI one — so FST3-published numbers for the speech and sonar demos are not reproducible from the FST4 package. The original FST3 package remains available under Legacy.
Which criterion value should I trust — the one the search optimized, or the validation?
Report both, and keep them apart: the criterion value measures
optimization success on the selection data, while the independent holdout
validation estimates generalization. Complex searches can overfit the
criterion — that is precisely what the anti-overfitting demos (5x) and
--report detailed's criterion-vs-holdout curve are for.
Known problems
Anything I should watch out for?
- The Divergence criterion may breach monotonicity on some data due to numerical instability — prefer Bhattacharyya, especially under Branch & Bound.
- LibSVM training may freeze with LINEAR/SIGMOID kernels on some data.
The native
wrapper-linsvm/wrapper-rbfsvmcriteria have no such issue and need no LibSVM. - kNN's per-sample scores take only k+1 distinct values, so its AUC is a coarse estimate and its ROC/PR curves are visibly stepped — an interpretation caveat, not a defect.
Questions not covered here are welcome via Contacts.