LD
ML for Research

Machine Learning for Language Research

Interactive explainers of the models behind my research, written for language researchers. Every module uses linguistic feature names and synthetic data, labeled as such.

Coefficients & Logistic Regression

Synthetic data

A logistic model draws a straight boundary between two groups and reports one coefficient per feature. The coefficient's sign says which group a feature favors; its exponential is an odds ratio, the interpretable currency of much applied-linguistics modeling.

Loading interactive…

Implementation informed by scikit-learn documentation (Pedregosa et al., 2011).

See coefficients in my research (Kim & Römer-Barron, 2025)

Support Vector Machine

Synthetic data

An SVM chooses the boundary that maximizes the margin to the nearest points; only those support vectors matter. The C parameter trades margin width against training errors, and the RBF kernel bends the boundary for non-linear structure.

Loading interactive…

Cortes & Vapnik (1995); SMO: Platt (1998); scikit-learn docs consulted (Pedregosa et al., 2011).

SVM in my research: 95.74% accuracy (Kim & Römer-Barron, 2025)

Decision Tree → Random Forest

Synthetic data

A single tree carves the feature space with axis-aligned splits and overfits easily. A random forest fits many trees on bootstrap resamples and averages them: variance drops and the boundary smooths as trees are added.

Loading interactive…

Breiman (2001); CART: Breiman et al. (1984).

XGBoost: Gradient-Boosted Trees

Synthetic data

Boosting builds the model in rounds: each new depth-2 tree is fitted to the residuals of the current ensemble and added with learning rate η, its leaf weights shrunk by regularization λ. Watch the residuals drain and the held-out error turn when it overfits.

Loading interactive…

Chen & Guestrin (2016); Friedman (2001).

SHAP: SHapley Additive exPlanations

Synthetic data

SHAP assigns each feature a fair share of one specific prediction, summing from the model's base rate to the final output. The waterfall below explains one synthetic learner text: which features pushed the prediction up, which pulled it down.

Loading interactive…

Lundberg & Lee (2017). Values computed offline from a logistic model; exact in log-odds space for linear models.

LIME: Local Interpretable Model-agnostic Explanations

Synthetic data

LIME perturbs the input, watches how a black-box model reacts, and fits a small local surrogate whose weights are readable. For text, the perturbations are word deletions, so each word gets a local importance.

Loading interactive…

Ribeiro, Singh & Guestrin (2016).

Contextual Embeddings (BERT & S-BERT)

Synthetic data

What do contextual embeddings actually encode? The same word in different contexts gets different vectors, so word senses separate; whole sentences become single vectors whose cosine similarity tracks paraphrase. All values precomputed offline; no models run on this page.

Loading interactive…

Devlin et al. (2019); Reimers & Gurevych (2019). Precomputed offline: bert-base-uncased & all-MiniLM-L6-v2 (Xenova q8).