পাঠ ০২ · ৩০-এর মধ্যে · মডিউল ১

CRISP-DM ও কাজের পদ্ধতি

CRISP-DM — the data project workflow
৬ মিনিট পড়া মাঝারি · Intermediate Methodology

এই পাঠে যা শিখবেন

  • CRISP-DM-এর ছয়টি ধাপ — কোনটিতে কী হয় ও কেন
  • কেন iterative process linear-এর চেয়ে বাস্তবমুখী
  • কোন ধাপে কত সময় ব্যয় করা উচিত — শিল্প-অনুপাত
  • বাংলাদেশী একটি bKash fraud-detection প্রজেক্ট কীভাবে CRISP-DM follow করে

১ · কেন একটি methodology দরকার

ভাবুন আপনি একটি বাড়ি বানাতে চান — architect বললেন "মাটি দেখে directly ছাদ ঢালি, পরে দেখব দেয়াল কোথায় বসাবো।" — আপনি রাজি হবেন? CRISP-DMCRISP-DMCross-Industry Standard Process for Data Mining। ১৯৯৬-এ ESPRIT consortium-এ জন্ম, এখনো ৭০% ডেটা-প্রজেক্ট এই framework follow করে। SAS, Microsoft, IBM-এর enterprise data tool-এর backbone। ডেটা-প্রজেক্টে সেই blueprint-এর ভূমিকা পালন করে। এটি ছাড়া দলগুলো প্রায়ই data-তে hopping করতে গিয়ে আসল প্রশ্নটাই হারিয়ে ফেলে।

কেন framework দরকার

১) Communication: ৫ জনের team — সবাই একই language-এ কথা বলে।
২) Risk control: ভুল ধাপে atki গেলে আগে চেনা যায়।
৩) Quality assurance: deployment-এ পৌঁছানোর আগে validation।
৪) Reproducibility: ৬ মাস পর কেউ নতুন এসে continue করতে পারবেন।

২ · CRISP-DM-এর ছয়টি ধাপ — overview

১৯৯৬ সালে DaimlerChrysler, SPSS, NCR ও OHRA মিলে এই framework তৈরি করেন। আজও বিশ্বের ৭০% ডেটা প্রজেক্ট এটি অনুসরণ করে। ছয়টি ধাপ:

  1. Business Understanding: "আসলে কী সমস্যা?" — stakeholder, success metric, constraints।
  2. Data Understanding: "কী ডেটা আছে?" — collect, describe, explore, quality check।
  3. Data Preparation: "ডেটা প্রস্তুত করা" — clean, transform, feature engineer।
  4. Modeling: "কোন algorithm সবচেয়ে ভাল?" — multiple model train ও tune।
  5. Evaluation: "মডেল কি business goal পূরণ করছে?" — শুধু accuracy নয়, business value।
  6. Deployment: "মডেলটি কীভাবে production-এ যাবে?" — API, dashboard, monitoring।
CRISP-DM — চক্রাকার ৬ ধাপ Iterative, not linear ১ · Business Understanding ২ · Data Understanding ৩ · Data Preparation ৪ · Modeling ৫ · Evaluation ৬ · Deployment Evaluation → Business (re-frame) Modeling ↔ Data prep যেকোনো ধাপ থেকে আগের ধাপে ফেরা স্বাভাবিক — এটাই iterative process।
CRISP-DM চক্র — প্রতিটি ধাপে শেখা ফিরে আগের ধাপ refine করতে পারে।

৩ · Phase 1: Business Understanding

সবচেয়ে গুরুত্বপূর্ণ এবং সবচেয়ে underrated ধাপ। গবেষণা বলে — যে প্রজেক্টে এখানে যথেষ্ট সময় দেওয়া হয় না, তার ৭০% ব্যর্থ হয়। এই ধাপের output:

  • Business objective: "Daraz-এর monthly churn ১৫% থেকে ১০%-এ কমানো।"
  • Success criteria: "চার মাসে retention rate ≥ ৯০%, ROI ≥ ৩x।"
  • Constraints: budget, timeline, regulatory, ethical।
  • Risks: "ডেটা ৬ মাসের কম, model overfit হতে পারে।"
  • Project plan: milestone, role, resources।
