Training Your Own Small Machine Learning Model from Scratch

Training a genuinely small, task-specific machine learning model from scratch is far more approachable than training an LLM — a realistic weekend project with standard tools, not something requiring a research lab’s resources.

from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
import pandas as pd

data = pd.read_csv('customer_churn.csv')
X = data.drop('churned', axis=1)
y = data['churned']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

model = RandomForestClassifier(n_estimators=100)
model.fit(X_train, y_train)

predictions = model.predict(X_test)
print(classification_report(y_test, predictions))

Why Small, Task-Specific Models Still Make Sense

For a well-defined, narrow prediction task (churn prediction, fraud flagging, demand forecasting) with structured, tabular data, a small model trained on your own genuinely relevant data frequently outperforms a general-purpose LLM applied to the same task — and it’s dramatically cheaper and faster to run, with fully predictable, explainable behavior appropriate for regulated or high-stakes decisions.

The Real Time Investment

The genuine bottleneck for a small custom model is almost never the training code itself (a handful of lines, as shown above) — it’s collecting, cleaning, and correctly labeling a sufficient, representative dataset, which routinely takes far longer than the actual model training step.