Skip to content

Machine Learning

A predictive analysis needs a defined target population and an evaluation that represents new observations. This section uses Python to prepare tabular and sequence data, compare models without leakage, and interpret their predictions. The examples cover linear models, tree ensembles, neural networks, and foundation models without assuming that one family wins on every dataset.

  • Python throughout. scikit-learn for the workflow, XGBoost / LightGBM / CatBoost for the models, PyTorch for deep learning.
  • Every result is real. All code runs in a container in a companion repository. The numbers and figures come from those runs. A few tools with heavy or conflicting dependencies (AutoML, TabPFN) are marked reference only.
  • Each guide teaches the decision. When to use a method, how to avoid the common traps, how to read the output, and where it fails.

Choose the evaluation before the algorithm

Section titled “Choose the evaluation before the algorithm”
Intended use Decision to make first
Predict for new patients Keep each patient’s measurements in one partition. See cross-validation.
Predict a later event Keep future observations outside the available history. A random row split answers a different question.
Predict from tables with missing values and categories Fit all preprocessing within training partitions. See scikit-learn pipelines.
Act on a predicted probability Evaluate probability quality and select the threshold using development data. See model evaluation.
Compare a pretrained model with a conventional model Use the same partitions, metrics, and information access. See foundation model evaluation.

The complete workflow uses generated independent rows to teach the sequence. It is not an external biological validation. Its model ranking applies to that example.