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/plotValidationBaseline.m

View on GitHub
function Fig = plotValidationBaseline(Panel, MetricName, OutputDir, Options)
%plotValidationBaseline Grouped bar chart of the naive/original/engineered baseline.
%
%   Fig = plotValidationBaseline(Panel, MetricName, OutputDir) draws one bar group
%   per model family, each group showing the naive, original, and engineered score.
%   A single-family panel is one group (the declared-model case); an agnostic panel
%   is three groups (bag/linear/kernel) so the families are compared at a glance.
%
%   Panel is a struct array, one element per family, with fields:
%     .Family      - (1,1) string display label for the group (e.g. "Random Forest")
%     .Naive       - naive score, either a scalar bar height OR a meanStd struct
%                    (.Mean is the height, .Std the error-bar half-width)
%     .Original    - original-feature score, same shape (NaN/NaN if no originals)
%     .Engineered  - engineered-feature score, same shape
%     .NaiveStd / .OriginalStd / .EngineeredStd - (1,1) double, OPTIONAL explicit
%                    error-bar half-widths, used only when the measure above is a
%                    plain scalar (a meanStd measure carries its own .Std).
%
%   This accepts both native panels with no adapter: baselineComparison's holdout
%   .Panel (scalar measures, no std) draws plain point estimates with no caps;
%   assessKFold's .Performance.Panel (meanStd measures) draws mean +/- std with
%   error caps. Error bars appear whenever any resolved std > 0 -- so holdout stays
%   cap-free, cross_validated gets caps (pair it with a "mean +/- std" Subtitle).
%   When every family's Original is NaN (no original features) the Original series
%   is dropped so the chart shows naive vs. engineered only.

% Copyright 2026 The MathWorks, Inc.

    arguments
        Panel (1,:) struct
        MetricName (1,1) string
        OutputDir (1,1) string
        Options.Subtitle (1,1) string = ""
    end

    NumFamilies = numel(Panel);
    Labels = arrayfun(@(p) string(p.Family), Panel);
    % Each measure may be a scalar (holdout) or a meanStd struct (cross_validated);
    % resolveMeasure returns the bar height and, when present, its own std.
    [Naive, NaiveOwnStd] = resolveMeasure(Panel, "Naive");
    [Original, OriginalOwnStd] = resolveMeasure(Panel, "Original");
    [Engineered, EngineeredOwnStd] = resolveMeasure(Panel, "Engineered");
    % A meanStd measure carries its own std; a scalar measure may instead pair with
    % an explicit .<Measure>Std sidecar field. Prefer the measure's own std.
    NaiveStd = coalesceStd(NaiveOwnStd, stdOrZero(Panel, "NaiveStd"));
    OriginalStd = coalesceStd(OriginalOwnStd, stdOrZero(Panel, "OriginalStd"));
    EngineeredStd = coalesceStd(EngineeredOwnStd, stdOrZero(Panel, "EngineeredStd"));

    HasOriginal = ~all(isnan(Original));

    % Assemble the grouped series: rows = families, columns = measures.
    if HasOriginal
        SeriesNames = ["Naive", "Original", "Engineered"];
        Heights = [Naive(:), Original(:), Engineered(:)];
        Errors = [NaiveStd(:), OriginalStd(:), EngineeredStd(:)];
        Colors = [0.7 0.7 0.7; 0.8 0.4 0.2; 0.2 0.5 0.8];
    else
        SeriesNames = ["Naive", "Engineered"];
        Heights = [Naive(:), Engineered(:)];
        Errors = [NaiveStd(:), EngineeredStd(:)];
        Colors = [0.7 0.7 0.7; 0.2 0.5 0.8];
    end

    Fig = figure(Name="Baseline Comparison", Units="centimeters", ...
        Position=[2 2 17 10], Visible="off");
    Cats = categorical(Labels, Labels);
    b = bar(Cats, Heights);
    for s = 1:numel(SeriesNames)
        b(s).FaceColor = Colors(s, :);
    end

    % Error caps, aligned to each series' bar centers, drawn only where std > 0.
    if any(Errors(:) > 0)
        hold on;
        for s = 1:numel(SeriesNames)
            XCenters = seriesXCenters(b(s), NumFamilies);
            errorbar(XCenters, Heights(:, s), Errors(:, s), ...
                'k.', LineWidth=1.1, CapSize=7);
        end
        hold off;
    end

    ylabel(MetricName);
    title(sprintf('Baseline Comparison — %s', MetricName));
    if strlength(Options.Subtitle) > 0
        subtitle(Options.Subtitle);
    end
    legend(SeriesNames, Location="southoutside", Orientation="horizontal");
    grid on;
    exportgraphics(Fig, fullfile(OutputDir, "fig_validation_baseline.svg"), ContentType="vector");
end


function [Heights, Stds] = resolveMeasure(Panel, FieldName)
%resolveMeasure Per-family bar height and own std for one measure field.
%   The field is either a plain scalar score (holdout) or a meanStd struct with
%   .Mean/.Std (cross_validated). Returns the height row and a std row (NaN where
%   the measure is a scalar, so a sidecar std can supply it instead).
    N = numel(Panel);
    Heights = zeros(1, N);
    Stds = nan(1, N);
    for i = 1:N
        M = Panel(i).(FieldName);
        if isstruct(M)
            Heights(i) = double(getMean(M));
            Stds(i) = double(getStd(M));
        else
            Heights(i) = double(M);
        end
    end
end


function Val = getMean(M)
    if isfield(M, "Mean"), Val = M.Mean; else, Val = NaN; end
end


function Val = getStd(M)
    if isfield(M, "Std"), Val = M.Std; else, Val = NaN; end
end


function Out = coalesceStd(OwnStd, SidecarStd)
%coalesceStd Prefer a measure's own std; fall back to the sidecar; 0 if neither.
    Out = OwnStd;
    Use = isnan(Out);
    Out(Use) = SidecarStd(Use);
    Out(isnan(Out)) = 0;
end


function V = stdOrZero(Panel, FieldName)
%stdOrZero Pull an optional per-family std field, defaulting missing/NaN to 0.
    V = zeros(1, numel(Panel));
    for i = 1:numel(Panel)
        if isfield(Panel, FieldName) && ~isempty(Panel(i).(FieldName)) ...
                && ~isnan(Panel(i).(FieldName))
            V(i) = double(Panel(i).(FieldName));
        end
    end
end


function XCenters = seriesXCenters(BarSeries, NumFamilies)
%seriesXCenters Bar-center x-coordinates for one grouped series.
%   XEndPoints gives the centers directly for a categorical grouped bar; fall back
%   to the group index for the degenerate single-family case where it is a scalar.
    XCenters = BarSeries.XEndPoints;
    if numel(XCenters) ~= NumFamilies
        XCenters = 1:NumFamilies;
    end
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