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

scripts/plotSelectionDecision.m

View on GitHub
function Fig = plotSelectionDecision(VoteTable, NSelect, OutputDir)
%plotSelectionDecision The consensus-score elbow: THE selection decision.
%
%   Fig = plotSelectionDecision(VoteTable, NSelect, OutputDir) writes
%   fig_selection_decision.svg -- the fused consensus score of every candidate in
%   rank order, with a vertical line at the cut (NSelect). This is ONE selection on
%   the full training set: the elbow shows how cleanly the kept set separates from
%   the rest (sharp drop = clean cut; shallow = soft cut).
%
%   This is the decision itself, so it is always drawn -- even when the "would the
%   selector re-pick the same features?" stability read was skipped. The companion
%   plotSelectionStability audits this decision under resampling.
%
%   Inputs:
%     VoteTable - table(Feature, Score, Rank, Selected) from runConsensusSelection;
%                 Score drives the curve (sorted descending here defensively)
%     NSelect   - (1,1) double, the number of features the cut kept (the cut line)
%     OutputDir - (1,1) string, destination folder for the SVG
%
%   Output:
%     Fig - the figure handle (written to fig_selection_decision.svg)

% Copyright 2026 The MathWorks, Inc.

    arguments
        VoteTable table
        NSelect (1,1) double {mustBePositive}
        OutputDir (1,1) string
    end

    CutClr = [0.15 0.15 0.15];
    BlueClr = [0.20 0.50 0.80];

    Fig = figure(Name="Selection Decision", Units="centimeters", ...
        Position=[2 2 17 12], Visible="off", Color="w");
    HasKnee = paintDecision(axes(Fig, OuterPosition=[0 0.14 1 0.86]), VoteTable, ...
        NSelect, CutClr, BlueClr);
    drawCaption(Fig, HasKnee);

    exportgraphics(Fig, fullfile(OutputDir, "fig_selection_decision.svg"), ...
        ContentType="vector");
end


function HasKnee = drawElbowConstruction(ax, Scores, n, ChordClr)
%drawElbowConstruction Illustrate HOW the elbow is found: the chord between the
%   two endpoints, and the vertical drop from that chord down to the score point
%   of greatest below-chord distance. The drop is both the quantity computeNSelect
%   maximizes and what is drawn here, so metric and picture are the same thing; a
%   vertical segment also reads correctly on axes whose x and y are not equally
%   scaled, whereas a data-space perpendicular would render slanted. Only drawn
%   when a genuine convex knee exists -- a flat or concave curve has no below-chord
%   point, so there is nothing to illustrate and the lines are skipped. Returns
%   whether the construction was drawn, so the caption describes only what is on
%   the plot.
    HasKnee = false;
    if n < 3
        return;
    end
    X1 = 1; Y1 = Scores(1);
    X2 = n; Y2 = Scores(end);
    DX = X2 - X1;  DY = Y2 - Y1;
    if DX < eps
        return;
    end
    % Signed below-chord vertical drop for every point (matches computeNSelect).
    Idx = (1:n)';
    ChordY = Y1 + (Idx - X1) / DX * DY;
    Dist = ChordY - Scores;
    [MaxDist, ElbowIdx] = max(Dist);
    if MaxDist < 1e-10
        return;   % no below-chord point: linear/concave, no knee to illustrate
    end
    HasKnee = true;

    % The chord between the two endpoints.
    Chord = plot(ax, [X1 X2], [Y1 Y2], "--", Color=ChordClr, LineWidth=0.9);
    Chord.Annotation.LegendInformation.IconDisplayStyle = "off";

    % Vertical drop from the elbow point up to the chord -- the below-chord
    % distance the cut maximizes.
    Ex = ElbowIdx;  Ey = Scores(ElbowIdx);
    Cy = ChordY(ElbowIdx);           % chord height directly above the elbow point
    Drop = plot(ax, [Ex Ex], [Ey Cy], ":", Color=ChordClr, LineWidth=1.2);
    Drop.Annotation.LegendInformation.IconDisplayStyle = "off";
    Mrk = plot(ax, Ex, Ey, "o", MarkerSize=6, MarkerEdgeColor=ChordClr, ...
        MarkerFaceColor="none", LineWidth=1.1);
    Mrk.Annotation.LegendInformation.IconDisplayStyle = "off";
end


function drawCaption(Fig, HasKnee)
%drawCaption Baked-in how-to-read guide along the bottom strip. Static only --
%   run-specific reads (the actual cut, named features) stay in the report.
    if HasKnee
        ConstructionClause = " Grey lines: endpoint chord and the greatest below-chord drop (the elbow).";
    else
        ConstructionClause = "";   % linear/concave score curve: no knee was drawn
    end
    Caption = "Features by consensus rank (best at left), height = fused score. " + ...
        """cut"" = delivered set, placed at the score elbow; a sharp drop at the cut " + ...
        "indicates a well-separated set." + ConstructionClause;
    annotation(Fig, "textbox", [0.02 0.02 0.96 0.10], String=Caption, ...
        EdgeColor=[0.8 0.8 0.8], BackgroundColor=[0.97 0.97 0.97], ...
        FontSize=8, VerticalAlignment="middle", HorizontalAlignment="left", ...
        FitBoxToText="off", Interpreter="none");
end


function HasKnee = paintDecision(ax, VoteTable, NSelect, CutClr, BlueClr)
%paintDecision The consensus-score elbow with the cut. Returns whether a convex
%   knee was drawn, so the caption describes only what is on the plot.
    Scores = sort(VoteTable.Score, "descend");   % rank order, in case caller unsorted
    n = numel(Scores);
    ChordClr = [0.55 0.55 0.55];   % grey: elbow-method construction lines

    hold(ax, "on");
    % Elbow-method construction: the chord joining the two endpoints, and the
    % vertical drop from the elbow point to it -- the distance the cut maximizes.
    HasKnee = drawElbowConstruction(ax, Scores, n, ChordClr);

    plot(ax, 1:n, Scores, "-o", MarkerSize=3, LineWidth=1.1, Color=BlueClr);

    % Draw the cut line only when the elbow actually trimmed the pool. A curve
    % with no knee keeps every feature (NSelect == n), so there is no cut to mark.
    DidCut = NSelect < n;
    if DidCut
        xline(ax, NSelect + 0.5, "--", sprintf("cut = %d", NSelect), Color=CutClr, ...
            LineWidth=1.3, LabelVerticalAlignment="top", LabelHorizontalAlignment="right", ...
            Interpreter="none");
    end
    hold(ax, "off");

    xlim(ax, [1 n]);                             % start at rank 1 (touch the y-axis)
    if n <= 15
        xticks(ax, 1:n);
    end
    xlabel(ax, "Feature (consensus rank)");
    ylabel(ax, "Consensus score");
    title(ax, "Consensus Selection Decision");
    if DidCut
        subtitle(ax, "Cut Placed at the Consensus-Score Elbow");
    else
        subtitle(ax, "No Elbow — Full Pool Kept");
    end
    grid(ax, "on");
end
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: 466kUpdated Claude CodeCodexVerifiedInstall
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: 466kUpdated 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: 319kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 319kUpdated Claude CodeCodexVerifiedInstall