Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/ai-and-statistics/matlab-classify-tabular-data

matlab-classify-tabular-data

Unverified

Use this skill to classify tabular data end-to-end in MATLAB — load a dataset, prepare and clean it, select promising classifiers, train them, and compare accuracies with cross-validation, holdout, or hyperparameter optimization plus statistical tests. TRIGGER when: user asks to classify tabular data, pick classifiers for a dataset, compare classifier accuracy, run cross-validation or a holdout evaluation, or find the best model with statistical uncertainty. DO NOT TRIGGER when: user has non-tabular inputs (images, sequences, time series), wants a regression model, is training a specific neural network architecture (use matlab-train-network), or wants cost-sensitive learning or an arbitrary class-prior vector (this skill only supports the built-in uniform-prior toggle for imbalanced data).

FileKindSize
SKILL.mdskill md36.1 KB
manifest.yamlconfig524 B
references/README.mdmarkdown3.1 KB
references/dataprep.mdmarkdown7.5 KB
references/hpo.mdmarkdown11.5 KB
references/save-and-export.mdmarkdown7.0 KB
references/select-classifiers-imbalanced.mdmarkdown3.0 KB
references/select-classifiers.mdmarkdown9.4 KB
scripts/README.mdmarkdown2.3 KB
scripts/helpers/aggregate_nested_cv_loss.mother470 B
scripts/helpers/apply_preproc.mother4.1 KB
scripts/helpers/build_model_definitions.mother16.6 KB
scripts/helpers/compute_data_flags.mother2.8 KB
scripts/helpers/compute_pairwise_pvalues_cv.mother623 B
scripts/helpers/compute_pairwise_pvalues_holdout.mother556 B
scripts/helpers/count_categorical_levels.pbinary376 B
scripts/helpers/export_workflow_script.mother15.2 KB
scripts/helpers/find_zero_variance_columns.mother810 B
scripts/helpers/is_bag_of_tokens.mother181 B
scripts/helpers/make_holdout_split.mother387 B
scripts/helpers/plot_accuracy_bars.mother994 B
scripts/helpers/plot_boosting_curve.mother1.2 KB
scripts/helpers/plot_pvalue_heatmap.mother465 B
scripts/helpers/plot_training_time.mother797 B
scripts/helpers/resolve_recipe.mother1.1 KB
scripts/helpers/resume_boosting_cv.mother543 B
scripts/helpers/resume_boosting_holdout.mother448 B
scripts/helpers/retrain_with_hpo.mother2.7 KB
scripts/helpers/retrain_with_resume.mother2.5 KB
scripts/helpers/sanitize_model_name.mother799 B
scripts/helpers/save_selected_models.mother4.0 KB
scripts/helpers/score_holdout_test.mother278 B
scripts/helpers/stratified_subsample.pbinary367 B
scripts/helpers/train_and_score_cv.mother405 B
scripts/helpers/train_and_score_holdout.mother1.1 KB
scripts/model_catalog/branch_categorical.mother4.2 KB
scripts/model_catalog/branch_many_missing.mother3.1 KB
scripts/model_catalog/branch_regular.mother4.1 KB
scripts/model_catalog/branch_sparse.mother1.3 KB
scripts/model_catalog/branch_wide.mother2.0 KB
scripts/model_catalog/classifier_branches.mother2.2 KB
scripts/model_catalog/classifier_thresholds.mother2.2 KB
scripts/model_catalog/imbalanced_boosting.mother3.0 KB
scripts/model_catalog/model_recipe.mother3.5 KB

scripts/model_catalog/branch_regular.m

View on GitHub
% branch_regular.m
%
% Default branch (id 4): regular data — numeric, in-memory tall,
% no many-missing, no sparse. Applies when no other branch matches.
%
% Appends one entry to BRANCHES. Requires THRESHOLDS from
% classifier_thresholds.m. Uses model_recipe() from model_recipe.m.

