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

View on GitHub
function FeatureTbl = transformFeatures(Recipe, RawInput, Index)
%transformFeatures Apply a pool recipe to new raw data (generator-agnostic).
%
%   FeatureTbl = transformFeatures(Recipe, RawInput) reproduces the FULL feature
%   pool on new raw data, dispatching on the recipe's type so downstream code
%   never has to know which producer built the pool. It is the inference half of
%   the pool contract (describeFeatures is the other half).
%
%   FeatureTbl = transformFeatures(Recipe, RawInput, Index) reproduces only the
%   named (or numerically indexed) subset -- the scoped form. Index is a string
%   array of feature names or a numeric/logical index. The columns come back in
%   the requested order. This is what the selectFeatures entry point calls to
%   deliver the consensus-selected set; scope is just an argument here, not a
%   separate function.
%
%   Recipe is opaque and self-describing:
%     - An SMLT FeatureTransformer (from generateFeatures / gencfeatures /
%       genrfeatures): applied with the transform METHOD. Note the deliberate
%       name overlap -- this function (transformFeatures) is our generic wrapper;
%       transform(...) is the SMLT method it calls. When an Index is given it is
%       passed straight to transform(Recipe, RawInput, Index): the method subsets
%       natively (preserving requested order) and errors on an unknown name with
%       id stats:featlearn:FeatureTransformer:InvalidIndex -- no guard needed on
%       this branch. The SMLT method requires RawInput be a table and errors if
%       it is not.
%     - A domain recipe struct (Kind == "domain"): a captured extraction spec
%       produced when pool-building was routed to a domain skill. Its .Apply
%       field replays the extraction on RawInput to reproduce the full pool; an
%       Index then subsets that table by name, with an explicit missing-column
%       guard (a domain Apply must reproduce columns named identically to the
%       pool it originally produced -- the SMLT transform method guarantees this
%       automatically). If the recipe also carries an optional .ApplySelected
%       handle, a by-name Index uses it to compute ONLY the requested columns
%       (see provider-protocol.md) instead of the full pool; the same guard runs
%       on its output.
%
%   Inputs:
%     Recipe   - FeatureTransformer, or a struct with fields:
%                  .Kind  (1,1) string = "domain"
%                  .Apply (1,1) function_handle mapping the raw data to a
%                         feature table (the replayed extraction)
%     RawInput - new raw data with the inputs the recipe expects. Its form is the
%                recipe's business: an SMLT transformer requires a TABLE, while a
%                domain extraction takes whatever it consumes (table, numeric
%                matrix, cell array, datastore, ...). Left UNCONSTRAINED here so a
%                domain matrix is not silently coerced; the SMLT transform method
%                enforces its own table requirement on that branch.
%     Index    - (optional) feature names (string) or a numeric/logical index of
%                the subset to reproduce; omitted returns the full pool
%
%   Output:
%     FeatureTbl - table of engineered features on RawInput (full pool, or the
%                  requested subset in requested order)

% Copyright 2026 The MathWorks, Inc.

    arguments
        Recipe
        RawInput
        Index = string.empty
    end

    HasIndex = ~isStringEmpty(Index);

    if isa(Recipe, "FeatureTransformer")
        % SMLT artifact -- the transform method is the deterministic recipe and
        % subsets natively when handed an index. It requires a table and errors
        % itself if RawInput is not one.
        if HasIndex
            FeatureTbl = transform(Recipe, RawInput, Index);
        else
            FeatureTbl = transform(Recipe, RawInput);
        end
    elseif isDomainRecipe(Recipe, "Apply")
        % Domain artifact. For a subset request BY NAME, prefer the optional
        % ApplySelected handle -- it computes ONLY the requested columns, sparing a
        % large pool the full-Apply-then-discard cost. Absent it (or for a numeric
        % index, which it is not defined for), replay the full Apply and subset.
        % Either way the same missing-column guard runs, so a selective extractor
        % that omits a requested name fails exactly as the full path would.
        UseSelective = HasIndex && ~(isnumeric(Index) || islogical(Index)) ...
            && isDomainRecipe(Recipe, "ApplySelected");
        if UseSelective
            FeatureTbl = Recipe.ApplySelected(RawInput, string(Index));
            if ~istable(FeatureTbl)
                error("transformFeatures:domainNotTable", ...
                    "The domain recipe's ApplySelected function must return a table.");
            end
            FeatureTbl = subsetDomainPool(FeatureTbl, Index);
        else
            FeatureTbl = Recipe.Apply(RawInput);
            if ~istable(FeatureTbl)
                error("transformFeatures:domainNotTable", ...
                    "The domain recipe's Apply function must return a table.");
            end
            if HasIndex
                FeatureTbl = subsetDomainPool(FeatureTbl, Index);
            end
        end
    else
        error("transformFeatures:unknownRecipe", ...
            ['Recipe must be an SMLT FeatureTransformer or a domain recipe ' ...
            'struct (Kind == "domain" with an Apply function handle).']);
    end
end


function FeatureTbl = subsetDomainPool(FeatureTbl, Index)
%subsetDomainPool Subset a replayed domain pool by name or numeric index.
    if isnumeric(Index) || islogical(Index)
        FeatureTbl = FeatureTbl(:, Index);
        return;
    end
    Names = string(Index);
    Have = string(FeatureTbl.Properties.VariableNames);
    Missing = setdiff(Names, Have, "stable");
    if ~isempty(Missing)
        error("transformFeatures:missingColumns", ...
            ['The reproduced pool is missing selected column(s): %s. A domain ' ...
            'recipe must regenerate columns named identically to the pool it ' ...
            'was selected from.'], strjoin(Missing, ", "));
    end
    FeatureTbl = FeatureTbl(:, Names);
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