Member Junction
    Preparing search index...

    Provides a simple interface for InteractiveComponents to use the host MJ instance's trained predictive models — listing what models are available and scoring records with them so the component can fold predictions (renewal likelihood, lead scores, churn risk, …) into its visualizations. Scoring is invoked over the wire against the host's Predictive Studio engine, so no model-training machinery runs in the browser.

    NOTE: the owning ComponentUtilities.ml property may be undefined when this capability is not available in the current environment/security context — component code must guard for that.

    interface SimpleMLTools {
        listModels: (
            filter?: SimpleMLListModelsFilter,
            contextUser?: UserInfo,
        ) => Promise<SimpleMLModelInfo[]>;
        score: (
            modelId: string,
            records: (string | Record<string, unknown>)[],
            options?: { contextUser?: UserInfo; primaryKeyField?: string },
        ) => Promise<SimpleMLScoreResult>;
    }
    Index

    Properties

    Properties

    listModels: (
        filter?: SimpleMLListModelsFilter,
        contextUser?: UserInfo,
    ) => Promise<SimpleMLModelInfo[]>

    List the trained predictive models available to the component, newest version first. Resilient: returns an empty array if the catalog cannot be read.

    Type Declaration

    score: (
        modelId: string,
        records: (string | Record<string, unknown>)[],
        options?: { contextUser?: UserInfo; primaryKeyField?: string },
    ) => Promise<SimpleMLScoreResult>

    Score a set of records with a trained model and return the predictions ephemerally (nothing is written back to the database).

    Type Declaration

      • (
            modelId: string,
            records: (string | Record<string, unknown>)[],
            options?: { contextUser?: UserInfo; primaryKeyField?: string },
        ): Promise<SimpleMLScoreResult>
      • Parameters

        • modelId: string

          The SimpleMLModelInfo.id of the model to score with.

        • records: (string | Record<string, unknown>)[]

          The records to score, either as primary-key strings or as row objects (the primary key is then read from options.primaryKeyField, default 'ID').

        • Optionaloptions: { contextUser?: UserInfo; primaryKeyField?: string }

          Optional primary-key field name and context user.

        Returns Promise<SimpleMLScoreResult>