LinearRegression is a supervised machine learning model that predicts continuous values (e.g. 1.2, -32, 90, -1.2 and etc. ). It uses iterative calculations to find the best model parameters.
Contains a table of matrices.
ModelParameters[1]: Feature Matrix
ModelParameters[2]: Label Vector / Label Matrix
Create new model object. If any of the arguments are nil, default argument values for that argument will be used.
KNearestNeighbours.new(kValue: integer, distanceFunction: string): ModelObject
kValue: The number of closest data points taken into consideration for majority voting to determine the class of a given data point.
distanceFunction: The distance function to be used to measure the similarity between two data points. Available options are:
Euclidean
Manhattan
Cosine
Set model’s parameters. When any of the arguments are nil, previous argument values for that argument will be used.
KNearestNeighbours:setParameters(kValue: integer, distanceFunction: string)
kValue: The number of closest data points taken into consideration for majority voting to determine the class of a given data point.
distanceFunction: The distance function to be used to measure the similarity between two data points. Available options are:
Euclidean
Manhattan
Cosine
Train the model.
KNearestNeighbours:train(featureMatrix: Matrix, labelVector: Matrix): number[]
featureMatrix: Matrix containing all data.
labelVector: A (n x 1) matrix containing values related to featureMatrix.
Predict the values for given data.
KNearestNeighbours:predict(featureMatrix: Matrix, returnOriginalOutput: boolean): Matrix, Matrix -OR- Matrix
featureMatrix: Matrix containing all data.
returnOriginalOutput: Set whether or not to return predicted matrix instead of value with highest probability.
predictedlabelVector: A vector tcontaining predicted labels generated from the model.
valueVector: A vector that contains the values of predicted labels.
-OR-