"ML model বানাতে বলেছে" — এই brief যথেষ্ট নয়। "কোন decision সাহায্য করবে, কে কে use করবে, ভুল prediction-এর cost কত" — এই প্রশ্ন না করলে wasted effort প্রায় নিশ্চিত।

৪ · Phase 2 & 3: Data Understanding ও Preparation

Understanding: ডেটা কোথায়, কত, কী format। প্রাথমিক exploration — distribution, missing pattern, ভেতরের structure। এই ধাপের output: data dictionary, initial EDA report।

Preparation: পুরো প্রজেক্ট-এর ৬০-৭০% সময় এখানে যায়। কাজ:

  • Data cleaning — duplicate, null, type mismatch।
  • Integration — multiple source merge।
  • Feature engineering — domain-specific signal তৈরি।
  • Encoding ও scaling — model-ready format।
  • Train-test split — ভবিষ্যৎ ডেটা leak রোধ।

৫ · Phase 4 & 5: Modeling ও Evaluation

Modeling: এই অংশটি textbook-এ অতিরিক্ত guru। বাস্তবে — multiple algorithm try, cross-validation, hyperparameter tune। সাধারণত ১০-১৫% time।

Evaluation: এখানে দুটি stakeholder-perspective আছে:

  • Statistical: accuracy, precision, recall, F1, AUC, RMSE — model-এর numerical performance।
  • Business: "৯২% accuracy" আর "৩ কোটি BDT সাশ্রয়" — দু'টি ভিন্ন গল্প। Business value confirmation এই ধাপের আসল কাজ।

Evaluation থেকে দুটি সিদ্ধান্ত আসে: (১) deploy করব, অথবা (২) Phase 1-এ ফিরে গিয়ে সমস্যা reformulate। Iteration এখানেই।

৬ · Phase 6: Deployment ও beyond

মডেল production-এ গেলেই কাজ শেষ — এই ধারণা ভুল। Deployment-এর কাজ:

  • Productionization: Jupyter notebook → REST API / batch pipeline।
  • Monitoring: data drift, model drift, latency, error rate।
  • Documentation: ব্যবহারকারী, dev, audit-এর জন্য তিন-স্তরের doc।
  • Maintenance schedule: retraining cadence, alert threshold।
  • Knowledge transfer: handoff to ops/MLE team।
production-এ গেলে drift inevitable — input distribution বদলে যায়, business context বদলে যায়। অনেক কোম্পানির মডেল ৩-৬ মাসের মধ্যে stale হয়ে যায়। নিয়মিত monitoring + retraining culture না থাকলে আপনার "deployed" model আসলে dead model।

৭ · কেস স্টাডি — bKash fraud detection (CRISP-DM lens)

একটি কাল্পনিক কিন্তু realistic উদাহরণ — কীভাবে CRISP-DM প্রতিটি ধাপে দেখায়:

  • Business: "মাসে ১২ কোটি BDT fraud loss; AI দিয়ে ৫০% কমান।" Success: 30%-এ নামা, FP rate ≤ 5%।
  • Data: ৩ বছরের transaction log (১০০ কোটি রেকর্ড), labeled fraud cases, agent profile, device fingerprint।
  • Preparation: Class imbalance (fraud rate 0.3%) → SMOTE; time-window aggregations; encoding; train-test temporal split।
  • Modeling: Logistic regression baseline → XGBoost → Isolation Forest ensemble।
  • Evaluation: recall 78%, precision 91%; expected savings ৬.৫ কোটি BDT/মাস (target ছিল ৬ কোটি)।
  • Deployment: Real-time scoring API (latency < 100ms), agent dashboard, weekly retraining, drift monitoring।

৮ · Modern alternatives — TDSP, KDD, Agile-DS

