# Class ModelInstance

Model Class

- Defined in packages/saltcorn-data/models/model_instance.ts:16

##### Index

### Constructors

constructor

### Properties

fit_object
hyperparameters
id?
is_default
metric_values
model_id
name
parameters
report
state
trained_on

### Accessors

toJson

### Methods

delete
make_default
predict
update
create
find
findOne

## Constructors

### constructor

- new ModelInstance(o: ModelInstance | ModelInstanceCfg): ModelInstance

  ModelInstance constructor

  #### Parameters

  - o: ModelInstance | ModelInstanceCfg

  #### Returns ModelInstance

  - Defined in packages/saltcorn-data/models/model_instance.ts:33

## Properties

### fit_object

fit_object: Buffer

- Defined in packages/saltcorn-data/models/model_instance.ts:26

### hyperparameters

hyperparameters: GenObj

- Defined in packages/saltcorn-data/models/model_instance.ts:21

### `Optional` id

id?: number

- Defined in packages/saltcorn-data/models/model_instance.ts:17

### is_default

is_default: boolean

- Defined in packages/saltcorn-data/models/model_instance.ts:27

### metric_values

metric_values: any

- Defined in packages/saltcorn-data/models/model_instance.ts:24

### model_id

model_id: number

- Defined in packages/saltcorn-data/models/model_instance.ts:19

### name

name: string

- Defined in packages/saltcorn-data/models/model_instance.ts:18

### parameters

parameters: any

- Defined in packages/saltcorn-data/models/model_instance.ts:25

### report

report: string

- Defined in packages/saltcorn-data/models/model_instance.ts:23

### state

state: GenObj

- Defined in packages/saltcorn-data/models/model_instance.ts:20

### trained_on

trained_on: Date

- Defined in packages/saltcorn-data/models/model_instance.ts:22

## Accessors

### toJson

- get toJson(): any

  #### Returns any

  - Defined in packages/saltcorn-data/models/model_instance.ts:100

## Methods

### delete

- delete(): Promise<void>

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/model_instance.ts:133

### make_default

- make_default(disable?: boolean): Promise<void>

  #### Parameters

  - `Optional` disable: boolean

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/model_instance.ts:161

### predict

- predict(rows: Row[]): Promise<any>

  #### Parameters

  - rows: Row[]

  #### Returns Promise<any>

  - Defined in packages/saltcorn-data/models/model_instance.ts:149

### update

- update(row: Partial<ModelInstance>): Promise<void>

  #### Parameters

  - row: Partial<ModelInstance>

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/model_instance.ts:144

### `Static` create

- create(lib_in: ModelInstanceCfg): Promise<ModelInstance>

  #### Parameters

  - lib_in: ModelInstanceCfg

  #### Returns Promise<ModelInstance>

  - Defined in packages/saltcorn-data/models/model_instance.ts:61

### `Static` find

- find(where: Where, selectopts?: SelectOptions): Promise<ModelInstance[]>

  #### Parameters

  - where: Where
  - `Optional` selectopts: SelectOptions

  #### Returns Promise<ModelInstance[]>

  - Defined in packages/saltcorn-data/models/model_instance.ts:110

### `Static` findOne

- findOne(where: Where, selectopts?: SelectOptions): Promise<ModelInstance>

  #### Parameters

  - where: Where
  - `Optional` selectopts: SelectOptions

  #### Returns Promise<ModelInstance>

  - Defined in packages/saltcorn-data/models/model_instance.ts:122