본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트81k · #1669

trader-explain

하는 일

이 스킬은 모델의 예측에 가장 큰 영향을 준 특성을 순위로 매겨 트레이딩 신호를 설명합니다. 자동 트레이딩 신호의 명확한 이유가 필요한 사람을 위한 스킬입니다.

사용하는 경우

  • ✓트레이딩 신호에 대해 순위가 매겨진 명확한 이유가 필요할 때.
  • ✓규정상 모델 결과를 규제 기관에 설명해야 할 때.
  • ✓어떤 입력이 예측을 이끌었는지 확인하고 싶을 때.

스킬 링크

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-neural-trader/skills/trader-explain/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-neural-trader/skills/trader-explain/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“모델이 신호 118을 낸 이유를 설명하고, 그 뒤에 있던 주요 특성을 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 신호를 가져오고, 모델에서 특성별 기여 점수를 얻은 뒤, 그래프 기반 방법으로 주요 특성을 순위 매깁니다. 순위는 표로 보여 주고, 결과의 서명된 기록을 저장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Explain a trading signal by building a feature-contribution graph and running single-entry forward-push PageRank from the signal output node. Top-K ranked features are returned as a markdown table AND persisted to trading-analysis as a SignedAttributionArtifact (ADR-126 Phase 6).

Why this skill matters:

  • EU AI Act + SEC Reg-AI guidance require interpretable model output for any algorithmic trading system that touches retail capital. This is the regulator-grade attribution path the rest of the substrate has been waiting for.
  • The same call site picks up the full native-WASM PageRank from mcp__ruflo-sublinear__page-rank-entry once that tool is registered in the runtime — until then, the local power-iteration kernel ships in signed-attribution.mjs and produces the same ordering (seeded mulberry32).

Steps:

  1. Retrieve the signal from the canonical trading-signals namespace (ADR-126 Phase 1 + Phase 2 lifecycle):

    mcp__plugin_ruflo-core_ruflo__memory_retrieve({
      key: "SIGNAL_ID",
      namespace: "trading-signals"
    })
    

    The signal entry includes modelId, prediction, and the feature vector at the time of inference.

  2. Extract per-feature contribution scores from the model:

    npx neural-trader --predict --signal "$SIGNAL_ID" --explain --json
    

    The expected output shape:

    {
      features: Array<{ name: string; contribution: number }>;
      // for Transformers, also includes per-head attention co-occurrence:
      attention?: Array<{ head: string; cooccur: Array<[number, number, number]> }>;
    }
    

    Fallback path — if --explain is not shipped on the installed neural-trader build (older versions; the flag was scoped for a follow-up upstream PR), the skill degrades to a deterministic feature-importance heuristic over the signal's input vector: contribution_i = |input_i - μ_i| / σ_i (z-score magnitude). This is a known proxy — not as faithful as attention/SHAP — and the resulting artifact is tagged attribution_method: "input-zscore-fallback" so downstream consumers can filter it out for regulator filings. Document the fallback path in the resulting markdown summary so the agent surfaces it to the user.

  3. Build the feature-contribution graph:

    • Nodes: one node per feature + one source node __signal_output__ for the prediction.
    • Edges: outgoing edges from __signal_output__ to each feature node, weighted by contribution_i. When attention co-occurrence data is available, also add edges between feature nodes weighted by cooccur — this is what makes the PageRank single-entry rather than degenerating to plain top-K.
    • Source: __signal_output__ (index 0 by convention so the smoke can assert reproducibility).
  4. Run single-entry PageRank — preferred path when mcp__ruflo-sublinear__page-rank-entry is registered:

    mcp__ruflo-sublinear__page-rank-entry({
      nodes: GRAPH_NODES,
      edges: GRAPH_EDGES,
      sourceIndex: 0,
      damping: 0.85,
      maxIterations: 100,
      tolerance: 1e-8,
      seed: 42
    })
    

    The local fallback (localSingleEntryPageRank in plugins/ruflo-neural-trader/src/signed-attribution.mjs) runs ~30 LOC of seeded power-iteration when the MCP tool is not available — same math, same result up to floating-point tolerance, same ordering for the same seed (the Phase 6 smoke asserts this).

  5. Build the top-K AttributionFeature[] via topKFeatures(graph, scores, k=10, excludeIndex=0) — excludes the source node from the ranked output. Ties broken by node index (lower index wins) so the ranking is deterministic.

  6. Sign the artifact (reuses the Phase 4 signing primitives — same Ed25519 + canonicalization):

    • Build the SignedAttributionArtifact body:
      {
        signalId: SIGNAL_ID,
        modelId: SIGNAL.modelId,
        features: TOP_K_FEATURES,             // from step 5
        graphMetadata: {
          nodeCount: GRAPH.nodes.length,
          edgeCount: COUNT_EDGES,
          pageRankIterations: PR_RESULT.iterations,
          seed: SEED                          // load-bearing for reproducibility
        },
        generatedAt: NEW_DATE_ISO
      }
      
    • Resolve the witness signing key — same lookup order as Phase 4:
      1. RUFLO_WITNESS_KEY_PATH env var — JSON file with { "privateKey": "<hex>" }.
      2. verification/witness-key.json (the ADR-103 default path).
    • If a key resolves: `signAttributionArtifact(
자주 묻는 질문

왜 규제 수준이라고 설명하나요?

소스의 노트에 따르면, 트레이딩 시스템 규칙이 요구하는 해석 가능한 결과를 주기 위한 것입니다.

특별한 라이브러리가 필요한가요?

스킬에 포함된 로컬 계산을 쓰므로, 네이티브 도구가 없어도 동작합니다.

결과는 어디에 저장되나요?

서명된 귀속 기록으로 trading-analysis 메모리에 저장됩니다.

상세 정보

작성자의 원본 설명

Regulator-grade feature attribution for any LSTM/Transformer signal — single-entry PageRank ranks the top-K features that drove the prediction (ADR-126 Phase 6, ADR-123 single-entry PR)

repo: ruvnet/ruflo

인기도

GitHub 스타
81k
순위
#1669
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