Class Model<G>Abstract

An abstract class that represents a model with its associated data used during the training. Concretely, you can give to the constructor a way to load a model with getModel and describe how to use this model to in method predict with parsed data from the given record and data.
The model never loads if you never call getModel, so you can instantiate this class multiple times without troubles.

Type Parameters

  • G

Hierarchy

Constructors

  • Type Parameters

    • G

    Parameters

    • loadingPath: string

      The loadingPath (url, localstorage, indexeddb, ...) to load the model.

    • data: Data

      The Data instance related to this model.

    Returns Model<G>

Properties

data: Data

The data object to format input.

loadingPath: string

The way to load the model with getModel, once loaded this field is never used again.

model: G

The model field or null if getModel has never been called.

Methods

  • Return

    The loaded model instance. If there was no call of getModel, throw an error instead.

    Returns G

  • Loads the model (if it has never been done before) and returns it.

    Returns

    A promise of the loaded model.

    Returns Promise<G>

  • Given a record of mouse features, use both data and model fields to format the record and predict a list of values, each element is a probability corresponding to an element of the dataset to be a bot trajectory.

    Parameters

    • record: Recorder

      The record object with computed mouse features.

    • uniqueDataset: boolean

      An optional boolean, if true then we reshape the dataset to have a single element with all our data, so the returned list should have a single element (a single prediction), otherwise the model predict element by element and returns the prediction array. All models do not support modified input shape.

    Returns Promise<number[]>

Generated using TypeDoc