Function
Static Public Summary | ||
public |
avgPoints(pointArr: array, pointSums: array): array Returns the average of x values and y values in a 2 dimensional array |
|
public |
Returns a value that, when multiplied with variable, weight, and error arguments, will result in a value of the same magnitude as the result argument. |
|
public |
balanceMagnitudeArray(inputArr: array[number], weightArr: array[number], error: number): array[number] Returns an array of values that, when multiplied with variable, weight, and error arguments, will result in a value of the same magnitude as the result argument. |
|
public |
cummulativeAvgPoints(input: number | array[numbers], cummulativeAvg: number, cummulativeN: number): number Returns average value of the given input and a previously calculated average |
|
public |
cummulativeRangePoints(input: number | array[numbers], cummulativeRange: array[numbers]): array Returns range of the given inputs and a previously calculated range |
|
public |
Returns an error value from inputs and weights |
|
public |
Returns an expected result using supplied inputs and weights |
|
public |
gradientStep(weightArr: array[numbers], input: array[numbers], error: number, learningRateArr: array[number]): array Returns a new set of weights |
|
public |
interceptOLS(lineObj: object, avg: array): number Returns the intercept for a line of an Ordinary Least Squares regression |
|
public |
meanSquaredErrors(pointArr: array, lineObj: object): number Returns the MSE of a 2D coordinate array |
|
public |
ols_regression(pointArr: *): object Returns an object representing the ordinary least squares line |
|
public |
sigmoidCurve(x: number): number Returns the position x in a sigmoid curve |
|
public |
Returns the position x in a derivative sigmoid curve |
|
public |
sumPoints(pointArr: array): array Returns the sum of x values and y values in a 2 dimensional array |
|
public |
sumSquaredErrors(pointArr: array, lineObj: object): number Returns the SSE (sum of squared errors) for a 2D coordinate array |
|
public |
sumSquaredResiduals(pointArr: array, avg: array): number Returns the SSR (sum of squared residuals) for a 2D coordinate array |
Static Public
public avgPoints(pointArr: array, pointSums: array): array source
import {avgPoints} from 'viktor/lib/utils/1D/avgPoints/avgPoints.js'
Returns the average of x values and y values in a 2 dimensional array
Params:
Name | Type | Attribute | Description |
pointArr | array | An array containing all coordinate points |
|
pointSums | array | An array containing the computed sum of all x values and all y values |
Return:
array | An array containing the average x value and y value of the pointArr |
public balanceMagnitude(result: number, variable: number, weight: number, error: number): number source
import {balanceMagnitude} from 'viktor/lib/utils/0D/balanceMagnitude/balanceMagnitude.js'
Returns a value that, when multiplied with variable, weight, and error arguments, will result in a value of the same magnitude as the result argument.
Return:
number | An integer representing the power of 10 value that would balance result with the product of all other arguments |
public balanceMagnitudeArray(inputArr: array[number], weightArr: array[number], error: number): array[number] source
import {balanceMagnitudeArray} from 'viktor/lib/utils/1D/balanceMagnitudeArray/balanceMagnitudeArray.js'
Returns an array of values that, when multiplied with variable, weight, and error arguments, will result in a value of the same magnitude as the result argument.
Params:
Name | Type | Attribute | Description |
inputArr | array[number] | an array of y and x values representing a potential input. |
|
weightArr | array[number] | an array of weights. |
|
error | number | the error associated with the current gradient step. |
Return:
array[number] | An array representing the power of 10 values that would balance results with the product of all other arguments |
public cummulativeAvgPoints(input: number | array[numbers], cummulativeAvg: number, cummulativeN: number): number source
import {cummulativeAvgPoints} from 'viktor/lib/utils/1D/cummulativeAvgPoints/cummulativeAvgPoints.js'
Returns average value of the given input and a previously calculated average
Params:
Name | Type | Attribute | Description |
input | number | array[numbers] | A number or array representing the values to be averaged |
|
cummulativeAvg | number | A value representing the current average of values seen up until this point |
|
cummulativeN | number | A value representing the number of values seen up until this point |
public cummulativeRangePoints(input: number | array[numbers], cummulativeRange: array[numbers]): array source
import {cummulativeRangePoints} from 'viktor/lib/utils/1D/cummulativeRangePoints/cummulativeRangePoints.js'
Returns range of the given inputs and a previously calculated range
Params:
Name | Type | Attribute | Description |
input | number | array[numbers] | A number or array representing the values to be evaluated |
|
cummulativeRange | array[numbers] | A array representing the current range of values seen up until this point |
Return:
array | A range of the given inputs |
public evalError(inputArr: array[numbers], weightArr: array[numbers]): number source
import {evalError} from 'viktor/lib/utils/1D/evalError/evalError.js'
Returns an error value from inputs and weights
Params:
Name | Type | Attribute | Description |
inputArr | array[numbers] | An array representing the values to be evaluated, with the y value in the [0] position |
|
weightArr | array[numbers] | An array representing the weights to be used with the values, with b0 in the [0] position |
public evalGuess(input: array[numbers], weightArr: array[numbers]): number source
import {evalGuess} from 'viktor/lib/utils/1D/evalGuess/evalGuess.js'
Returns an expected result using supplied inputs and weights
Params:
Name | Type | Attribute | Description |
input | array[numbers] | An array representing x and y values |
|
weightArr | array[numbers] | An array representing weights used to estimate a y value |
public gradientStep(weightArr: array[numbers], input: array[numbers], error: number, learningRateArr: array[number]): array source
import {gradientStep} from 'viktor/lib/utils/1D/gradientStep/gradientStep.js'
Returns a new set of weights
Params:
Name | Type | Attribute | Description |
weightArr | array[numbers] | An array of numbers representing estimated weights, with b0 in the [0] position |
|
input | array[numbers] | An array of numbers representing the original inputs in some way, with y in the [0] position |
|
error | number | A number representing an error value pointing in the direction of the next gradient step |
|
learningRateArr | array[number] | An array of numbers representing the magnitudes of changes in the weights |
Return:
array | A new set of weights |
public interceptOLS(lineObj: object, avg: array): number source
import {interceptOLS} from 'viktor/lib/ordinaryLeastSquares/interceptOLS/interceptOLS.js'
Returns the intercept for a line of an Ordinary Least Squares regression
Params:
Name | Type | Attribute | Description |
lineObj | object | An object containing at least a b1 property with the value of the expected slope |
|
avg | array | An array containing a y value at [1] and an x value at position [0] |
public meanSquaredErrors(pointArr: array, lineObj: object): number source
import {meanSquaredErrors} from 'viktor/lib/utils/1D/meanSquaredErrors/meanSquaredErrors.js'
Returns the MSE of a 2D coordinate array
Params:
Name | Type | Attribute | Description |
pointArr | array | An array containing all coordinate points |
|
lineObj | object | An object containing the b1 and b0 weights for an OLS regression |
public ols_regression(pointArr: *): object source
import {ols_regression} from 'viktor/lib/ordinaryLeastSquares/ols_regression/ols_regression.js'
Returns an object representing the ordinary least squares line
Params:
Name | Type | Attribute | Description |
pointArr | * |
public sigmoidCurve(x: number): number source
import {sigmoidCurve} from 'viktor/lib/curves/sigmoidCurve/sigmoidCurve.js'
Returns the position x in a sigmoid curve
Params:
Name | Type | Attribute | Description |
x | number | An x value along the sigmoid curve |
public sigmoidDerivative(x: number): number source
import {sigmoidDerivative} from 'viktor/lib/curves/sigmoidDerivative/sigmoidDerivative.js'
Returns the position x in a derivative sigmoid curve
Params:
Name | Type | Attribute | Description |
x | number | An x value along the derivative sigmoid curve |
public sumPoints(pointArr: array): array source
import {sumPoints} from 'viktor/lib/utils/1D/sumPoints/sumPoints.js'
Returns the sum of x values and y values in a 2 dimensional array
Params:
Name | Type | Attribute | Description |
pointArr | array | An array containing all coordinate points |
Return:
array | An array containing the sums of x values and y values of the pointArr |
public sumSquaredErrors(pointArr: array, lineObj: object): number source
import {sumSquaredErrors} from 'viktor/lib/utils/1D/sumSquaredErrors/sumSquaredErrors.js'
Returns the SSE (sum of squared errors) for a 2D coordinate array
Params:
Name | Type | Attribute | Description |
pointArr | array | An array containing a set of coordinate points |
|
lineObj | object | An object containing the b1 and b0 weights for an OLS regression |
Return:
number | A number representing the SSE of the points in pointArr given the line specified by lineObj |
public sumSquaredResiduals(pointArr: array, avg: array): number source
import {sumSquaredResiduals} from 'viktor/lib/utils/1D/sumSquaredResiduals/sumSquaredResiduals.js'
Returns the SSR (sum of squared residuals) for a 2D coordinate array
Params:
Name | Type | Attribute | Description |
pointArr | array | An array containing a set of coordinate points |
|
avg | array | An array containing the average of all y values and all x values |