Member Junction
    Preparing search index...

    The At-Risk rules the drawer, the resource, the gate probe and the tests share.

    Index

    Constructors

    Properties

    RiskBands: readonly RiskBandDisplay[] = ...

    The risk bands in display order, highest risk first.

    Methods

    • Whether a signed per-row contribution raises the risk the screen shows. Contributions are on the model's own score (value > 0 pushed the score up). When that score is the probability of the good outcome (invertedRisk, e.g. P(renew)), pushing it up LOWERS risk.

      Parameters

      • contribution: number
      • invertedRisk: boolean

      Returns boolean

    • Build the MJ: Lists.Name string (At-Risk: <title> (<timestamp>)) truncated to maxLength (100 chars, matching MJ: Lists.Name NVARCHAR(100)) so long prediction titles never fail save validation.

      Parameters

      • title: string
      • timestamp: string
      • maxLength: number = 100

      Returns string

    • Turn a raw feature/column name into a readable label — RetentionOverdueInvoices → Retention Overdue Invoices, overdue_invoices → Overdue invoices, and a one-hot MembershipType=Student → Membership Type = Student. Splits camelCase + snake/kebab, spaces one-hot =, collapses whitespace, and capitalizes the first letter. Already-spaced labels pass through unchanged.

      Parameters

      • name: string

      Returns string

    • Build a human-readable label for a record from its (simple) row of the target entity — preferring the entity's name field (nameField), then Name, else FirstName+LastName (with Email), else Email, else the first short non-empty string field that is not a UUID (the row's ID adds nothing the caller's record-id fallback doesn't). Returns null when nothing usable is found (caller falls back to the record id).

      Parameters

      • row: Record<string, unknown>
      • nameField: string

      Returns string

    • Risk in 0–1 from a model's score: 1 - score when the score is the probability of the good outcome. Clamped on both paths, so a score outside 0–1 (a regression value such as an LTV of 2500) reads as risk 1, never as 250000%.

      Parameters

      • score: number
      • inverted: boolean

      Returns number

    • The top plain-language drivers for the whole prediction, from the model's global feature importance. Accepts the object form ({"MembershipType=Student": 0.9, ...}) or the array form ([{feature, importance}]), strips one-hot =value suffixes, de-duplicates, and returns the highest-importance feature names — so a business user sees feature names, not raw weights.

      Parameters

      • featureImportanceJson: string
      • n: number = 3

      Returns string[]