REGULAR_MODELS = [ ...
    model_recipe('Tree', 'fitctree', ...
        struct(), ...
        'Interp', {{'low','high'}}) ...
    model_recipe('TreeIC', 'fitctree', ...
        struct('PredictorSelection','interaction-curvature'), ...
        'Interp', {{'low','high'}}) ...
    model_recipe('QuadraticDiscriminant', 'fitcdiscr', ...
        struct('DiscrimType','pseudoquadratic'), ...
        'Interp', {{'low','high'}}) ...
    ...
    model_recipe('LogisticRegression', 'fitclinear', ...
        struct('Learner','logistic','Solver','lbfgs','Lambda',0), ...
        'Interp', {{'high'}}, ...
        'MulticlassECOC', true) ...
    model_recipe('GAM', 'fitcgam', ...
        struct(), ...
        'Interp', {{'high'}}, ...
        'BinaryOnly', true) ...
    ...
    model_recipe('GaussianSVM', 'fitcsvm', ...
        struct('KernelFunction','rbf','Standardize',true,'KernelScale','auto'), ...
        'Interp',         {{'low'}}, ...
        'MulticlassECOC', true, ...
        'Condition',      @(f) ~f.isBig) ...
    ...
    model_recipe('KernelSVM', 'fitckernel', ...
        struct('Learner','svm','Standardize',true,'KernelScale','auto'), ...
        'Interp',         {{'low'}}, ...
        'MulticlassECOC', true, ...
        'Condition',      @(f) f.isBig) ...
    model_recipe('KernelLogistic', 'fitckernel', ...
        struct('Learner','logistic','Standardize',true,'KernelScale','auto'), ...
        'Interp',         {{'low'}}, ...
        'MulticlassECOC', true, ...
        'Condition',      @(f) f.isBig) ...
    ...
    model_recipe('NeuralNetwork', 'fitcnet', ...
        struct('Standardize',true), ...
        'Interp',    {{'low'}}, ...
        'Condition', @(f) ~f.isBig) ...
    ...
    model_recipe('KNN', 'fitcknn', ...
        struct('Distance','cosine','NumNeighbors',1), ...
        'Interp',    {{'low'}}, ...
        'Condition', @(f) ~f.isBig && f.isHighD) ...
    model_recipe('KNN', 'fitcknn', ...
        struct('Distance','euclidean','NumNeighbors',1,'Standardize',true), ...
        'Interp',    {{'low'}}, ...
        'Condition', @(f) ~f.isBig && ~f.isHighD) ...
    ...
    model_recipe('LightRandomForest', 'fitcensemble', ...
        struct('Method','Bag','NumLearningCycles',30), ...
        'InnerLearnerFn', 'templateTree', ...
        'Interp',         {{'low'}}, ...
        'Condition',      @(f) f.isBig) ...
    model_recipe('DarkRandomForest', 'fitcensemble', ...
        struct('Method','Bag','NumLearningCycles',100), ...
        'InnerLearnerFn', 'templateTree', ...
        'Interp',         {{'low'}}, ...
        'Condition',      @(f) ~f.isBig) ...
    ...
    model_recipe('LogitBoost', 'fitcensemble', ...
        struct('Method','LogitBoost','NumLearningCycles',30,'LearnRate',0.1), ...
        'InnerLearnerFn',   'templateTree', ...
        'InnerLearnerArgs', struct('MaxNumSplits',10), ...
        'Interp',           {{'low'}}, ...
        'BinaryOnly',       true, ...
        'Condition',        @(f) ~f.isHighD) ...
    model_recipe('RoughAdaBoost', 'fitcensemble', ...
        struct('Method','AdaBoostM2','NumLearningCycles',30,'LearnRate',0.1), ...
        'InnerLearnerFn',   'templateTree', ...
        'InnerLearnerArgs', struct('MaxNumSplits',10), ...
        'Interp',           {{'low'}}, ...
        'Condition',        @(f) ~f.isHighD && ~f.isBinary) ...
    model_recipe('FineAdaBoost', 'fitcensemble', ...
        struct('Method','AdaBoostM2','NumLearningCycles',30,'LearnRate',0.1), ...
        'InnerLearnerFn',   'templateTree', ...
        'InnerLearnerArgs', struct('MaxNumSplits', @(f) 5*f.nClasses*(f.nClasses-1)), ...
        'Interp',           {{'low'}}, ...
        'Condition',        @(f) ~f.isHighD && ~f.isBinary) ...
];

BRANCHES(end+1) = struct( ...
    'id',     4, ...
    'name',   'regular', ...
    'entry',  @(f) true, ...    % default — always last
    'models', {REGULAR_MODELS});

clear REGULAR_MODELS

% Copyright 2026 The MathWorks, Inc.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall