    import PredictionService from 'pvbid-sdk/src/domain/services/PredictionService.js'

public class | source

# PredictionService

## Constructor Summary

Public Constructor
public | constructor() |

## Member Summary

Public Members
public | bid: * |

## Method Summary

Public Methods
public | evaluateModel(model: object): number | null Evaluates a single prediciton model |
public | evaluateModels(models: object[]): number Evaluates all the given models and returns a weighted average of the significant results |
public | getContributionWeight(lineItemDefId: number): number Retrieves the contribution weight for the line item |
public | getCostPredictionModels(lineItemDefId: number): Object[] Retrieves a list of cost prediction models |
public | getLaborPredictionModels(lineItemDefId: number): Object[] Retrieves a list of labor prediction models |
public | getPredictionDependencies(lineItemDefId: number): bidEntity[] Gets the dependencies used in the prediction models for the given line item def id |
public | hasPredictionModels(lineItemDefId: number): boolean Determines if the line item has prediction models by its def Id. |

## Public Constructors

### public constructor() source

## Public Members

### public bid: * source

## Public Methods

### public evaluateModel(model: object): number | null source

Evaluates a single prediciton model

#### Params:

Name | Type | Attribute | Description
model | object |  | A prediciton model to evaluate

#### Return:

number | null | The result of evaluating the model

### public evaluateModels(models: object[]): number source

Evaluates all the given models and returns a weighted average of the significant results

#### Params:

Name | Type | Attribute | Description
models | object[] |  | The models to evaluate

#### Return:

number | The weighted avg of evaluating the given models

### public getContributionWeight(lineItemDefId: number): number source

Retrieves the contribution weight for the line item

#### Params:

Name | Type | Attribute | Description
lineItemDefId | number |  | The line item definition id to get the contribution weight for

#### Return:

number | The contribution weight

### public getCostPredictionModels(lineItemDefId: number): Object[] source

Retrieves a list of cost prediction models

#### Params:

Name | Type | Attribute | Description
lineItemDefId | number |  | The line item definition id to get models for

#### Return:

Object[] | cost prediction models

### public getLaborPredictionModels(lineItemDefId: number): Object[] source

Retrieves a list of labor prediction models

#### Params:

Name | Type | Attribute | Description
lineItemDefId | number |  | The line item definition id to get models for

#### Return:

Object[] | labor prediction models

### public getPredictionDependencies(lineItemDefId: number): bidEntity[] source

Gets the dependencies used in the prediction models for the given line item def id

#### Params:

Name | Type | Attribute | Description
lineItemDefId | number |  | The line item definition id to get dependencies for

#### Return:

bidEntity[] | The prediction model dependencies

### public hasPredictionModels(lineItemDefId: number): boolean source

Determines if the line item has prediction models by its def Id. Line item defs might not have prediction models if they have been created since the last time the regression was run or if there was not enough data for the regression to generate a model.

#### Params:

Name | Type | Attribute | Description
lineItemDefId | number |  |

#### Return:

boolean