Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/ai-and-statistics/matlab-engineer-tabular-features

matlab-engineer-tabular-features

Unverified

Use when engineering or selecting the best features for single-response classification or regression in MATLAB, whatever the data's modality — for non-tabular data it routes extraction to a domain skill, then selects, assesses, and delivers on the resulting table. Not for multi-response problems, model training, or raw data acquisition.

FileKindSize
SKILL.mdskill md18.9 KB
manifest.yamlconfig570 B
references/assess.mdmarkdown16.7 KB
references/deliver.mdmarkdown13.0 KB
references/domain-routing.mdmarkdown18.1 KB
references/feature-pool.mdmarkdown10.9 KB
references/intake.mdmarkdown16.9 KB
references/internal-helpers.mdmarkdown12.2 KB
references/provider-protocol.mdmarkdown12.3 KB
references/report.mdmarkdown9.7 KB
references/reproduce-pool.mdmarkdown7.1 KB
references/select.mdmarkdown7.1 KB
scripts/BordaVoter.mother2.3 KB
scripts/ConsensusVoter.mother2.5 KB
scripts/MajorityVoter.mother2.0 KB
scripts/RRFVoter.mother1.9 KB
scripts/assessGenerationStability.mother11.9 KB
scripts/assessKFold.mother20.6 KB
scripts/assessSelectionStability.mother9.8 KB
scripts/baselineComparison.mother18.9 KB
scripts/buildRecipe.mother8.2 KB
scripts/chooseNumBins.mother5.0 KB
scripts/chooseStandardization.mother4.5 KB
scripts/computeNSelect.mother2.9 KB
scripts/createConsensusVoter.mother2.2 KB
scripts/describeFeatures.mother5.1 KB
scripts/expandBlockMap.pbinary440 B
scripts/featureSetQuality.mother12.3 KB
scripts/generateFeatureReport.mother67.2 KB
scripts/generateFeatureReportPdf.mother64.9 KB
scripts/generateFeatures.mother14.6 KB
scripts/hasReportGenerator.mother630 B
scripts/isDomainRecipe.mother1.4 KB
scripts/isStringEmpty.mother577 B
scripts/lambdaSequence.pbinary637 B
scripts/lassoFeatureRanking.pbinary971 B
scripts/macroF1Score.mother931 B
scripts/mrmrFeatureRanking.pbinary239 B
scripts/mutualInformationPanel.pbinary1.1 KB
scripts/ncaFeatureRanking.pbinary464 B
scripts/nogueiraStability.mother3.8 KB
scripts/oobFeatureRanking.pbinary414 B
scripts/plotSelectionConsensus.mother2.7 KB
scripts/plotSelectionDecision.mother6.3 KB
scripts/plotSelectionStability.mother10.2 KB
scripts/plotValidationBaseline.mother6.1 KB
scripts/printSummary.mother18.3 KB
scripts/profileForSplit.mother6.2 KB
scripts/rankAgreement.mother1.3 KB
scripts/rankFeatures.mother6.2 KB
scripts/reserveHoldoutForUser.mother5.5 KB
scripts/runConsensusSelection.mother9.4 KB
scripts/sampleSkewness.mother600 B
scripts/saveResults.mother2.1 KB
scripts/scoreFeaturePanel.pbinary1.6 KB
scripts/screenPredictors.mother13.3 KB
scripts/selectFeatures.mother2.3 KB
scripts/splitStrategy.mother5.4 KB
scripts/stratifiedDownsampleRows.mother2.2 KB
scripts/stratifiedSubsampleIndices.mother3.4 KB
scripts/transformFeatures.mother6.1 KB
scripts/validateRecipe.mother12.3 KB
scripts/writeInferenceScript.mother10.5 KB

references/select.md

View on GitHub
# Select — consensus ranking of the feature pool

Selection is this skill's distinctive value. Rather than trusting one selector
(which is what `gencfeatures`/`genrfeatures` do internally, tied to a single
learner), it runs a **panel of complementary rankers**, fuses their verdicts by a
data-driven **consensus voter**, and cuts at the score elbow. One call does all of
it: `runConsensusSelection`.

Selection **evaluates** the pool; it does not necessarily shrink it. A broad
`gencfeatures` pool is almost always cut substantially; a compact domain-extracted
pool may pass through largely intact. Report the outcome, never assume a
reduction (see [feature-pool.md](feature-pool.md)).

Selection runs on the **training rows only** — the pool table fit on the split
from [`splitStrategy`](intake.md). The held-out test rows never enter ranking.

---

## The call

```matlab
[SelectedNames, VoteTable, PanelInfo] = runConsensusSelection( ...
    FullEng(TrainIdx, :), Response, ProblemType, ...
    ExcludeFeatures = GenInfo.BinaryReliant, ...   % [] unless a dummy binarization ran
    TargetModel = TargetModel);                    % gates the ranker panel
```

- **`FullEng(TrainIdx,:)`** — the engineered pool + response, **train slice only**
  (the canonical `FullEng` spans all rows; ranking sees only the training rows).
  The full mixed pool is ranked; numeric and categorical engineered features share
  one column universe, so the fused vote is well defined.
- **`Response`, `ProblemType`** — carried from profiling.
- **`ExcludeFeatures`** — names to drop *before* ranking. Pass
  `GenInfo.BinaryReliant`: the Weight-of-Evidence columns from a multi-class
  dummy binarization are meaningless once the real response is restored, so they
  must never be ranked or selected. Empty otherwise.
