Internals of the fst4 command-line tool: its type aliases, the option record, the run pipeline with its result types, the CLI-specific observers and adapters, and the output emitters.
More...
|
|
typedef double | RETURNTYPE |
| | criterion/classifier/regressor return value type used throughout the CLI
|
|
typedef double | DATATYPE |
| | raw sample value type read from the data file
|
|
typedef double | REALTYPE |
| | intermediate real-valued computation type (always real, never integral)
|
|
typedef unsigned int | IDXTYPE |
| | sample (row) index type
|
|
typedef unsigned int | DIMTYPE |
| | feature (dimension) index type
|
|
typedef short | BINTYPE |
| | per-feature membership flag type backing SUBSET
|
|
typedef FST::Subset< BINTYPE, DIMTYPE > | SUBSET |
| | the concrete feature-subset type instantiated across the whole CLI
|
|
typedef FST::Data_Intervaller< std::vector< FST::Data_Interval< IDXTYPE > >, IDXTYPE > | INTERVALLER |
| | concrete split-interval representation shared by every splitter
|
|
typedef std::shared_ptr< FST::Data_Splitter< INTERVALLER, IDXTYPE > > | PSPLITTER |
| | shared pointer to the abstract Data_Splitter base, holding whichever concrete splitter --splitter/--splitter2 selects at runtime
|
|
typedef FST::Data_Accessor< DATATYPE, IDXTYPE > | DATAACCESSOR |
| | abstract data-access seam: the base every format accessor (and the --features data-free universe accessor) implements
|
|
typedef FST::Criterion< RETURNTYPE, SUBSET > | CRITERION |
| | abstract criterion seam: the base every --criterion implementation and internal adapter implements
|
|
typedef FST::Classifier< RETURNTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CLASSIFIER |
| | abstract classifier seam: the base every --validate classifier and wrapper-* criterion's inner classifier implements
|
|
typedef FST::Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | EVALUATOR |
| | abstract sequential-step seam: the base every --evaluator implementation implements
|
|
typedef FST::Search< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | SEARCH |
| | abstract search seam: the base every --search algorithm implements
|
|
typedef FST::Data_Accessor_Splitting_Mem< DATATYPE, IDXTYPE, INTERVALLER > | ACCESSOR_MEM |
| | shared concrete-side base: initialize(), setSplittingDepth()
|
|
typedef FST::Data_Accessor_Splitting_MemTRN< DATATYPE, IDXTYPE, INTERVALLER > | ACCESSOR_TRN |
| | TRN-format data accessor (--format trn).
|
|
typedef FST::Data_Accessor_Splitting_MemARFF< DATATYPE, IDXTYPE, INTERVALLER > | ACCESSOR_ARFF |
| | ARFF-format (Weka) data accessor (--format arff).
|
|
typedef FST::Data_Accessor_Splitting_MemCSV< DATATYPE, IDXTYPE, INTERVALLER > | ACCESSOR_CSV |
| | CSV/TSV-format data accessor (--format csv).
|
|
typedef FST::Data_Accessor_Universe< DATATYPE, IDXTYPE, INTERVALLER > | ACCESSOR_UNIVERSE |
| | --features N: data-free set-function entry
|
|
typedef FST::Data_Splitter_5050< INTERVALLER, IDXTYPE > | SPLITTER5050 |
| | 1st half train, 2nd half test, deterministic (--splitter/--splitter2 5050, the default)
|
|
typedef FST::Data_Splitter_CV< INTERVALLER, IDXTYPE > | SPLITTERCV |
| | k-fold cross-validation splitter (--splitter/--splitter2 cv; --cv-folds/--splitter2-cv-folds)
|
|
typedef FST::Data_Splitter_Holdout< INTERVALLER, IDXTYPE > | SPLITTERHOLDOUT |
| | percentage holdout splitter: first x% train, rest test (--splitter/--splitter2 holdout; --holdout-train/--splitter2-holdout-train)
|
|
typedef FST::Data_Splitter_Resub< INTERVALLER, IDXTYPE > | SPLITTERRESUB |
| | resubstitution splitter: train = test = all data (--splitter/--splitter2 resub)
|
|
typedef FST::Data_Splitter_RandomRandom< INTERVALLER, IDXTYPE, BINTYPE > | SPLITTERRR |
| | randrand splitter: independent random train/test percentages each split, disjoint, multi-split capable (--splitter/--splitter2 randrand)
|
|
typedef FST::Data_Splitter_TrainRandom_TestFixed< INTERVALLER, IDXTYPE, BINTYPE > | SPLITTERRANDFIX |
| | randfix splitter: like randrand but with a fixed test part reused across splits (--splitter/--splitter2 randfix)
|
|
typedef FST::Data_Splitter_Leave1Out< INTERVALLER, IDXTYPE > | SPLITTERL1O |
| | leave-one-out splitter, intended as the inner --splitter2 (--splitter/--splitter2 leave1out)
|
|
typedef FST::Criterion_Normal_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CRIT_BHAT |
| | bhattacharyya: normal-model filter, monotonic (B&B-compatible), two-class data only
|
|
typedef FST::Criterion_Normal_Divergence< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CRIT_DIV |
| | divergence: normal-model filter, monotonic in theory but numerically unstable – prefer bhattacharyya; two-class only
|
|
typedef FST::Criterion_Normal_GMahalanobis< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CRIT_GMAHA |
| | gmahalanobis: normal-model filter (generalized Mahalanobis distance), monotonic, two-class only
|
|
typedef FST::Distance_Euclid< DATATYPE, DIMTYPE, SUBSET > | DIST_L2 |
| | Euclidean (L2) distance, the kNN default (--knn-distance L2).
|
|
typedef FST::Distance_L1< DATATYPE, DIMTYPE, SUBSET > | DIST_L1 |
| | L1 (Manhattan) distance (--knn-distance L1).
|
|
typedef FST::Distance_Lp< DATATYPE, REALTYPE, DIMTYPE, SUBSET, 3, 2 > | DIST_LP |
| | p=3/2, as used by demo40-43 (compile-time menu, see file header) (--knn-distance Lp)
|
|
typedef FST::Classifier_kNN< RETURNTYPE, DATATYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR, DIST_L2 > | KNN_L2 |
| | kNN classifier/wrapper-knn criterion using the L2 distance (--knn-distance L2, default)
|
|
typedef FST::Classifier_kNN< RETURNTYPE, DATATYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR, DIST_L1 > | KNN_L1 |
| | kNN classifier/wrapper-knn criterion using the L1 distance (--knn-distance L1)
|
|
typedef FST::Classifier_kNN< RETURNTYPE, DATATYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR, DIST_LP > | KNN_LP |
| | kNN classifier/wrapper-knn criterion using the Lp distance (--knn-distance Lp)
|
|
typedef FST::Classifier_Normal_Bayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | BAYES |
| | normal Bayes classifier (wrapper-bayes)
|
|
typedef FST::Classifier_Multinomial_NaiveBayes< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | MULTINOM_NB |
| | multinomial naive-Bayes classifier, count/text data (wrapper-multinom)
|
|
typedef FST::Classifier_Logistic_Regression< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | LOGREG |
| | multinomial logistic regression classifier: deterministic damped-Newton training on internally standardized data (wrapper-logreg)
|
|
typedef FST::Classifier_Random_Forest< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | RF |
| | dependency-free Random Forest classifier: CART/Gini trees, bagging, sqrt-mtry node subsampling (wrapper-rf)
|
|
typedef FST::Classifier_Linear_SVM< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | LINSVM |
| | dependency-free linear SVM classifier: L2-regularized dual coordinate descent, no LibSVM needed (wrapper-linsvm)
|
|
typedef FST::Classifier_RBF_SVM< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | RBFSVM |
| | dependency-free RBF-kernel SVM classifier: kernel dual coordinate descent, no LibSVM needed (wrapper-rbfsvm)
|
|
typedef FST::Classifier_LDA< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | LDA |
| | shared-covariance linear discriminant classifier, parameterless and deterministic (wrapper-lda)
|
|
typedef FST::Classifier_Extern< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | EXTERN |
| | external-classifier bridge over a persistent-process line protocol (wrapper-extern; --extern-cmd)
|
|
typedef FST::Criterion_Extern_Value< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CRIT_EXTVAL |
| | the external VALUE-mode criterion: the external tool returns the criterion value itself (extern-value; --extern-cmd)
|
|
typedef FST::Criterion_Multinomial_Bhattacharyya< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CRIT_MBHAT |
| | multinom-bhattacharyya: multinomial-model filter, monotonic, count/text data
|
|
typedef FST::Criterion_Multinomial_MI< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | CRIT_MMI |
| | multinom-mi: multinomial individual mutual-information ranking criterion; subset value = sum of per-feature MI (monotonic, NOT a joint measure; intended for --search bif)
|
|
typedef FST::Classifier_LIBSVM< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | SVM |
| | LibSVM-backed classifier (wrapper-svm; requires LibSVM, fetched separately per libsvm/readme.txt – only built when FST_SVM is defined).
|
|
typedef FST::Criterion_Wrapper< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR > | CRIT_WRAPPER |
| | the generic wrapper criterion: estimates a CLASSIFIER's accuracy/metric as the criterion value (instantiates every classification wrapper-* criterion)
|
|
typedef FST::Regressor< RETURNTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | REGRESSOR |
| | abstract regressor seam, separate from CLASSIFIER: the base wrapper-regressor/wrapper-ridge implement
|
|
typedef FST::Regressor_Weighted_Neighbours< RETURNTYPE, DATATYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR, DIST_L2 > | RWN |
| | weighted-neighbours kNN regressor; dependent variable = the class label, "regression simulating classification" (wrapper-regressor, demo11reg protocol)
|
|
typedef FST::Regressor_Ridge< RETURNTYPE, DATATYPE, REALTYPE, IDXTYPE, DIMTYPE, SUBSET, DATAACCESSOR > | RIDGE |
| | closed-form ridge regressor: Cholesky-solved L2-regularized least squares (wrapper-ridge)
|
|
typedef FST::Criterion_Wrapper< RETURNTYPE, SUBSET, REGRESSOR, DATAACCESSOR > | CRIT_WRAPPER_REG |
| | the generic wrapper criterion instantiated over REGRESSOR: estimates a regressor's metric as the criterion value (wrapper-regressor/wrapper-ridge)
|
|
typedef FST::Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | EVAL_SEQ |
| | the default (straight) sequential step: plain in-line candidate evaluation (--evaluator straight)
|
|
typedef FST::Sequential_Step_Hybrid< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, CRITERION > | EVAL_HYBRID |
| | the hybrid sequential step: --hybrid-prefilter pre-orders candidates, only the top --hybrid-keep-perc% reach the main criterion (--evaluator hybrid, demo53); prefilter bound to the abstract base too
|
|
typedef FST::Sequential_Step_Ensemble< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | EVAL_ENSEMBLE |
| | the ensemble sequential step: kNN wrappers at the --ensemble-knn-ks values vote on candidate ranking (--evaluator ensemble, demo50)
|
|
typedef FST::Result_Weighter_Sampled< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > | WEIGHTER_SAMPLED |
| | online per-feature statistics engine feeding the sampled (budgeted stochastic) sequential step
|
|
typedef FST::Sequential_Step_Sampled< RETURNTYPE, DIMTYPE, SUBSET, CRITERION, WEIGHTER_SAMPLED > | EVAL_SAMPLED |
| | the sampled sequential step: budgeted stochastic candidate proposals driven by WEIGHTER_SAMPLED's online per-feature statistics (--evaluator sampled, EXPERIMENTAL)
|
|
typedef FST::Criterion_Wrapper_Bias_Estimate< RETURNTYPE, SUBSET, CLASSIFIER, DATAACCESSOR > | CRIT_BIAS |
| | the bias-estimate wrapper criterion decorator: estimates the wrapped classifier's train-vs-test optimism on the selected subset (--bias-estimate, demo56)
|
|
typedef FST::Candidate_Evaluator< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | ENGINE |
| | the candidate-evaluation engine seam (in-line sequential or thread-pooled), injected into searches and step evaluators
|
|
typedef std::shared_ptr< ENGINE > | PENGINE |
| | shared pointer to ENGINE
|
|
typedef FST::Branch_And_Bound_Predictor_Averaging< RETURNTYPE, DIMTYPE > | BBPREDICTOR |
| | averaging predictor used by the FBB/BBPP Branch & Bound variants (bb-fast/bb-bbpp) to decide predict-vs-compute per candidate
|
|
typedef FST::Result_Tracker_Dupless< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > | TRACKER |
| | the default (dupless) result tracker: best-k distinct subsets, feeds the top_k output block (--tracker dupless)
|
|
typedef FST::Result_Tracker_Regularizer< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET, CRITERION > | TRACKER_REG |
| | the regularizer result tracker: records candidates for the --regularize-by/--regularize-margins post-search sweep (--tracker regularizer)
|
|
typedef FST::Result_Tracker_Stability_Evaluator< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > | TRACKER_STABIL |
| | the stability-evaluator result tracker: per-trial stability statistics, requires --repeat-over-splits (--tracker stabileval)
|
|
typedef FST::Result_Tracker_Feature_Stats< RETURNTYPE, IDXTYPE, DIMTYPE, SUBSET > | TRACKER_STATS |
| | the feature-stats result tracker: probe statistics behind --daf-rank/--daf-pairs (--tracker feature-stats)
|
|
typedef FST::Criterion_Subset_Size< RETURNTYPE, SUBSET > | CRIT_SUBSIZE |
| | adapter criterion returning the evaluated subset's size; wrapped in CRIT_NEG to build the --regularize-by subsetsize secondary criterion (maximizing -size prefers smaller subsets)
|
|
typedef FST::Criterion_Sum_Of_Weights< RETURNTYPE, DIMTYPE, SUBSET > | CRIT_SUMW |
| | adapter criterion returning the sum of the selected features' --feature-costs; wrapped in CRIT_NEG to build the --regularize-by weights secondary criterion (maximizing -cost prefers cheaper subsets)
|
|
typedef FST::Criterion_Negative< CRITERION, RETURNTYPE, SUBSET > | CRIT_NEG |
| | decorator criterion returning the negative of an inner criterion's value; used to turn CRIT_SUBSIZE/CRIT_SUMW's minimization goals into the maximization the regularizer sweep expects
|
|
|
static std::shared_ptr< FST::Search_Observer< RETURNTYPE, SUBSET > > | make_observer (const Config &cfg, std::ostream &progress) |
| | builds the --progress observer; empty pointer = default text delivery (the library's own progress text)
|
|
static std::vector< std::string > | split_csv (const std::string &s) |
| | splits a comma-separated flag value into tokens; empty fields are kept and an empty input yields one empty token
|
|
static std::vector< double > | split_csv_doubles (const std::string &s, const std::string &flag) |
| | splits a comma-separated flag value into doubles, reporting the offending flag on parse failure
|
| static FST::Metric_Spec< RETURNTYPE > | make_metric_spec (const Config &cfg, const DIMTYPE classes) |
| static std::vector< DIMTYPE > | subset_features (const std::shared_ptr< SUBSET > &sub) |
| static std::string | fmt_double (const double v) |
| static std::string | json_escape (const std::string &s) |
| static std::string | infer_format (const std::string &path) |
| static std::shared_ptr< FST::Data_Scaler< DATATYPE > > | make_scaler (const Config &cfg) |
|
static PSPLITTER | make_splitter_named (const std::string &name, const bool inner, const Config &cfg) |
| | constructs the splitter for one splitting depth; inner=true selects the --splitter2-* parameter set
|
| static std::shared_ptr< ACCESSOR_MEM > | make_accessor (const Config &cfg, const std::string &format) |
| static std::shared_ptr< CLASSIFIER > | make_knn (const Config &cfg, const unsigned int k) |
|
static std::shared_ptr< CRITERION > | make_filter (const std::string &name, const std::shared_ptr< DATAACCESSOR > &da) |
| | constructs an initialize()d filter criterion by name (hybrid-evaluator prefilter)
|
| static std::shared_ptr< CLASSIFIER > | make_classifier (const std::string &name, const Config &cfg, const std::shared_ptr< DATAACCESSOR > &da, Pipeline *pipe=0) |
| template<class CRIT_T> |
| static std::shared_ptr< CRITERION > | setup_filter_criterion (const std::shared_ptr< DATAACCESSOR > &da, std::function< bool(RETURNTYPE &, const std::shared_ptr< SUBSET > &)> &split_eval, std::function< void()> &crit_reinit) |
| static std::shared_ptr< CRITERION > | make_criterion (const Config &cfg, Pipeline &p) |
| static PENGINE | make_engine (const Config &cfg, Pipeline &p) |
| static std::shared_ptr< EVALUATOR > | make_evaluator (const Config &cfg, Pipeline &p, const int eval_depth) |
| static void | make_tracker (const Config &cfg, Pipeline &p) |
| static bool | extract_curves (std::vector< std::pair< RETURNTYPE, DIMTYPE > > &sc, std::vector< RunResult::CurvePoint > &roc, std::vector< RunResult::CurvePoint > &pr) |
| static void | extract_classifier_curves (const std::shared_ptr< CLASSIFIER > &vc, const std::shared_ptr< DATAACCESSOR > &da, std::vector< RunResult::ClassCurve > &curves) |
| static void | write_scores_dump (const std::string &path, const std::shared_ptr< CLASSIFIER > &vc, const std::shared_ptr< DATAACCESSOR > &da, const std::string &label, const std::vector< DIMTYPE > &features) |
| static std::vector< RunResult::ValidationEntry > | run_validation (const Config &cfg, Pipeline &p, const std::shared_ptr< SUBSET > &sub, RunResult *detail=nullptr, const bool is_final=false) |
| static std::shared_ptr< SEARCH > | make_search (const Config &cfg, Pipeline &p, const std::shared_ptr< EVALUATOR > &eval) |
| static std::string | list_constant_features (const std::shared_ptr< DATAACCESSOR > &da) |
| static FST::OutputDetail | parse_verbosity (const std::string &v) |
| static void | emit_invocation_json (std::ostream &os, const Config &cfg, const std::string &format) |
| template<typename T> |
| static void | emit_array (std::ostream &os, const std::vector< T > &v) |
|
static void | emit_double_array (std::ostream &os, const std::vector< RETURNTYPE > &v) |
| | writes a JSON array of v's elements, each formatted through fmt_double()
|
| static void | emit_validation_json (std::ostream &os, const RunResult::ValidationEntry &e) |
|
static void | emit_json (std::ostream &os, const Config &cfg, const std::string &format, const Pipeline &p, const RunResult &r, const CompareResult *cmp=nullptr) |
| | Writes the complete --output json result: version, invocation echo, data summary, and every RunResult block that applies (validation, curve_over_d, curves, tuned parameters, trials, stability, top_k, regularization, DAF blocks, multiplier sweep, --compare-config, and the wall-time/evaluations stats block unless --stable-output). Called with the real, un-redirected stdout stream – with --output json this is the ONLY thing fst4 writes to stdout; all search/library prose goes to stderr (or is swallowed under --verbosity silent).
|
|
static void | emit_csv (std::ostream &os, const Config &cfg, const RunResult &r, const CompareResult *cmp=nullptr) |
| | Writes the complete --output csv result: one long-format table, header "kind,rank,value,size,features", one row kind per RunResult block (result, top_k, per_split, validation, curve_over_d[validation], roc, pr, confusion, tuned, bias, classified, trial, stability, regularization[_validation], daf, daf_pair, daf_validation, multiplier_sweep[_validation], best_multiplier, and the b* / similarity rows under --compare-config), plus a trailing stats row unless --stable-output. Same real-stdout contract as emit_json(): with --output csv this is the only stdout content.
|
| static void | emit_text (std::ostream &os, const Config &cfg, const std::string &format, const Pipeline &p, const RunResult &r, const CompareResult *cmp=nullptr) |
|
static std::string | svg_num (double v) |
| | fixed-precision coordinate formatter — keeps the SVG byte-stable across runs
|
|
static std::string | svg_tick (const double v) |
| | short axis-tick formatter (4 significant digits is plenty for a tick label)
|
|
static std::string | svg_escape (const std::string &s) |
| | XML-escapes text destined for an SVG <text> element (classifier names come from --validate).
|
| static bool | write_curves_svg (const std::string &path, const RunResult &r) |
|
static void | print_components (std::ostream &os) |
| | --list: the component registry with one-line descriptions and validity notes
|
|
static void | add_options (CLI::App &app, Config &cfg) |
| | Registers every fst4 CLI option/flag on app, binding each directly into a field of cfg (CLI11's add_option()/add_flag() write straight into the referenced variable on parse). Factored out of main() so that --compare-config can parse a second Config through an identical option set (the demo55 cross-scenario similarity protocol) – see parse_compare_config(). The third argument of each add_option()/add_flag() call is that option's authoritative help text (also what --help prints), so option semantics are best read there rather than duplicated in comments here.
|
| static Config | parse_compare_config (const std::string &path) |
Internals of the fst4 command-line tool: its type aliases, the option record, the run pipeline with its result types, the CLI-specific observers and adapters, and the output emitters.
Nothing in here is library API – the library is namespace FST, which the tool uses through explicit qualification. The namespace keeps the tool's own types visibly apart from the library's, in the reference documentation as much as for the compiler; main() alone stays at global scope and imports this namespace.