{
  "id": 20898578,
  "title": "Core ML Concepts for Developers: Datasets, Cleaning, Leak-Free Splits, sklearn Pipelines & Evaluation (LightGBM)",
  "url": "https://urgent.news/2026/11/20/core-ml-concepts-for-developers-datasets-cleaning-leak-free-splits",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-20T12:49:24.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kirandeepjassalcrypto/core-ml-concepts-for-developers-datasets-cleaning-leak-free-splits-sklearn-pipelines--2lih"
  },
  "original_language": "en",
  "account": "Core ML Concepts for Developers breaks down the essential steps to building an effective machine learning model. According to the article, the key lies in the dataset, model, and evaluation process, rather than just calling model.fit(X, y) and assuming everything else is handled.\n\nThe data pipeline consists of five steps: raw data, cleaning, splitting, preprocessing, training, and evaluation. Each step has its own pitfalls that can inflate scores if not handled correctly. The right metric to choose depends on the type of problem — accuracy is misleading for imbalanced classification, RMSE for skewed regression, and ROC-AUC for ranking problems.\n\nSklearn's Pipeline and ColumnTransformer are designed to prevent leakage, a major issue that silently inflates scores during training. Manual preprocessing is prone to errors and leads to poor production performance. To validate your model, use a splitting method that mirrors your deployment scenario. For time-series data, time-series cross-validation is required, while group-aware CV is used for tenant-scoped deployments. Random cross-validation on time-series data can give a misleadingly high score.\n\nThe cleaning process handles missing values, duplicates, outliers, and checks class balance. Splitting the data into train, validation, and test sets is crucial to avoid leakage. Leakage occurs when information from the validation or test set leaks into the training process, inflating performance metrics. There are four main leakage failure modes: information leaking into preprocessing, time leakage, group leakage, and target leakage.\n\nPreprocessing should be fit on the training data and then applied to the validation and test sets. This includes scaling numerical features, encoding categorical variables, vectorising text data, and engineering features like date parts, ratios, and lag features. The key to avoiding the 'fantasy' score is to ensure the scaler is fit on the training data only, never on the full dataset before splitting. A Pipeline + ColumnTransformer can help organise this preprocessing step.",
  "summary": "Most \"ML basics\" articles teach you to call model.fit(X, y) and pretend that's the job. The actual job — where 80% of your time goes and 100% of the mistakes happen — is everything around fit : figuring out what your dataset really is, fixing what's broken, splitting it without leaking, picking the right metric, and noticing when your \"great\" model is just memorising garbage. This is the missing…",
  "key_points": [
    "Dataset, cleaning, and evaluation are core ML concepts, not just model.fit(X, y)",
    "sklearn's Pipeline and ColumnTransformer prevent data leakage during preprocessing",
    "Time-series and group-aware CV avoid misleadingly high scores during validation"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}