Cookie Consent
Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent.
Read our Privacy Policy

Model Selection

Model selection is a process in machine learning and statistics where the best model is chosen from a set of potential candidate models. The chosen model is the one that both fits the data well and has the optimal level of complexity, balancing the trade-off between bias and variance. The ultimate goal of model selection is to identify the model that will perform the best on unseen data.

How Model Selection works

The model selection process begins by choosing a set of candidate models. These models can vary in terms of their complexity (number of parameters), type (linear, non-linear), and features included.

Next, each of these models is evaluated based on their performance on the given dataset. There are several techniques for this, including:

  • Train/Test Split: The dataset is divided into a training set and a test set. The model is trained on the training set and evaluated on the test set. The model with the best performance on the test set is chosen.
  • Cross-Validation: The dataset is divided into several subsets. The model is trained on all but one of these subsets and evaluated on the remaining subset. This process is repeated for each subset, and the model with the best average performance is chosen.

The selected model is the one that minimizes the prediction error on new unseen data. It’s important to note, however, that model selection is based on estimates and assumptions, so the "best" model may not always be the most accurate or useful model for every situation.

Lakera LLM Security Playbook
Learn how to protect against the most common LLM vulnerabilities

Download this guide to delve into the most common LLM security risks and ways to mitigate them.

Related terms
untouchable mode.
Get started for free.

Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.

Join our Slack Community.

Several people are typing about AI/ML security. 
Come join us and 1000+ others in a chat that’s thoroughly SFW.