Class MachineLearningLogisticRegression

Machine Learning Linear Regression with Tensorflow

Implements

Hierarchy

Constructors

Properties

compiled: boolean
getInputShape: ((...args: any[]) => any)

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

getTimeseriesShape?: ((x_timeseries: undefined | NestedArray<any>) => Shape)

Type declaration

    • (x_timeseries: undefined | NestedArray<any>): Shape
    • Parameters

      • x_timeseries: undefined | NestedArray<any>

      Returns Shape

layers?: TensorScriptLayers | TensorScriptSavedLayers
loss?: number
model: any
reshape: ((...args: any[]) => any)

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

scikit: any
settings: TensorScriptOptions
tf: any
tokenizer: any
trained: boolean
type: string
xShape?: number[]
yShape?: number[]

Methods

  • calculate(input_matrix: Matrix | Vector, options?: PredictionOptions): any
  • Predicts new dependent variables

    Returns

    returns tensorflow prediction

    Parameters

    • input_matrix: Matrix | Vector
    • Optional options: PredictionOptions

      model prediction options

    Returns any

  • explain(): { coefficients: any; intercept: any }
  • exportConfiguration(): TensorScriptContext
  • importConfiguration(configuration: TensorScriptContext): void
  • loadModel(options: string): Promise<any>
  • predict(input_matrix?: Matrix | Vector | PredictionOptions | InputTextArray, options?: PredictionOptions): Promise<any>
  • Returns prediction values from tensorflow model

    Returns

    predicted model values

    Parameters

    • Optional input_matrix: Matrix | Vector | PredictionOptions | InputTextArray

      new test independent variables

    • Optional options: PredictionOptions

    Returns Promise<any>

  • saveModel(options: string): Promise<any>
  • train(x_matrix: Matrix, y_matrix: Matrix): Promise<any>
  • Asynchronously trains tensorflow model

    Returns

    returns trained tensorflow model

    Parameters

    • x_matrix: Matrix

      independent variables

    • y_matrix: Matrix

      dependent variables

    Returns Promise<any>

  • getInputShape(matrix?: any): Shape
  • Returns the shape of an input matrix

    Function

    Example

    const input = [
    [ 0, 1, ],
    [ 1, 0, ],
    ];
    TensorScriptModelInterface.getInputShape(input) // => [2,2]

    See

    Returns

    returns the shape of a matrix (e.g. [2,2])

    Parameters

    • matrix: any = []

      input matrix

    Returns Shape

  • reshape(array: Vector, shape: Shape): Matrix | Vector
  • Reshapes an array

    Function

    Example

    const array = [ 0, 1, 1, 0, ];
    const shape = [2,2];
    TensorScriptModelInterface.reshape(array,shape) // =>
    [
    [ 0, 1, ],
    [ 1, 0, ],
    ];

    Returns

    returns a matrix with the defined shape

    Parameters

    • array: Vector

      input array

    • shape: Shape

      shape array

    Returns Matrix | Vector