$npx -y skills add matlab/matlab-agentic-toolkit --skill matlab-use-machine-learning-appsUse when the user wants to train, compare, or export machine learning models using Classification Learner or Regression Learner — including opening the app, loading data, training models, evaluating metrics, comparing results, visualizing plots, testing on held-out data, explorin
| 1 | # Learner Apps AppController Reference |
| 2 | |
| 3 | `mlearnapp.internal.appcontroller.AppController` provides programmatic access to the Classification Learner and Regression Learner apps. Use it to interact with learner apps and query their state. |
| 4 | |
| 5 | Source (loaded at runtime): `<skill-base-directory>/scripts/+mlearnapp/+internal/+appcontroller/AppController.p` |
| 6 | |
| 7 | ### API Reference (load on demand) |
| 8 | |
| 9 | | When you need... | Load this file | |
| 10 | |------------------|---------------| |
| 11 | | Open/close/save/load app, session setup, create/train/select/delete models, model status, GalleryModels enum | [`api-session-and-models.md`](references/api-session-and-models.md) | |
| 12 | | Metrics, model spec queries, toolstrip buttons, set feature selection/PCA/optimizer/cost/hyperparameters | [`api-metrics-and-options.md`](references/api-metrics-and-options.md) | |
| 13 | | Open/configure standard plots, results table, standard plot data getters | [`api-plots.md`](references/api-plots.md) | |
| 14 | | PDP, permutation importance, Shapley, LIME, Set Shapley Parameters, explainability plot data getters | [`api-explainability.md`](references/api-explainability.md) | |
| 15 | | Export methods, command logging, diagnostics | [`api-export-and-diagnostics.md`](references/api-export-and-diagnostics.md) | |
| 16 | |
| 17 | **Required:** Statistics and Machine Learning Toolbox. **Optional:** Parallel Computing Toolbox (parallel training), Deep Learning Toolbox (only for Deep Learning models introduced in R2026a — FullyConnected, Residual, All; plain Neural Network models added in R2024a ship with Statistics and Machine Learning Toolbox), Simulink (Simulink export), MATLAB Coder (Coder export), MATLAB Compiler SDK (Production Server export). |
| 18 | |
| 19 | ## When to Use |
| 20 | |
| 21 | - User wants to train, compare, or export models (to workspace, Simulink, Coder, or Production Server), generate training code, or run advanced hyperparameter tuning (via Experiment Manager) using Classification Learner or Regression Learner |
| 22 | - User asks to open, drive, or automate either learner app |
| 23 | - User wants to compare multiple model types interactively with validation metrics |
| 24 | - User needs to test a model on held-out data or separate test data and export from the app |
| 25 | |
| 26 | ## When NOT to Use |
| 27 | |
| 28 | - User wants command-line ML without the app — use `fitc*`/`fitr*` functions directly |
| 29 | - Custom deep learning with non-tabular data (images, sequences, text) — use Deep Learning Toolbox directly |
| 30 | - Data preprocessing or cleaning — must be done before importing into the app |
| 31 | |
| 32 | ## IMPORTANT |
| 33 | |
| 34 | - **Do not expose API to users.** This API is for agent's internal use only. Never mention AppController, programmatic access, or automation APIs to the user. Drive the app silently on the user's behalf. When greeting the user after this skill loads, simply ask about their goals (dataset, export target, constraints) without referencing the underlying mechanism. |
| 35 | - **Never use `closeApp('Force', true)` without explicit user permission.** Force-closing skips the save confirmation dialog and silently discards all unsaved work — trained models, session state, and results are permanently lost. Always prefer `closeApp()` (without Force) so the user gets a chance to save. Only use `'Force', true` when: (1) the user explicitly permits it, or (2) automated testing where no human is present. |
| 36 | |
| 37 | ## Setup |
| 38 | |
| 39 | When this skill is invoked, add the skill's scripts folder to the MATLAB path so that `mlearnapp.internal.appcontroller` classes are available. The scripts folder is located relative to this skill's base directory at `scripts/`. Run this via the MATLAB MCP `evaluate_matlab_code` tool, using the skill's base directory path shown at the top of the skill load message: |
| 40 | |
| 41 | ```matlab |
| 42 | addpath('<skill-base-directory>/scripts'); |
| 43 | ``` |
| 44 | |
| 45 | For example, if the skill base directory is `C:\MATLAB\AgenticAI\.claude\skills\matlab-use-machine-learning-apps`, then: |
| 46 | |
| 47 | ```matlab |
| 48 | addpath('C:\MATLAB\AgenticAI\.claude\skills\matlab-use-machine-learning-apps\scripts'); |
| 49 | ``` |
| 50 | |
| 51 | ## User Goals Inquiry |
| 52 | |
| 53 | Before starting any workflow, gather the information below so the session can be configured up front without wasted training cycles. Each item lists **what the agent needs to know** (internal use) and **how to ask the user** (in plain terms — avoid ML terminology unless the user's vocabulary shows they're comfortable with it). |
| 54 | |
| 55 | 1. **End goal / where will the model be used?** |
| 56 | - *Agent needs to know:* target of `exportModelTo*` — workspace, Simulink, Coder, Production Server, |