Ml4t Meta Labels logo

Ml4t Meta Labels

Organization
ml4t
ml4t-meta-labels

Secondary model predicts whether a primary signal will be profitable. Use when sizing positions or filtering low-conviction trades from a base alpha model.

Overview

Publisherml4t
Repositoryskills
Skill nameml4t-meta-labels
Stars
45
Forks
13
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ml4t on GitHub. Read the source before you install it.

Installation

Install the Ml4t Meta Labels AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ml4t/skills/tree/main/features/meta-labels
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ml4t/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/features/meta-labels .claude/skills/ml4t-meta-labels
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ml4t Meta Labels in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ml4t Meta Labels on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ml4t Meta Labels is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Meta-Labels

A momentum signal fires 1,000 times per year but only 40% are profitable. Instead of discarding the signal, train a second model to predict which of those 1,000 trades will work.

The Problem

Raw trading signals typically have acceptable recall (they catch most real moves) but poor precision (many false positives). Tuning the primary model to improve precision degrades recall. Meta-labeling decouples the two: the primary model generates candidates, the meta-model filters them.

The Pattern

WRONG

python
from sklearn.ensemble import GradientBoostingClassifier

# Use raw signal directly - many false positives passed through
signal = primary_model.predict(X)  # 1=buy, -1=sell, 0=hold
positions = signal  # Every signal becomes a trade

CORRECT

python
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import TimeSeriesSplit

def purged(split, horizon):
    """Drop training rows whose label window reaches into the test fold."""
    for train, test in split:
        yield train[train < test[0] - horizon], test

def oof_signal(X, y, splits):
    """Primary predictions, each from a model that never saw that row."""
    out = np.zeros(len(X))
    for train, test in splits:
        out[test] = fit_primary(X[train], y[train]).predict(X[test])
    return out

signal = np.zeros(len(X))
prob_win = np.full(len(X), np.nan)
for train, test in purged(TimeSeriesSplit(n_splits=5).split(X), horizon):
    # Inner folds first. Fitting the meta-model on primary predictions the
    # primary made in sample teaches it the primary's memorisation, not its edge.
    inner = purged(TimeSeriesSplit(n_splits=3).split(X[train]), horizon)
    fired = oof_signal(X[train], y[train], inner) != 0
    meta = GradientBoostingClassifier(n_estimators=100, max_depth=3)
    meta.fit(X[train][fired], outcomes[train][fired])  # 1=profitable, 0=not

    signal[test] = fit_primary(X[train], y[train]).predict(X[test])
    acted = test[signal[test] != 0]
    prob_win[acted] = meta.predict_proba(X[acted])[:, 1]

positions = np.where(prob_win > 0.55, signal, 0.0)   # NaN compares False

Two-Stage Architecture

Primary Model ──→ Signal (direction + timing)
                    │
                    ▼ (only where signal fired)
Meta-Model    ──→ P(profitable) ──→ Filter / Size position

The meta-model receives the same features plus signal-specific ones: the primary's own confidence, the current volatility regime, and its rolling hit rate. Build them from the outer training fold only, like everything else here.

Position Sizing

python
# Kelly-inspired sizing: size proportional to edge. Every prob_win above is an
# out-of-fold score; refit on all of it for rows after the last fold.
edge = 2 * np.nan_to_num(prob_win, nan=0.5) - 1  # unscored rows get zero size
position_size = base_size * np.clip(edge, 0, 1)

Guardrails

  • Meta-model never overrides direction - it only decides whether to act, and how much
  • Separate CV for primary and meta - meta-model must not see primary's test data
  • Requires sufficient primary signals - if primary fires <100 times, meta-model will overfit

Production Implementation

ml4t-engineer provides integrated meta-labeling with triple-barrier outcomes:

python
from ml4t.engineer.config import LabelingConfig
from ml4t.engineer.labeling import atr_triple_barrier_labels, meta_labels

config = LabelingConfig.atr_barrier(
    atr_tp_multiple=2.0,
    atr_sl_multiple=1.5,
    atr_period=14,
    max_holding_period=10,
)
labeled = atr_triple_barrier_labels(df, config=config, price_col="close")
labeled = labeled.with_columns(primary_signal.alias("signal"))
meta = meta_labels(labeled, signal_col="signal", return_col="label_return")
# Returns: original signal plus binary meta_label for trade filtering/sizing

Checklist

  • Primary model has persistent, fold-stable IC (check worst-fold, not just mean)
  • Meta-model trained only on samples where primary signal fired
  • CV is nested: primary and meta models use separate folds
  • Meta-model probability used for position sizing or filtering
  • Sufficient signal count (>200) to train meta-model reliably

Frequently asked questions

What does the Ml4t Meta Labels AI skill do?

Secondary model predicts whether a primary signal will be profitable. Use when sizing positions or filtering low-conviction trades from a base alpha model.

Why use Ml4t Meta Labels on TypingMind?

Because you install it once and use it with any model. Ml4t Meta Labels is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ml4t Meta Labels in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ml4t/skills/tree/main/features/meta-labels. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Ml4t Meta Labels?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ml4t Meta Labels?

As many as you like. As long as a model supports skills, you can use Ml4t Meta Labels with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ml4t Meta Labels AI skill free?

Yes. It is published on GitHub by ml4t under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