Skip to content
View kirilklein's full-sized avatar
:octocat:
:octocat:

Block or report kirilklein

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
kirilklein/README.md

Kiril Klein

ML Engineer · NLP & LLMs · Causal Inference · PhD

Website LinkedIn Google Scholar Email

I build ML systems end to end, from data preparation and training to deployment and evaluation.
My work spans NLP and LLMs, transformers for longitudinal health records, and causal inference.
I like open-source tools that make hard methods easier to apply and explore.


Open source

  • Causal Sandbox (source): learn causal inference in the browser. Guided lessons and a simulator with confounders, mediators, colliders and six estimators, checked against the known true effect.
  • CausalEstimate (source): a Python library for treatment-effect estimation from propensity scores and outcome predictions. IPW, AIPW, TMLE, matching, bootstrap confidence intervals.
  • BONSAI and BONSAI Causal: a framework for training transformers on electronic health records, and its extension for causal effect estimation. Main developer.
  • statsmodels: four merged pull requests to TreatmentEffect, adding overlap and balance diagnostics and ATET/ATC for AIPW, and fixing propensity clipping and the GMM moment conditions.

Work

  • Machine Learning Engineer, Aiomic (Copenhagen, 2025 to now). Designed and built the ML system for clinical document analysis from scratch and brought it into production. It combines gradient boosting, fine-tuned encoder transformers and LLMs in one workflow, and returns the supporting document excerpts for specialist review.
  • PhD, University of Copenhagen (2022 to 2026). Scalable Causal Inference on Electronic Health Records Using Transformers. A method for estimating causal drug effects from the longitudinal records of more than 2 million patients, built for drug-safety screening in PHAIR, a project involving the Danish Medicines Agency.

Selected publications

Full list on Google Scholar.


Python · PyTorch / Lightning · Hugging Face Transformers · scikit-learn · Hydra · Dask · Docker · Azure ML · GitHub Actions

Some professional work lives under my work account, @kvk-cmd.

Pinned Loading

  1. causal-sandbox causal-sandbox Public

    Learn causal inference by changing the world. Guided lessons and a sandbox with confounders, mediators, colliders, and six estimators, live in the browser

    JavaScript 4

  2. FGA-DIKU/BONSAI FGA-DIKU/BONSAI Public

    A BERT-based framework for processing and analyzing Electronic Health Records (EHR) data. It provides an end-to-end pipeline for data preprocessing, model training, and clinical outcome prediction.

    Python 12 6

  3. mikkelfo/CORE-BEHRT mikkelfo/CORE-BEHRT Public

    Jupyter Notebook 19 5

  4. CausalEstimate CausalEstimate Public

    Lightweight causal inference from precomputed propensity scores and outcome predictions: IPW, AIPW, TMLE, matching, bootstrap CIs. Pandas-native.

    Python 2 3

  5. bonsai-causal bonsai-causal Public

    BONSAI Causal: transformer (ModernBERT) pipeline for EHR data in MEDS format, extended for causal inference — cohort matching, joint exposure/outcome finetuning, calibration, IPW/AIPW/TMLE effect e…

    Python 2 2

  6. awesome-learning-with-ai awesome-learning-with-ai Public

    Tools for learning a technical concept with AI. Each one gives you something to manipulate, or tests what you know.

    JavaScript