CRISP-DM ১৯৯৬-এর — কিছু সমালোচনা আছে: deployment phase সংক্ষিপ্ত, MLOps explicit নয়। আধুনিক বিকল্প:

  • Microsoft TDSP (Team Data Science Process): agile-friendly, role-based।
  • KDD (Knowledge Discovery in Databases): CRISP-DM-এর পূর্বসূরী, একাডেমিক।
  • Domino Data Lab framework: lifecycle-aware, governance-focused।

বেশির ভাগ কোম্পানি CRISP-DM-কে starting point হিসেবে নিয়ে নিজেদের জন্য customize করে।

৯ · একটি simple template — আপনার পরবর্তী প্রজেক্টের জন্য

Markdown · CRISP-DM checklist
# Project: 

## 1. Business Understanding
- Objective: 
- Success metric: 
- Constraints: 
- Stakeholders: 

## 2. Data Understanding
- Sources: 
- Volume: 
- Time range: 
- Known quality issues: 

## 3. Data Preparation
- Cleaning steps: 
- Feature engineering: 
- Train/val/test split: 

## 4. Modeling
- Baseline: 
- Candidates: 
- Hyperparameter strategy: 

## 5. Evaluation
- Statistical metrics: 
- Business metric: 
- Failure modes investigated: 

## 6. Deployment
- Serving: 
- Monitoring: 
- Retraining cadence: 

    
এই template একটি Markdown ফাইলে রেখে প্রতিটি প্রজেক্টে fill করুন — পরবর্তী ৬ মাসেও আপনি নিজে ও team বুঝতে পারবেন।

ভাবনার প্রশ্ন

প্রতিটি প্রশ্ন নিজে কিছুক্ষণ ভাবুন — তারপর "→ উত্তর" চাপুন।

প্র ০১ "৭০% ডেটা প্রজেক্ট ব্যর্থ হয়" — এই হিসাবটি (Gartner, ২০১৭) তখন থেকে repeated হচ্ছে। ব্যর্থতা সাধারণত কোন ধাপে ঘটে এবং কেন? আপনি team lead হিসেবে কীভাবে এটি প্রতিরোধ করবেন?

"Failure" সংজ্ঞা ভিন্ন — কখনো deployed হয় না; কখনো deploy হয় কিন্তু value বের হয় না; কখনো value আসে কিন্তু sustained হয় না। প্রতিটির cause ভিন্ন।

প্রধান failure mode:

  1. Business misalignment (~৪০% ব্যর্থতা): Stakeholder চাইলেন X, team বানাল Y। কারণ — Phase 1-এ ১ ঘণ্টা মিটিং করেই "বুঝে গেছি"।
  2. Data unavailability/quality (~২৫%): "এই ডেটা আছে" বললেন, কিন্তু আসলে নেই/incomplete/biased।
  3. Deployment gap (~২০%): Notebook-এ ভাল কাজ করে, production-এ যেতে পারে না — infra, latency, integration issue।
  4. Adoption failure (~১৫%): Deploy হয়েছে, ব্যবহারকারী trust করছেন না/ব্যবহার করছেন না।

Team lead-হিসেবে প্রতিরোধ:

  • প্রথম দু'সপ্তাহ Business understanding-এ: stakeholder interview, success metric লিখিত agreement, "decision-tree" — কোন output থেকে কোন action।
  • Data audit আগে: মডেলিং শুরুর আগে প্রতিটি claimed data source actual access ও sample inspection।
  • Production-aware modeling: Day 1 থেকে deployment constraint বিবেচনায়। "৫০ms latency requirement" থাকলে BERT use করা মূর্খতা।
  • Co-design with users: end-user-কে design phase থেকে involve করুন। তারা UI দেখতে চান, পুরো ML pipeline নয়।
  • Phased rollout: ১% user-এ A/B test → ১০% → ১০০%। failure radius limit।
  • Kill criteria: "যদি sprint 6-এ recall < 60% হয়, প্রজেক্ট stop।" আগে define না করলে sunk-cost fallacy।

