A Data class that represents chunks of mouse features selected from the Recorder object. The field xSize is the chunk size, default to 24, and ySize the number of extracted features.
The dataset there is a list of chunks of mouse features.
It can be the case that a chunk is not fully complete after reading the record, if the field shouldCompleteXSize is set to true, we complete it with trailing zeros.
This class takes 8 features :

  1. dx
  2. dy
  3. speedX
  4. speedY
  5. speed
  6. accel
  7. distance
  8. timeDiff

See

Data

Hierarchy

Constructors

Properties

mayNormalizeData: boolean

Boolean to know if we may normalize data. If false, then data must not be normalized, otherwise some operations of the model will fail.

numClasses: 2 | 1

The number of class for labels and model output, 1 or 2 for binary classification.

shouldCompleteXSize: boolean
xSize: number

The second shape of all 3d tensors (or first in case we ignore the batch size), defined in subclasses.

ySize: number

The third shape of 3d tensor (or second in case we ignore the batch size), defined in subclasses.

Methods

  • Protected

    Gets the current array of labels from a dataset and append a new label according to the number of classes numClasses. If there is one class, [0] means human and [1] bot while with two classes, [1,0] means human and [0,1] bot.

    Parameters

    • datasetLabels: number[][]

      The current dataset label array, we add an element to it.

    • userIndex: number

      The index of the class, 0 for human and 1 for bot.

    Returns void

  • Protected

    Return a new chunk element with arbitrary chosen mouse features from the record.

    Parameters

    • line: SingleRecord

      The line of the record with calculated mouse features.

    Returns number[]

  • This method gets a recorder object and loads it as a Dataset object with the right format. The return value might contain empty arrays if the recorder as too few elements. The userIndex is an integer that says what is the class index for the label, in our case of binary classifier human-bot, 0 means human and 1 means bot.

    Parameters

    • recorder: Recorder

      The recorder containing loaded records and features.

    • userIndex: number = -1

      The index of the class from record, if unspecified or negative, the label array of the return object is empty.

    Returns {
        datasetData: number[][][];
        datasetLabels: number[][];
    }

    • datasetData: number[][][]
    • datasetLabels: number[][]

Generated using TypeDoc