Home Reference Source
import Datapoint from '@jsmlt/jsmlt/src/data/datapoint.js'
public class | source

Datapoint

Datapoint in a dataset, with features and possibly a class index. Can be used as the model for UI data points.

Constructor Summary

Public Constructor
public

constructor(features: Array<number>)

Constructor.

Member Summary

Public Members
public
public
public

Method Summary

Public Methods
public

getClassIndex(): mixed

Get the class index of this data point.

public

Check whether the data point is marked.

public

setClassIndex(classIndex: mixed)

Change the class index of this data point.

public

setMarked(marked: boolean)

Change the "marked" status of this data point.

Public Constructors

public constructor(features: Array<number>) source

Constructor. Load data point features.

Params:

NameTypeAttributeDescription
features Array<number>

Data point features array

Public Members

public classIndex: * source

public features: * source

public marked: boolean source

Public Methods

public getClassIndex(): mixed source

Get the class index of this data point.

Return:

mixed

Class index

public isMarked(): boolean source

Check whether the data point is marked.

Return:

boolean

Whether the data point is marked

public setClassIndex(classIndex: mixed) source

Change the class index of this data point.

Params:

NameTypeAttributeDescription
classIndex mixed

New class index

public setMarked(marked: boolean) source

Change the "marked" status of this data point. Can be used for e.g. support vectors.

Params:

NameTypeAttributeDescription
marked boolean

Whether the data point should be marked or not