Bangladesh-specific note: বাংলাদেশে অনেক কোম্পানিতে data team ও business team-এর মধ্যে cultural gap আছে। Engineer "research project" ভাবেন; CXO "magic" আশা করেন। Mid-level translator (analytics manager) এই gap bridge করেন।

মূল উপলব্ধি: ব্যর্থতা সাধারণত technical নয়, organizational। Data scientist-কে কেবল model build নয় — communication, stakeholder management, translation skill শিখতে হবে।

প্র ০২ CRISP-DM ১৯৯৬-এর — তখন cloud, MLOps, real-time stream, deep learning কিছুই ছিল না। আজকের ডেটা সায়েন্সে এই framework কতটা প্রাসঙ্গিক — কোথায় এটি update দরকার?

একটি গুরুত্বপূর্ণ critique। CRISP-DM-এর core idea (iterative, business-first) চিরন্তন; কিন্তু কিছু gap আছে।

যেখানে এটি এখনো শক্তিশালী:

  • Business → Data → Modeling-এর মূল flow universal।
  • Iteration emphasis — agile-এর সাথে সঙ্গতিপূর্ণ।
  • Documentation ও communication structure।
  • Industry-agnostic — finance থেকে healthcare পর্যন্ত প্রযোজ্য।

Gaps আজকের যুগে:

  1. Deployment phase undeveloped: CRISP-DM-এ "deployment" এক box। আজ এটি একটি পুরো discipline (MLOps): CI/CD, model registry, feature store, monitoring।
  2. Data engineering missing: পুরো data pipeline (ETL, streaming, lakehouse) আলাদা track আজ — CRISP-DM এটি abstract রাখে।
  3. Experimentation framework absent: A/B testing, canary deploys, feature flag — modern data science-এর core।
  4. Ethical/responsible AI: bias audit, fairness, explainability — ১৯৯৬-এ এই concern ছিল না; আজ regulatory requirement।
  5. Continuous learning: Model একবার deploy করে শেষ — এই assumption invalid। drift detection, retraining loop integral।
  6. Compute considerations: Cloud cost, GPU choice, distributed training — ২০২৪-এ critical।

আধুনিক augmentations:

  • Microsoft TDSP: CRISP-DM + role-based + agile + DevOps।
  • Google's ML lifecycle: data validation, training, serving, monitoring — explicit phases।
  • MLOps maturity model (Google/Microsoft): Level 0–2 — automation depth।
  • Responsible AI checklist: Microsoft ও Anthropic-এর pre-deployment review।

Bangladesh-এ কোনটি use করব?

  • Stage 1 কোম্পানি (just starting): CRISP-DM যথেষ্ট। Simple, well-documented।
  • Stage 2-3 (production model আছে): CRISP-DM + MLOps overlay।
  • Stage 4 (mature ML org): Custom hybrid — Google/Microsoft-এর recent framework।

মূল উপলব্ধি: CRISP-DM "skeleton" — modern practice "muscle"। একটি ছাড়া আরেকটি অসম্পূর্ণ। নতুন data scientist-কে CRISP-DM শিখে তার উপর modern tooling চাপাতে শেখাই উত্তম।

প্র ০৩ "Iteration" CRISP-DM-এর central idea — কিন্তু stakeholder চান "মাসিক plan, milestones, fixed deadline।" এই tension কীভাবে manage করবেন? Iterative process কে fixed-deadline business-এ কীভাবে fit করাবেন?

একটি classic project-management dilemma — শুধু ডেটা সায়েন্স নয়, যেকোনো R&D-flavored work-এ থাকে।

Tension-এর প্রকৃতি:

  • Stakeholder চান predictability — "১২ ফেব্রুয়ারি delivery।"
  • Reality — "প্রথম EDA-তে দেখা গেল ডেটা assumed চেয়ে ৪০% noisy। ৩ সপ্তাহ extra cleaning দরকার।"
  • Hide করলে — শেষে surprise। Show করলে — "you said yes initially।"

