Dataset
Container of data points for a single data set.
Constructor Summary
Public Constructor | ||
public |
Initialize object properties. |
Member Summary
Public Members | ||
public |
datapoints: *[] |
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
addDatapoint(features: *): * Add a data point to the data set. |
|
public |
getDataPoints(): * Get all data points from this dataset |
|
public |
getFeaturesArray(): * Extract the features from the datapoints and return them in an n x d array, where |
|
public |
getLabelsArray(): * Extract the labels from the datapoints and return them in an array. |
|
public |
getNumDimensions(): * Get the number of dimensions for the features of data points |
|
public |
isValidDataPoint(datapoint: *): * Check whether a data point is valid. |
|
public |
numDataPoints(): * Get the number of data points in this dataset |
Public Constructors
Public Members
public datapoints: *[] source
Public Methods
public addDatapoint(features: *): * source
Add a data point to the data set. Data point should be an array with the number of dimensions used throughout the dataset.
Params:
Name | Type | Attribute | Description |
features | * | Data point features array |
Return:
* |
public getDataPoints(): * source
Get all data points from this dataset
Return:
* | Array Data points. Array of datapoint objects |
public getFeaturesArray(): * source
Extract the features from the datapoints and return them in an n x d array, where n
is the
number of data points and d
is the number of dimensions (number of features per datapoint).
Return:
* | Array[Array[Number]] Features matrix |
public getLabelsArray(): * source
Extract the labels from the datapoints and return them in an array.
Return:
* | Array[mixed] Labels array |
public getNumDimensions(): * source
Get the number of dimensions for the features of data points
Return:
* | int Dimensionality |
public isValidDataPoint(datapoint: *): * source
Check whether a data point is valid. A valid data point is an array of the correct number of dimensions.
Params:
Name | Type | Attribute | Description |
datapoint | * | Data point to be checked |
Return:
* | bool Whether the data point is valid |
public numDataPoints(): * source
Get the number of data points in this dataset
Return:
* | int Number of data points |