> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TrainModel Method of the Trainer Object

Trains the classifier on the input data set. The training and cross-validation parameters should be set up in the properties of the [Trainer](/fine-reader/engine/api-reference/classification-related-objects/trainer) object.

<Note>
  Model training and classification will be performed in sequential mode in Linux and Windows, regardless of the [IMultiProcessingParams::MultiProcessingMode](/fine-reader/engine/api-reference/parameter-objects/multiprocessingparams#multiprocessingmode) value.
</Note>

## Syntax

### C++

```cpp theme={null}
HRESULT TrainModel(
  ITrainingData*     Objects,
  ITrainingResults** Result
);
```

### C\#

```csharp theme={null}
ITrainingResults TrainModel( ITrainingData Objects );
```

### Visual Basic .NET

```vb theme={null}
Function TrainModel(Objects As ITrainingData) As ITrainingResults
```

## Parameters

Objects

\[in] The categorized data set (as a [TrainingData](/fine-reader/engine/api-reference/classification-related-objects/trainingdata) object), on which the classification model should be trained. At least two categories must be represented in the data set.

Result

\[out, retval] A pointer to the ITrainingResults\* pointer variable that receives the interface pointer of the output [TrainingResults](/fine-reader/engine/api-reference/classification-related-objects/trainingresults) object. The results of training include the classification model and the validation results. Currently you can only train a classifier of one type at a time, therefore the collection will contain one [TrainingResult](/fine-reader/engine/api-reference/classification-related-objects/trainingresult) element.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## See also

[Trainer](/fine-reader/engine/api-reference/classification-related-objects/trainer)
