matlab-use-machine-learning-apps

Train, compare, and export machine learning models using MATLAB Classification Learner and Regression Learner apps.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-use-machine-learning-apps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-use-machine-learning-apps
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/ai-and-statistics/matlab-use-machine-learning-apps
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-use-machine-learning-apps

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Training and comparing machine learning models in MATLAB's Classification Learner and Regression Learner apps normally requires manual clicking through the UI, and automating these apps programmatically is not documented for end users. This Skill gives an AI agent the knowledge to drive these apps end to end: opening sessions, training models, evaluating metrics, and exporting results.

Core Features & Use Cases

  • Session and model management: Open learner apps with data, configure validation schemes (k-fold, holdout, resubstitution), create and train models from the full gallery of presets, and compare results across metrics.
  • Evaluation and interpretability: Read validation and test metrics, configure plots (confusion matrix, ROC, residuals, compare results), and generate explainability outputs such as Shapley, LIME, partial dependence, and permutation importance.
  • Deployment export: Export trained models to the workspace, Simulink, MATLAB Coder, Experiment Manager, or Production Server, and generate training code as a script.
  • Use Case: A user with a tabular dataset asks to find the best classifier and deploy it to Simulink. The agent opens Classification Learner, trains multiple model families, compares accuracy and prediction speed, tests the best model on held-out data, and exports it to a Simulink block.

Quick Start

Ask the agent to open Classification Learner with your data table, train several model types, compare their validation accuracy, and export the best model to the workspace.

Frequently Asked Questions about matlab-use-machine-learning-apps

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train and compare machine learning models in MATLAB?

Open Classification Learner or Regression Learner with your data table, create models from the gallery presets, and train them together. Compare results using the Results Table and Compare Results plot, which show validation metrics like accuracy, RMSE, prediction speed, and model size side by side.

How do I export a trained model from Classification Learner to Simulink?

Use the export to Simulink feature, available in MATLAB R2024a and later, to generate a Simulink block from the trained model. Models trained with categorical predictors cannot be exported to Simulink, so encode categoricals as numeric values before loading data.

Does Classification Learner support hyperparameter optimization?

Yes, optimizable model presets run Bayesian hyperparameter optimization with 30 iterations by default. You can switch to grid or random search, set training time limits, or export to Experiment Manager for finer control over search ranges and constraints.

Can I use Shapley and LIME explanations in MATLAB learner apps?

Yes, Local Shapley and LIME plots are available from R2023b, and Shapley importance, summary, and dependence plots from R2024b. Shapley computation can be slow on large datasets or complex models, so adjust query points and observation samples to control cost.

When should I not use Classification Learner or Regression Learner?

Avoid these apps for command-line ML workflows where fitc or fitr functions are more direct, and for deep learning on non-tabular data like images, sequences, or text, which requires Deep Learning Toolbox. Data preprocessing and cleaning must also be done before importing data into the app.

Why is my cross-validation accuracy overly optimistic in the learner app?

Preprocessing that uses aggregate dataset statistics, such as mean imputation or z-score outlier removal done before import, leaks information from validation folds into training. The app does not apply these operations inside its CV folds, so perform such preprocessing within a fold-aware pipeline instead.