Hybrid approach — "Time-boxed iterations":

  1. Sprint structure (২ সপ্তাহ): প্রতিটি sprint-এ একটি specific deliverable promise — "EDA report", "Baseline model", "First A/B variant"। CRISP-DM-এর iteration sprint-এ embed।
  2. Phase gates: প্রতিটি phase শেষে stakeholder review meeting। সিদ্ধান্ত: continue, pivot, kill। Iteration-এ ফেরা explicit সিদ্ধান্ত — silent backtrack নয়।
  3. Rolling forecast: "Final delivery date" এক ব্ল্যাক বক্স না রেখে — current sprint output-এর ভিত্তিতে updated forecast। Stakeholder confidence interval দেখে।
  4. Risk register: Phase 1-এ risks document — "If data quality < 80%, expect 2-week delay।" এটি upfront agreed হয় তাহলে later surprise নয়।

Communication tools:

  • Cone of uncertainty: প্রজেক্টের শুরুতে estimate-এ ±৪x uncertainty; শেষে ±১.১x। Stakeholder-কে এটি পরিচয় করান।
  • Hypothesis-driven roadmap: "Sprint 1: validate hypothesis A; if true, Sprint 2 path X; if false, path Y।" Branching।
  • RACI matrix: কোন সিদ্ধান্তে কে accountable। Iteration-এর সিদ্ধান্ত PM-এর hands-এ, technical decision DS-এর।

Bangladesh context-এ এক common pitfall: "Demo-ready by ঈদ" — emotional deadline। Honest conversation: "ঈদ পর্যন্ত আমরা MVP demo দিতে পারব, full production ৩ মাস পরে।" Compromise — possible; surprise — destructive।

Books to read:

  • "The Lean Startup" by Eric Ries — build-measure-learn cycle।
  • "Designing Data-Intensive Applications" — engineering reality।
  • "Machine Learning Engineering" by Andriy Burkov — lifecycle management।

মূল উপলব্ধি: Iteration ≠ chaos। Iteration = managed exploration। Time-box + transparent communication + phase gates — তিনটি একসাথে থাকলে iterative process predictable হতে পারে।

প্র ০৪ Phase 1 (Business Understanding) করতে গিয়ে আপনি দেখছেন stakeholder নিজেই জানেন না কী চান — শুধু "কিছু একটা AI দিয়ে করুন" বলছেন। এই scenario-তে কীভাবে problem definition বের করবেন?

খুব সাধারণ scenario — বিশেষত Bangladesh-এর mid-size কোম্পানিতে যেখানে "AI" hype-driven।

প্রথমে scope clarify করার techniques:

  1. "5 Whys" (Toyota technique):
    • "AI চাই কেন?" → "competitor করছে।"
    • "competitor কী করছে?" → "recommendation system।"
    • "কেন সেটা help করবে?" → "user বেশি buy করবে।"
    • "কোন user, কী buy?" → "first-time visitor, related products।"
    • "কত বাড়াতে চান?" → "conversion 3% → 5%।"
    • এখন আসল problem clear: cross-sell recommendation system, target visitor segment, success metric +2pp conversion।
  2. "Magic wand" question: "ধরুন আমার একটি জাদুর কাঠি আছে — যেকোনো prediction perfectly correct। কোনটি দিলে আপনার ব্যবসায় সবচেয়ে বড় change হবে?" — এটি priority বের করে।
  3. Decision-output mapping: "এই model output পেলে আপনি কী করবেন?" যদি উত্তর না থাকে — model অর্থহীন।
  4. Day-in-the-life interview: User-এর daily workflow follow করুন। কোথায় বারবার ভুল হয়, কোথায় slow — সেখানেই AI-এর scope।
  5. Cost-of-error question: "False positive-এর cost কত? False negative-এর cost কত?" — এই answer model objective define করে।

Concrete artifacts তৈরি করুন:

  • Problem statement (১ paragraph): "X user-দের জন্য Y predict করব, Z সিদ্ধান্ত নিতে।"
  • Success criteria (numerical): "Recall ≥ 70%, ROI ≥ 3x in 6 months."
  • Out-of-scope list: "এই প্রজেক্টে আমরা NLP করব না, real-time-ও না।"
  • Stakeholder sign-off: document + signature/email confirmation।

