Skip to main content
ClaudeWave
Skill996 repo starsupdated 9d ago

matlab-use-machine-learning-apps

Use 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, exploring model interpretability, and exporting trained models. Programmatic access to Classification Learner and Regression Learner apps via AppController.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit /tmp/matlab-use-machine-learning-apps && cp -r /tmp/matlab-use-machine-learning-apps/skills-catalog/ai-and-statistics/matlab-use-machine-learning-apps ~/.claude/skills/matlab-use-machine-learning-apps
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Learner Apps AppController Reference

`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.

Source (loaded at runtime): `<skill-base-directory>/scripts/+mlearnapp/+internal/+appcontroller/AppController.p`

### API Reference (load on demand)

| When you need... | Load this file |
|------------------|---------------|
| 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) |
| Metrics, model spec queries, toolstrip buttons, set feature selection/PCA/optimizer/cost/hyperparameters | [`api-metrics-and-options.md`](references/api-metrics-and-options.md) |
| Open/configure standard plots, results table, standard plot data getters | [`api-plots.md`](references/api-plots.md) |
| PDP, permutation importance, Shapley, LIME, Set Shapley Parameters, explainability plot data getters | [`api-explainability.md`](references/api-explainability.md) |
| Export methods, command logging, diagnostics | [`api-export-and-diagnostics.md`](references/api-export-and-diagnostics.md) |

**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).

## When to Use

- 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
- User asks to open, drive, or automate either learner app
- User wants to compare multiple model types interactively with validation metrics
- User needs to test a model on held-out data or separate test data and export from the app

## When NOT to Use

- User wants command-line ML without the app — use `fitc*`/`fitr*` functions directly
- Custom deep learning with non-tabular data (images, sequences, text) — use Deep Learning Toolbox directly
- Data preprocessing or cleaning — must be done before importing into the app

## IMPORTANT

- **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.
- **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.

## Setup

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:

```matlab
addpath('<skill-base-directory>/scripts');
```

For example, if the skill base directory is `C:\MATLAB\AgenticAI\.claude\skills\matlab-use-machine-learning-apps`, then:

```matlab
addpath('C:\MATLAB\AgenticAI\.claude\skills\matlab-use-machine-learning-apps\scripts');
```

## User Goals Inquiry

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).

1. **End goal / where will the model be used?**
   - *Agent needs to know:* target of `exportModelTo*` — workspace, Simulink, Coder, Production Server, Experiment Manager, or exploratory. Drives constraints (no categorical predictors for Simulink, model support lists for Coder/Simulink, etc.).
   - *Ask the user:* "How will the model ultimately be used? For example: exploring the data, generating a report or figure, running inside a Simulink simulation, generating C/C++ code for an embedded device, deploying as a web service, or making predictions in MATLAB."
2. **Validation scheme.**
   - *Agent needs to know:* Set at session open via `openApp`, **fixed for the session — cannot be changed later without starting a new session**. The app default is 5-fold CV (`'KFold', 5`). Pick based on dataset size × training cost:

     | Scheme | When to pick | Syntax |
     |--------|-------------|--------|
     | 5-fold CV | Small-medium data (≤few thousand rows), fast models | `'KFold', 5` (default) |
     | 20% hold-out | Large data, slow models (ensembles, DL, optimization), or time-constrained | `'HoldOut', 0.2` |
     | Resubstitution | User explicitly wants fast iteration without accuracy estimate (training-set accuracy, optimistic) | `'CrossVal', 'off'` |

   - *Ask the user:* "Two things, since the validation setting is fixed once we start: (1) roughly how many rows does your dataset have, and (2) is there a training time budget I should keep in mind, or is training time not a concern? I'll pick a validation approach that works for both."
3. **Independent test dataset.**
   - *Agent needs to know:* whether to use `importTestData` with an existing table, reserve a fraction via `TestDataFraction` (e
matlab-train-networkSkill

>

matlab-driving-data-importerSkill

Import recorded driving sensor data (GPS, camera, lidar, actor tracks, lanes) into scenariobuilder.* objects (GPSData, CameraData, LidarData, ActorTrackData, Trajectory, laneData) and run preprocessing — synchronize, offset correction, crop, normalizeTimestamps, convertTimestamps. Also: compute actor tracks from lidar when no annotations exist, attach camera/lidar mounting + intrinsics, export to MAT/workspace/timetable/script. Use for raw driving dataset files (KITTI, nuScenes, Waymo, Pandaset, ROS/ROS2 bags, .mat, .csv, .mp4) or driving/vehicle/sensor logs that need wrapping. drivingLogAnalyzer (DLA) is OPT-IN ONLY — invoke only on explicit user request ('DLA', 'open in DLA', 'inspect/explore/analyze the recording') or reported sensor problem (sync drift, timestamp mismatch, overlay misalignment). NEVER auto-launch DLA after wrapping (Rule 0). For 'build scenario / export to RoadRunner / drivingScenario / OpenSCENARIO / Unreal / simulate', hand off to matlab-scenario-builder.

matlab-scenario-builderSkill

Generate driving scenes, scenarios, road surfaces, and 3D content from already-wrapped scenariobuilder.* sensor data (GPS, camera, lidar, actor tracks) using Scenario Builder for Automated Driving Toolbox. Use to BUILD, EXPORT, or AUGMENT a virtual scenario/scene/map: ego or actor trajectories, trajectory smoothing, OpenCRG road-surface extraction, 3D asset generation, static-object placement, point-cloud georeferencing + elevation, lane-based ego localization, sensor-fusion tracking, scenario-event extraction (cut-ins, hard brakes, near-misses, ADAS disengagements), or export to RoadRunner, drivingScenario, OpenDRIVE, OpenCRG, OpenSCENARIO, or Unreal Engine. Also: log-to-scenario, scenario harvesting, accident/near-miss reconstruction, SOTIF (ISO 21448) and ISO 26262 scenario coverage, USGS-aerial-lidar scene augmentation, traffic-sign placement from camera+lidar logs. NOT for raw-data import or multi-sensor sync/crop/offset/timestamp normalization — route those to matlab-driving-data-importer.

roadrunner-asset-mappingSkill

>

roadrunner-convert-lanelet2-to-rrhdSkill

>

roadrunner-import-sceneSkill

>

roadrunner-rrhd-authoringSkill

>

matlab-build-simbiology-modelSkill

Build, modify, and diagram SimBiology models — API reference, helper functions, and layout patterns. Use when constructing or editing models programmatically or visually.