> For the complete documentation index, see [llms.txt](https://smartpredict.gitbook.io/smartpredict-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smartpredict.gitbook.io/smartpredict-ai/module-reference/core-modules/7.-evaluation-and-fine-tuning/cross-validator-for-ml.md).

# Cross Validator for ML

This module belongs to the ""Evaluation and fine-tuning" category of modules.

## Description

The **Cross Validator** is used for evaluating a Machine Learning model using the cross validation method.                It outputs the relative scores of the model according to your scoring method. You can get the mean, and the standard deviation of the scores with the mean() and std() method of the output.&#x20;

This module has three input ports and one output port.

## The input ports

1. The first input port takes the model to evaluate .
2. The second input port takes the features used for evaluating the model .
3. The third port takes the labels for evaluating the model.

![ The three inputs of the Cross Validator have all to be connected.](https://1833277725-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lyc1OXsKqB2S62LxsOR%2F-M14o_0V5FL6dwqMMBX5%2F-M14pfiK3CT7e_oXQfBt%2Fimage.png?alt=media\&token=03fe9dc3-bd8a-4275-91f6-c771939b3508)

## The output port

![As an output, this port gets back the selected element from the parameters.](https://1833277725-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lyc1OXsKqB2S62LxsOR%2F-M14o_0V5FL6dwqMMBX5%2F-M14rAgHa5Vay4CN2pY0%2Fout%20cross.png?alt=media\&token=04a9f7d3-539a-46f8-80bb-d1241cc078e4)

## Parameters

**Scoring methods** can be set by selecting one from the dropdown :

* Balanced accuracy (Classification) , Average precision,  Brier score loss,  F**1** score , F1 Micro,  F1 Weighted ,  F1 Samples ,Cross entropy Precision, Macro -precision ,Weighted-precision,\
  Sample precision, Recall (Binary Classification ), Macro-recall ,Micro-recall ,Weighted-recall, Samples recall (Multi -label classification ), Adjusted mutual information score (Clustering), Adjusted Rand Index, Completeness score, Fowlkes Mallows score ,Homogeneity Score, Mutual Information score, Normalized information score ,V-measure Cluster (Clustering) ,Explained variance (Regression), Negative mean squared error (Regression), Negative mean squared logarithmic error (Regression) , Negative median absolute (Regression), R2 score (Regression) and more.....

Equally, we can choose what to **output**. This might be : **Scores, Mean, Standard deviation** and **Median.**

:point\_right:N.B :  **K is for k-fold CV**

![We can choose how to score or model  among  the enriched list of methods. ](https://1833277725-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lyc1OXsKqB2S62LxsOR%2F-M14mqY0vWG3YK-RMCOY%2F-M14noiJim7LfpRaxMfp%2FSmartPredict%20\(1\).gif?alt=media\&token=e9a4b650-e80a-44db-ba62-1e7dfd59dd7d)