- **`TargetModel`** — the declared model family, carried from intake. It gates
  which embedded ranker probes run (see step 1). `agnostic` (the default) keeps the
  full panel; a declared family narrows the panel to that family's probe plus the
  two model-agnostic rankers.

---

## What it does, in order

1. **Rank with a diverse panel** (`scoreFeaturePanel`) — up to five rankers: the
   four `genfeatures`-utility forks (MRMR, OOB permutation, NCA, LASSO) plus
   chi-square / F-test. Every ranker is aligned to the shared feature universe and
   is skipped on error rather than aborting the panel (skips are reported in
   `PanelInfo.Skipped`). **The `TargetModel` family gates which of the three
   embedded probes run**, mirroring how `gencfeatures`/`genrfeatures` tie their own
   embedded selector to the target learner: `linear`→LASSO, `tree_ensemble`→OOB,
   `kernel_distance`→NCA. A declared family runs *only* its probe plus the two
   model-agnostic rankers (MRMR + the univariate filter) — three methods, still a
   real consensus vote. `agnostic` (the default) keeps all five, since no single
   learner is targeted and ranker diversity is the whole point. **One exception:**
   LASSO ranks binary classification and regression only, so a `linear` family on a
   *multiclass* response has no usable probe and reverts to the full five-method
   panel. `PanelInfo.PanelMode` records the choice (`"full"` or `"family:<name>"`).
2. **Pick the voter by agreement** — by default (`VoterMethod="auto"`) mean
   pairwise Spearman ρ across the panel's rankings chooses the fusion rule:
   **ρ ≥ 0.7 → Borda** (positional, rewards consistent placement); **ρ < 0.7 →
   Reciprocal Rank Fusion** (robust when rankers disagree, emphasizes each
   method's top picks). Override with `VoterMethod="borda"`/`"rrf"`/`"majority"`
   to force a rule. Reach for **`"majority"`** (order-blind top-K vote) only when
   you trust *which* features each ranker picked but not the *order* — e.g. a
   tie-heavy significance filter whose ranking is noise near a p-value floor. The
   agreement gate measures whether orderings correlate, not whether they are
   meaningful, so it can never select majority for you; it is an expert opt-in and
   the report labels it as a user override.
3. **Cut at the score elbow** (`computeNSelect`) — the elbow is the point of
   maximum **below-chord** distance on the sorted consensus scores; a convex curve
   cuts at its knee, a linear or concave decline has none so all candidates are
   kept. The elbow alone sets the count: there is no per-N wrapper search — cutting
   the fused score vector *is* the elbow.

---

## Outputs

| Output | What it is |
|---|---|
| `SelectedNames` | `(1,:) string` — the delivered feature names, consensus order |
| `VoteTable` | `table(Feature, Score, Rank, Selected)` in consensus order — the per-feature record for the report's vote-table chapter |
| `PanelInfo` | struct: `.Rankers`, `.Skipped`, `.PanelMode` (`"full"`/`"family:<name>"`), `.VoterMethod` (`"borda"`/`"rrf"`/`"majority"`), `.VoterSelectedBy` (`"auto"`/`"user"`), `.MeanAgreement`, `.NSelect`, `.PoolSize`, `.Excluded`, `.PredVars`, `.RankMatrix`, `.Reasoning` |

Announce the outcome from `PanelInfo.Reasoning` (it states the ranker set, voter,
mean ρ, and `NSelect of p`), and state the selected count and names in the
user-facing message.

The consensus heatmap reads its per-method ranks straight off `PanelInfo` — no
re-ranking. Draw it **only when the report is on** (`GenerateReport`); a report
opt-out skips it (the consensus decision is still reported in words either way):

```matlab
if GenerateReport
    % Pass the FULL matrix; plotSelectionConsensus orders rows best-consensus-first,
    % caps at max(35, NSelect) so no shipped feature is hidden, and names any omitted
    % count in its subtitle. RankMatrix rows align to PanelInfo.PredVars.
    plotSelectionConsensus( ...
        PanelInfo.RankMatrix, ...       % (features x methods) ranks
        PanelInfo.PredVars(:), ...      % (features x 1) row labels
        PanelInfo.Rankers, ...          % (1 x methods) column labels
        OutputDir, NSelect = PanelInfo.NSelect);
end
```

---

## Errors and edge cases

- **`runConsensusSelection:responseNotFound`** — `Response` is not a column of
  the passed pool table.
- **`runConsensusSelection:tooFewFeatures`** — fewer than 2 candidate features
  remain after exclusions. A pool that small cannot be ranked; if it came from a
  "skip" generation (originals passed through, no engineered features), there is
  nothing for consensus to do — deliver the originals and say so.
- **Selection keeps everything** — a legitimate outcome for a compact pool. The
  bound clamps to `p` and the elbow may sit at the end. Do not describe this as a
  failure to select.

---

## Handing off

After selection the orchestrator holds `SelectedNames` (the delivered set),
`VoteTable`, and `PanelInfo`, alongside the pool `Recipe`. Assessment
([assess.md](assess.md)) grades both the pipeline and this selection decision;
delivery ([deliver.md](deliver.md)) reproduces `SelectedNames` on new data via the
recipe.

---

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
[www.mathworks.com/trademarks](https://www.mathworks.com/trademarks) for a list
of additional trademarks.

----

Copyright 2026 The MathWorks, Inc.

----
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 468kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 321kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 321kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 321kUpdated Claude CodeCodexVerifiedInstall