Red flags যেগুলোতে stop বলতে হবে:

  • "Decision automate করতে চাই" কিন্তু human override path নেই — risk দিয়ে অস্থির।
  • "Just do something, present-এ ভাল লাগবে" — vanity project, কোনো adoption আসবে না।
  • ডেটা available নয়, কেউ collect করতে রাজি নয় — first ৬ মাস collection plan দরকার।
  • Privacy violation — religious, political, sensitive data-এ দ্বিধা না থাকলে সচেতন থাকুন।

"Educator" hat পরুন:

  • Stakeholder-কে "AI কী করতে পারে, কী পারে না" শেখান। ৩০ মিনিটের internal workshop।
  • Successful + failed case study দেখান। Realistic expectation set।
  • Pilot-first culture push করুন — "আমরা ছোট pilot করি, learn করি, scale করি।"

মূল উপলব্ধি: Vague stakeholder = অর্ধেক দায় আপনার। Data scientist এখানে therapist + consultant + teacher। Patience + structured questioning + concrete artifact — এই scenario navigate করার তিন স্তম্ভ।

অনুশীলন

  1. Phase identification: নিচের activity-গুলো CRISP-DM-এর কোন phase-এ পড়ে?
    • (ক) "Stakeholder-এর সাথে success metric finalize"
    • (খ) "Missing value-গুলো mean দিয়ে impute"
    • (গ) "Test set-এ ROC-AUC ০.৮৭"
    • (ঘ) "Data drift dashboard set up"
    • (ক) Phase 1 — Business Understanding।
    • (খ) Phase 3 — Data Preparation।
    • (গ) Phase 5 — Evaluation।
    • (ঘ) Phase 6 — Deployment (monitoring)।
  2. Mini case study: একটি ঢাকার diagnostic center আপনাকে বলেছে — "আমাদের patient appointment-এ ১৫% no-show হয়। AI দিয়ে কমাতে চাই।" CRISP-DM Phase 1 হিসেবে কী কী জিজ্ঞেস করবেন?
    • Business goal: No-show rate কত কমাতে চান (১৫% → ৭%)? কেন এটি priority?
    • Decision/action: Predicted no-show patient-কে কী করবেন (reminder call, double-book, deposit)?
    • Cost asymmetry: False positive (call করলেন আসেন এমন patient-কে) vs false negative (no-show মিস)। কোনটির cost বেশি?
    • Data: কোন appointment system? কত বছরের history? Patient demographic, weather, distance — কী আছে?
    • Constraint: Privacy (rogi data sensitive); call center capacity; deposit রাখার policy।
    • Success metric: No-show rate, OR revenue saved, OR patient satisfaction।
    • Stakeholder: doctors, nurses, front-desk — কে accept করবেন alert?
  3. Iteration scenario: Phase 4 (Modeling) তে আপনি দেখছেন accuracy 65% — target 85%। কোন phase-এ ফিরে যাবেন এবং কেন?

    Multiple paths possible — diagnosis করা প্রথম কাজ।

    • Phase 3 (Data Prep): যদি features weak — better feature engineering, more data sources।
    • Phase 2 (Data Understanding): যদি label quality সন্দেহজনক — labeling pipeline review।
    • Phase 1 (Business): যদি problem fundamentally unsolvable — "85% accuracy" reasonable নয়; reformulate।
    • Phase 4-এ থাকুন: যদি simple algorithm — try gradient boosting, neural net, ensemble।

    Diagnostic step: learning curve plot। Underfitting → model upgrade; overfitting → more data/regularization; both flat → label/feature problem (Phase 2/3-এ ফেরা)।

আরও পড়ুন

আরও পড়তে চান? Microsoft TDSP-এর free documentation এখানে পাবেন।
পূর্ববর্তী পাঠ
পাঠ ০১ · ডেটা সায়েন্স কী