# Class Model

Model Class

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

##### Index

### Constructors

constructor

### Properties

configuration
id?
modelpattern
name
table_id

### Accessors

predictor_function
templateObj
toJson
has_templates

### Methods

delete
get_instances
train_instance
update
create
find
findOne

## Constructors

### constructor

- new Model(o: Model | ModelCfg): Model

  Model constructor

  #### Parameters

  - o: Model | ModelCfg

  #### Returns Model

  - Defined in packages/saltcorn-data/models/model.ts:30

## Properties

### configuration

configuration: any

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

### `Optional` id

id?: number

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

### modelpattern

modelpattern: string

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

### name

name: string

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

### table_id

table_id: number

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

## Accessors

### predictor_function

- get predictor_function(): (arg1?: string | Row, arg2?: Row) => Promise<any>

  #### Returns (arg1?: string | Row, arg2?: Row) => Promise<any>

  - Defined in packages/saltcorn-data/models/model.ts:166

### templateObj

- get templateObj(): ModelPattern | undefined

  #### Returns ModelPattern | undefined

  - Defined in packages/saltcorn-data/models/model.ts:129

### toJson

- get toJson(): any

  #### Returns any

  - Defined in packages/saltcorn-data/models/model.ts:62

### `Static` has_templates

- get has_templates(): boolean

  #### Returns boolean

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

## Methods

### delete

- delete(): Promise<void>

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/model.ts:102

### get_instances

- get_instances(opts?: any): Promise<ModelInstance[]>

  #### Parameters

  - `Optional` opts: any

  #### Returns Promise<ModelInstance[]>

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

### train_instance

- train_instance(
  name: string,
  hyperparameters: any,
  state: {},
  ): Promise<string | ModelInstance>

  #### Parameters

  - name: string
  - hyperparameters: any
  - state: {}

  #### Returns Promise<string | ModelInstance>

  - Defined in packages/saltcorn-data/models/model.ts:137

### update

- update(row: Row): Promise<void>

  #### Parameters

  - row: Row

  #### Returns Promise<void>

  - Defined in packages/saltcorn-data/models/model.ts:118

### `Static` create

- create(lib_in: ModelCfg): Promise<Model>

  #### Parameters

  - lib_in: ModelCfg

  #### Returns Promise<Model>

  - Defined in packages/saltcorn-data/models/model.ts:44

### `Static` find

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

  #### Parameters

  - where: Where
  - `Optional` selectopts: SelectOptions

  #### Returns Promise<Model[]>

  - Defined in packages/saltcorn-data/models/model.ts:82

### `Static` findOne

- findOne(where: Where): Promise<Model>

  #### Parameters

  - where: Where

  #### Returns Promise<Model>

  - Defined in packages/saltcorn-data/models/model.ts:94