Home Reference Source

References

arrays

summary
public

F abs(A: Array<mixed>): Array<mixed>

Get a copy of an array with absolute values of the original array entries.

public

F argFilter(array: Array<mixed>, callback: function(element: mixed, !index: Number): boolean): Array<number>

Filter an array and return the array indices where the filter was matched.

public

F argMax(array: Array<number>): number

Get array key corresponding to largest element in the array.

public

F argSort(array: Array<mixed>, compareFunction: function(a: mixed, b: mixed): Number): Array<number>

Sort an array and return the array indices of the sorted elements.

public

F concatenate(axis: number, S: ...Array<mixed>): Array

Concatenate two or more n-dimensional arrays.

public

Calculate dot product of two vectors.

public

F equal(array1: Array<mixed> | mixed, array2: Array<mixed> | mixed): boolean

Deep check whether two arrays are equal: sub-arrays will be traversed, and strong type checking is enabled.

public

F fill(A: Array<mixed>, value: mixed): Array<mixed>

Set all entries in an array to a specific value and return the resulting array.

public

F flatten(A: Array<mixed>): Array<mixed>

Recursively flatten an array.

public

F full(shape: Array<number>, value: mixed): Array<mixed>

Initialize an n-dimensional array of a certain value.

public

F getArrayElement(A: Array<mixed>, index: Array<number>): mixed

Get an arbitrary element from an array, using another array to determine the index inside the first array.

public

F getShape(A: Array<mixed>): Array<number>

Find the shape of an array, i.e.

public

Sum all elements of an array.

public

Generate n points on the interval (a,b), with intervals (b-a)/(n-1).

public

Generate a mesh grid, i.e.

public

F norm(x: Array<number>): *

Calculate the Euclidian norm of a vector.

public

F pad(A: Array<mixed>, paddingLengths: Array<number>|Array<Array.<number>>, paddingValues: Array<number>|Array<Array.<number>>, axes: Array<number>): Array<mixed>

Pad an array along one or multiple axes.

public

F permuteAxes(A: Array<mixed>, newAxes: Array<number>): Array<mixed>

Permute the axes of an input array.

public

F power(A: Array<mixed>, y: number | Array<number>): Array<mixed>

Raise all elements in an array to some power.

public

F repeat(axis: number, numRepeats: number, A: Array<mixed>): Array<mixed>

Repeat an array multiple times along an axis.

public

F reshape(A: Array<mixed>, shape: Array<number>): Array<mixed>

Reshape an array into a different shape.

public

F scale(A: Array<mixed>, c: number): Array<mixed>

Multiply each element of an array by a scalar (i.e.

public

F setArrayElement(A: Array<mixed>, index: Array<number>, value: mixed): *

Set an arbitrary element in an array, using another array to determine the index inside the array.

public

F shuffle(S: ...Array<mixed>): Array<Array<mixed>>

Randomly shuffle multiple arrays in the primary (first) axis.

public

F slice(A: Array<mixed>, start: Array<number>, stop: Array<number>): Array<mixed>

Take a slice out of an input array.

public

F subBlock(A: Array<mixed>, offset: Array<number>, shape: Array<number>): Array<mixed>

this function was deprecated. Use slice() instead

Extract a sub-block of a matrix of a particular shape at a particular position.

public

F sum(S: ...Array<mixed>): Array<mixed>

Calculate element-wise sum of two or more arrays.

public

Get the transpose of a matrix or vector.

public

F unique(array: Array<mixed>): Array<mixed>

Get unique elements in array

public

F valueCounts(array: Array<mixed>): Array<Array<mixed>>

Count the occurrences of the unique values in an array

public

F valueVector(n: number, value: mixed): *

Initialize a vector of a certain length with a specific value in each entry.

public

F wrapSlice(array: Array<mixed>, begin: number, end: number): Array<mixed>

Take a slice out of an array, but wrap around the beginning an end of the array.

public

F zeros(shape: Array<number>): Array<mixed>

Initialize an n-dimensional array of zeros.

public

F zipWithIndex(array: Array<mixed>): Array<Array<mixed>>

From an input array, create a new array where each element is comprised of a 2-dimensional array where the first element is the original array entry and the second element is its index

classification

summary
public

The decision boundary module calculates decision boundaries for a trained classifier on a 2-dimensional grid of points.

data

summary
public

Datapoint in a dataset, with features and possibly a class index.

public

Container of data points for a single data set.

datasets

summary
public

F loadDatasetFromCSV(input: string, callback: function(X: Array<Array<number>>, y: Array<number>))

Load a dataset (features and target) from some CSV input string.

public

Load a dataset from a remote CSV file.

public

F loadIris(callback: function(X: Array<Array<number>>, y: Array<number>))

Load the iris dataset.

kernel

summary
public

C Kernel

Base class for kernels, which calculate some distance metric between two data points

public

The Gaussian kernel, also known as the radial basis function (RBF) kernel

public

The linear kernel calculates the dot product of the two input vectors

public

The Polynomial kernel.

public

The Sigmoid kernel.

model-selection

summary
public

F trainTestSplit(input: Array<Array<mixed>>, optionsUser: Object): Array

Split a dataset into a training and a test set.

preprocessing

summary
public

Encoder of categorical values to integers.

random

summary
public

F rand(a: number, b: number): number

Generate a random number between a lower bound (inclusive) and an upper bound (exclusive).

public

F randint(a: number, b: number, shape: number | Array<number>): number | Array<mixed>

Generate a random integer between a lower bound (inclusive) and an upper bound (exclusive).

public

F sample(input: Array<mixed>, number: number, withReplacement: boolean, weights: Array<number> | string): Array<mixed>

Take a random sample with or without replacement from an array.

public

F sampleFisherYates(input: Array<mixed>, number: number): Array<mixed>

Take a random sample without replacement from an array.

supervised

summary
public

Base class for classifiers.

public

Base class for supervised estimators (classifiers or regression models).

public

Base class for multiclass classifiers using the one-vs-all classification method.

supervised/linear

summary
public

Logistic Regression learner for binary classification problem.

public

Logistic Regression learner for 2 or more classes.

public

Perceptron learner for binary classification problem.

public

Perceptron learner for 2 or more classes.

supervised/neighbors

summary
public

Base class for neighbors-based classifiers such as KNN

public

C KNN

k-nearest neighbours learner.

supervised/neural-network

summary
public

supervised/svm

summary
public

SVM learner for binary classification problem.

public

C SVM

Support Vector Machine (SVM) classification model for 2 or more classes.

supervised/trees

summary
public

Decision tree learner.

public

Decision tree node.

public

Random forest learner.

public
public

ui

summary
public

C Canvas

UI canvas for displaying machine learning results.

public

Data point element to be drawn on the canvas

unsupervised

summary
public

Base class for clustering algorithms.

unsupervised/neighbors

summary
public

C KMeans

k-means clusterer.

util/input-devices

summary
public

F getTouchCoordinate(e: object, coordinate: string): *

Get touch coordinate (x or y) from touchpad input.

summary
public

Perform a binary search in a sorted array A to find the index i such that the search value is larger than or equal to A[i], and strictly smaller than A[i+1].

validation/metrics

summary
public

F accuracy(yTrue: Array<mixed>, yPred: Array<mixed>, normalize: boolean): number

Evaluate the accuracy of a set of predictions.

public

F auroc(yTrue: Array<number>, yPred: Array<mixed>): number

Calculate the area under the receiver-operator characteristic curve (AUROC) for a set of predictions.