Member Junction
    Preparing search index...

    Sidecar seam — the /train call. Wraps MLSidecar from @memberjunction/predictive-studio-sidecar in production; tests inject a fake that returns a canned TrainResponse and captures the request so the test can assert the matrix/preprocessing/holdout shape sent to the sidecar.

    interface ISidecarTrainer {
        train(
            req: TrainRequest,
            lockedHoldout?: MatrixData,
        ): Promise<TrainResponse>;
    }

    Implemented by

    Index

    Methods

    Methods

    • Train a model from an assembled feature matrix. The implementation is responsible for sidecar lifecycle (start/connect); the engine only calls this method.

      The engine carves the locked holdout (plan §8.2) in TypeScript before calling this — req.data contains ONLY the training portion (the rows the model may train and tune on). The locked-holdout rows travel separately in the optional second argument so the sidecar scores them exactly once and returns holdout_metrics; they never enter req.data. Keeping the holdout out of the public TrainRequest shape preserves that contract while making the carve auditable and deterministic on the orchestrator side.

      Parameters

      • req: TrainRequest

        the fully-built train request (training matrix + schema + preprocessing + validation)

      • OptionallockedHoldout: MatrixData

        the carved-off holdout matrix to score exactly once (optional)

      Returns Promise<TrainResponse>