matlab/matlab-agentic-toolkit / skills-catalog/ai-and-statistics/matlab-classify-tabular-data
matlab-classify-tabular-data
UnverifiedUse 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).
scripts/model_catalog/branch_categorical.m
View on GitHub% branch_categorical.m
%
% Branch 2: categorical features present (hasCategorical, no
% many-missing, not sparse). Tree-based models and NaiveBayes handle
% categorical features natively. SVM/NN are gated on total categorical
% level count — dummy-variable expansion makes them impractical when
% total levels exceed THRESHOLDS.cat_svm_nn_levels.
%
% Appends one entry to BRANCHES. Requires THRESHOLDS.
%
% NOTE: totalCatLevels is not a member of the standard flags struct
% (compute_data_flags does not compute it). The skill runtime and the
% harness both add it before invoking recipes from this branch. Recipes
% below reference `f.totalCatLevels` accordingly.
CATEGORICAL_MODELS = [ ...
model_recipe('Tree', 'fitctree', ...
struct(), ...
'Interp', {{'low','high'}}) ...
model_recipe('TreeIC', 'fitctree', ...
struct('PredictorSelection','interaction-curvature'), ...
'Interp', {{'low','high'}}) ...
model_recipe('NaiveBayes', 'fitcnb', ...
struct(), ...
'Interp', {{'low','high'}}) ...
model_recipe('GAM', 'fitcgam', ...
struct(), ...
'Interp', {{'low','high'}}, ...
'BinaryOnly', true) ...
...
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) ...
...
... % SVM and NN gated on totalCatLevels. Same recipes as branch 4.
model_recipe('GaussianSVM', 'fitcsvm', ...
struct('KernelFunction','rbf','Standardize',true,'KernelScale','auto'), ...
'Interp', {{'low'}}, ...
'MulticlassECOC', true, ...
'Condition', @(f) ~f.isBig && f.totalCatLevels <= THRESHOLDS.cat_svm_nn_levels) ...
model_recipe('KernelSVM', 'fitckernel', ...
struct('Learner','svm','Standardize',true,'KernelScale','auto'), ...
'Interp', {{'low'}}, ...
'MulticlassECOC', true, ...
'Condition', @(f) f.isBig && f.totalCatLevels <= THRESHOLDS.cat_svm_nn_levels) ...
model_recipe('KernelLogistic', 'fitckernel', ...
struct('Learner','logistic','Standardize',true,'KernelScale','auto'), ...
'Interp', {{'low'}}, ...
'MulticlassECOC', true, ...
'Condition', @(f) f.isBig && f.totalCatLevels <= THRESHOLDS.cat_svm_nn_levels) ...
model_recipe('NeuralNetwork', 'fitcnet', ...
struct('Standardize',true), ...
'Interp', {{'low'}}, ...
'Condition', @(f) ~f.isBig && f.totalCatLevels <= THRESHOLDS.cat_svm_nn_levels) ...
];
BRANCHES(end+1) = struct( ...
'id', 2, ...
'name', 'categorical', ...
'entry', @(f) f.hasCategorical && ~f.hasManyMissing && ~f.isSparse, ...
'models', {CATEGORICAL_MODELS});
clear CATEGORICAL_MODELS
% Copyright 2026 The MathWorks, Inc.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| 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: 197k | Updated | Claude CodeCodex | Verified | Install |