Protected
Readonly
batchProtected
Readonly
consoleProtected
Readonly
dataProtected
Readonly
epochProtected
Readonly
nameProtected
Readonly
namePrivate
randomProtected
Readonly
useGets a sample of test data and returns the model output, with some basic operations to reshape the output as 1d tensor.
A list of two elements that are 1d tensors corresponding to a list [b1, b2, ...]. These two list are 0-1 lists for each batch element to be a bot trajectory (1 means bot).
The batch size for the sample.
Get prediction and labels and return the accuracy per class.
The model prediction reshaped as 1D tensor of 0 (human) or 1 (bot).
The true labels, 1d tensor of 0 or 1.
Get prediction and labels and return the confusion matrix.
The model prediction reshaped as 1D tensor of 0 (human) or 1 (bot).
The true labels, 1d tensor of 0 or 1.
Run the entire model logic, including loading (if nameToLoad is not null), load all data, train the model, save it (if nameToSave is not null), test it and show all additional information with tfjs-vis or in the console.
Get the model prediction batch and its corresponding labels as 1D tensors and show with tfjs-vis or in console (according to useTfjsVis and consoleInfo) the accuracy of each class and the confusion matrix.
The model prediction reshaped as 1D tensor of 0 (human) or 1 (bot).
The true labels, 1d tensor of 0 or 1.
Default to "validation", used in the container name of tfjs-vis.
Generated using TypeDoc
A class that represents a RandomForest factory, for training and saving. The training can be done multiple times if epoch is strictly greater than 1, but it is not relevant since it resets the trees.
Data must be 2d arrays, so the code reshapes data to have bigger chunks and remove one dimension.