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

View on GitHub
function [Splits, Decision] = splitStrategy(T, ProblemType, Response, Options)
%splitStrategy Level-1 evaluation split over the pipeline's working data.
%
%   [Splits, Decision] = splitStrategy(T, ProblemType, Response) decides how the
%   WORKING data is evaluated. Working data is whatever reserveHoldoutForUser
%   (Level 0) left after setting aside the user's untouched slice; pass those row
%   indices as Subset so this operates only on them and returns GLOBAL indices.
%   Both evaluation strategies share one deliverable rule handled downstream: the
%   delivered recipe is refit on ALL working rows; the split below only decides
%   how performance is ESTIMATED, never what ships.
%
%     "holdout"          - split the working rows into a train part and a held
%                          part (stratified for classification, random for
%                          regression). Generation + selection run on the train
%                          part; the held part yields a single-split point
%                          estimate (no error bars). TrainIdx / TestIdx are the
%                          two parts.
%     "cross_validated"  - no single held-out slice: every working row rotates
%                          through a fold's test set under assessKFold, whose
%                          cross-fold mean +/- std IS the estimate. TrainIdx spans
%                          ALL working rows and TestIdx is empty.
%
%   Splits struct fields:
%     .TrainIdx - (:,1) GLOBAL row indices generation/selection run on (the whole
%                 working set under "cross_validated")
%     .TestIdx  - (:,1) GLOBAL row indices for the point-estimate test; EMPTY
%                 under "cross_validated"
%     .Method   - string: "stratified_holdout", "random_holdout", or
%                 "cross_validated"
%     .Strategy - the EvaluationStrategy in force ("holdout"/"cross_validated")
%
%   Decision struct fields:
%     .Choice       - chosen method description
%     .Alternatives - alternative methods considered
%     .Reasoning    - why this method was selected
%
%   Options:
%     EvaluationStrategy (1,1) string  - "holdout" (default) or "cross_validated".
%     Subset             (:,1) numeric - working row indices to operate on
%                          (default: all rows of T). Returned indices are global.
%     HoldoutFraction    (1,1) double  - held fraction under "holdout" (default 0.2).

% Copyright 2026 The MathWorks, Inc.

    arguments
        T table
        ProblemType (1,1) string {mustBeMember(ProblemType, ["classification","regression"])}
        Response (1,1) string
        Options.EvaluationStrategy (1,1) string ...
            {mustBeMember(Options.EvaluationStrategy, ["holdout","cross_validated"])} = "holdout"
        Options.Subset (:,1) {mustBeNumeric, mustBeInteger} = []
        Options.HoldoutFraction (1,1) double {mustBePositive, mustBeLessThan(Options.HoldoutFraction, 1)} = 0.2
    end

    if isempty(Options.Subset)
        WorkingIdx = (1:height(T))';
    else
        WorkingIdx = unique(Options.Subset(:));
        if any(WorkingIdx < 1) || any(WorkingIdx > height(T))
            error('splitStrategy:subsetOutOfRange', ...
                'Subset contains row indices outside 1..%d.', height(T));
        end
    end

    if Options.EvaluationStrategy == "cross_validated"
        [Splits, Decision] = crossValidatedSplit(WorkingIdx);
    else
        [Splits, Decision] = holdoutSplit(T, WorkingIdx, ProblemType, Response, Options.HoldoutFraction);
    end
    Splits.Strategy = Options.EvaluationStrategy;

    printSplitSummary(Splits, Decision.Choice, Decision.Reasoning);
end


function [Splits, Decision] = crossValidatedSplit(WorkingIdx)
%crossValidatedSplit No single held-out slice; folds (assessKFold) do the work.
    Splits.TrainIdx = WorkingIdx;
    Splits.TestIdx = zeros(0, 1);
    Splits.Method = "cross_validated";

    Decision.Choice = "cross_validated";
    Decision.Alternatives = "stratified_holdout, random_holdout";
    Decision.Reasoning = sprintf(['Cross-validated pipeline (%d working rows): every row rotates ' ...
        'through a fold''s test slice, so the cross-fold mean +/- std is the estimate; ' ...
        'no single held-out slice is carved'], numel(WorkingIdx));
end


function [Splits, Decision] = holdoutSplit(T, WorkingIdx, ProblemType, Response, Fraction)
%holdoutSplit Split working rows into train/test; returns GLOBAL indices.
    if ProblemType == "classification"
        Cv = cvpartition(T.(Response)(WorkingIdx), Holdout=Fraction);
        Splits.Method = "stratified_holdout";
        Decision.Alternatives = "random_holdout";
        Decision.Reasoning = sprintf(['Classification (%d working rows); stratified %.0f%% ' ...
            'holdout preserves class proportions'], numel(WorkingIdx), 100 * Fraction);
    else
        Cv = cvpartition(numel(WorkingIdx), Holdout=Fraction);
        Splits.Method = "random_holdout";
        Decision.Alternatives = "stratified_holdout";
        Decision.Reasoning = sprintf("Regression (%d working rows); random %.0f%% holdout sufficient", ...
            numel(WorkingIdx), 100 * Fraction);
    end
    Splits.TrainIdx = WorkingIdx(training(Cv));
    Splits.TestIdx = WorkingIdx(test(Cv));

    Decision.Choice = Splits.Method;
end


function printSplitSummary(Splits, Choice, Reasoning)
    fprintf('Split strategy: %s | Train=%d, Test=%d\n', ...
        Choice, numel(Splits.TrainIdx), numel(Splits.TestIdx));
    fprintf('  Reasoning: %s\n', Reasoning);
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