rhino-sdk-metrics

This skill should be used when the user wants to run federated metrics or analytics using the Rhino Health Python SDK, asks about survival analysis, statistical tests, KaplanMeier, Cox, Mean, Count, TTest, ChiSquare, RocAuc, correlation, odds ratio, or needs help choosing or configuring a metric.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rhino-sdk-metrics" with this command: npx skills add naverazy-rhino/rhino-sdk-skills/naverazy-rhino-rhino-sdk-skills-rhino-sdk-metrics

Rhino Health SDK — Metrics Guide

Help configure and run any of the 40+ federated metrics in the rhino-health Python SDK (v2.1.x).

Context Loading

Before responding, read these reference files:

  1. Metrics Reference../../context/metrics_reference.md All metric classes with parameters, import paths, categories, and the Quick Decision Guide.

  2. Patterns & Gotchas../../context/patterns_and_gotchas.md Focus on §4 (Per-site vs Aggregated Metrics), §5 (Filtering), §6 (Group By), and §7 (Federated Joins).

Metric Decision Tree

Map the user's question to the right metric class:

User asks about...Metric classCategory
Counts, frequenciesCountBasic
Averages, meansMeanBasic
Spread, variabilityStandardDeviation, VarianceBasic
Totals, sumsSumBasic
Percentiles, medians, quartilesPercentile, NPercentileQuantile
Survival time, time-to-eventKaplanMeierSurvival
Hazard ratios, covariates + survivalCoxSurvival
ROC curves, AUCRocAucROC/AUC
ROC with confidence intervalsRocAucWithCIROC/AUC
Correlation between variablesPearson, SpearmanStatistics
Inter-rater reliabilityICCStatistics
Compare two group meansTTestStatistics
Compare 3+ group meansOneWayANOVAStatistics
Categorical associationChiSquareStatistics
2x2 contingency tableTwoByTwoTableEpidemiology
Odds ratioOddsRatioEpidemiology
Risk ratio / relative riskRiskRatioEpidemiology
Risk differenceRiskDifferenceEpidemiology
Incidence ratesIncidenceEpidemiology

If unsure, consult the full Quick Decision Guide in metrics_reference.md.

Execution Mode

Choose the right execution method based on scope:

ScopeMethodSignature
Single site/datasetsession.dataset.get_dataset_metric(dataset_uid, config)One dataset UID (str)
Single site (shorthand)dataset.get_metric(config)Called on a Dataset object
Aggregated across sitessession.project.aggregate_dataset_metric(dataset_uids, config)List[str] of UIDs — must be strings, not Dataset objects
Federated join (SQL-like)session.project.joined_dataset_metric(config, query_datasets, filter_datasets)List[str] UIDs for both params

All metrics are imported from rhino_health.lib.metrics (NOT rhino_health.metrics).

Filtering

Apply filters to narrow the data before computing the metric. Two approaches:

Inline FilterVariable (for simple per-column filters)

from rhino_health.lib.metrics import Mean, FilterType, FilterVariable

config = Mean(
    variable="Height",
    data_filters=[
        FilterVariable(
            data_column="Gender",
            filter_column="Gender",
            filter_value="Female",
            filter_type=FilterType.EQUALS,
        )
    ],
)

Range Filter (BETWEEN)

from rhino_health.lib.metrics import FilterBetweenRange, FilterType, FilterVariable

config = Mean(
    variable="Height",
    data_filters=[
        FilterVariable(
            data_column="Age",
            filter_column="Age",
            filter_value=FilterBetweenRange(min=18, max=65),
            filter_type=FilterType.BETWEEN,
        )
    ],
)

Grouping

Split results by one or more categorical columns:

config = Mean(
    variable="Height",
    group_by={"groupings": ["Gender"]},
)

Grouping and filtering can be combined on any metric.

Response Format

Structure every response as:

  1. Recommended metric — which class and why it fits the user's question
  2. Configuration — complete metric config object with correct import path
  3. Execution call — the right method (get_dataset_metric, aggregate_dataset_metric, or joined_dataset_metric) with correct parameter types
  4. Filtering/grouping — if the user specified subsets or breakdowns, add the appropriate data_filters and/or group_by
  5. See also — point to a matching example from ../../context/examples/INDEX.md if one exists

Working Examples

Check ../../context/examples/INDEX.md for matching examples. Key ones for metrics:

  • eda.py — per-site and aggregated metrics with filtering and grouping
  • cox.py — Cox proportional hazard regression
  • metrics_examples.py — TwoByTwoTable, OddsRatio, ChiSquare, TTest, ANOVA
  • roc_analysis.py — ROC curves and confidence intervals
  • aggregate_quantile.py — federated percentile calculations

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

rhino-sdk

No summary provided by upstream source.

Repository SourceNeeds Review
General

rhino-sdk-guide

No summary provided by upstream source.

Repository SourceNeeds Review
General

rhino-sdk-example

No summary provided by upstream source.

Repository SourceNeeds Review
General

rhino-sdk-plan

No summary provided by upstream source.

Repository SourceNeeds Review