CodeNFacts
CodeHub
Home

All Categories


Sign In
~/data-science
CodeNFacts/ data-science

Data Science

The discipline of extracting knowledge and predictions from data — blending statistics, programming, and domain expertise to turn raw numbers into decisions, products, and intelligent systems.

PythonStatisticsMachine LearningBig DataAI
01 — Fundamentals

What is Data, and What is Data Science?

data.ts

Data

Data is raw facts and figures — numbers, text, images, clicks, sensor readings — collected from the real world. On its own it's unorganized; it only becomes valuable once it's structured, cleaned, and interpreted.

data_science.ts

Data Science

Data Science is the field that uses statistics, programming, and domain knowledge to collect, clean, analyze, and model data — turning it into predictions, automation, and decisions. It sits at the intersection shown in the diagram below.

venn-diagram.svg
Math &StatisticsProgramming/ CSDomainKnowledgeDataScience
02 — Motivation

Why Data Science Matters Now

why-needed.md

Every click, purchase, sensor reading, and interaction today generates data. Companies that can turn that flood of data into insight move faster, personalize better, and catch problems before they escalate — those that can't fall behind.

  • Explosion of digital data (IoT, social, transactions)
  • Cheap compute & storage made large-scale modeling possible
  • Competitive pressure to personalize and automate
  • AI systems are only as good as the data pipelines behind them
what-if-not.md

Imagine a world without data science — no predictions, no personalization, decisions made blind:

  • Businesses would rely purely on guesswork and intuition for major decisions.
  • Fraud and anomalies would go undetected until real damage is done.
  • Products and content would feel generic — no personalization at all.
  • Diseases would be diagnosed later, without data-driven early warning systems.
  • Resources like electricity, traffic, and inventory would be wasted at scale.
  • AI as we know it (search, voice assistants, self-driving) wouldn't exist.
03 — Impact

How Data Science Helps

better_decisions.ts

Better Decisions

Turns raw numbers into evidence, so choices are based on patterns instead of gut feeling.

predicts_the_future.ts

Predicts the Future

Forecasting models estimate demand, churn, prices, and risk before they happen.

detects_fraud_&_risk.ts

Detects Fraud & Risk

Anomaly detection flags suspicious transactions and system failures in real time.

personalization.ts

Personalization

Recommendation engines tailor feeds, products, and content to each individual user.

automation.ts

Automation

Trained models replace repetitive manual judgment calls with instant predictions.

resource_optimization.ts

Resource Optimization

Supply chains, hospital beds, and traffic lights run more efficiently with data models.

04 — Comparison

Data Science vs. Data Analysis

comparison.table
AspectData AnalysisData Science
GoalExplain what happened & whyPredict what will happen next
Core skillQuerying, reporting, dashboardsModeling, algorithms, statistics
ToolsSQL, Excel, Tableau, Power BIPython/R, scikit-learn, TensorFlow
OutputReports, KPIs, visualizationsTrained models, predictions, automation
Math depthDescriptive statisticsLinear algebra, probability, calculus
Time horizonLooks at past & present dataBuilds systems for future data

Rule of thumb: Data Analysis looks backward and explains. Data Science looks forward and predicts/automates.

05 — Roadmap

How to Learn Data Science with AI

step_01.ts
01

Foundations

Python, SQL, statistics basics, and data structures.

step_02.ts
02

Data Wrangling

Pandas, NumPy, cleaning, EDA, and visualization.

step_03.ts
03

Classical ML

Regression, classification, clustering with scikit-learn.

step_04.ts
04

Deep Learning

Neural networks, CNNs, RNNs with TensorFlow/PyTorch.

step_05.ts
05

Learn WITH AI

Use AI tutors/Copilot to explain errors, generate practice data, and quiz you — not just to autocomplete code.

step_06.ts
06

Real Projects

Kaggle competitions, end-to-end pipelines, deployment.

step_07.ts
07

MLOps & Deployment

Docker, APIs, model monitoring, CI/CD for models.

ai-learning-tip.md

Use AI tools (like CodeNFacts' AI Tutor) to explain error tracebacks line-by-line, generate synthetic practice datasets, quiz you on statistics concepts, and review your notebook code for bad practices — treat AI as a tutor that asks "why," not just a code generator.

06 — Tools

Tech Stack

languages.json

Languages

PythonRSQLJuliaScala
data_handling.json

Data Handling

PandasNumPyPolarsDaskApache Arrow
visualization.json

Visualization

MatplotlibSeabornPlotlyTableauPower BI
big_data.json

Big Data

Apache SparkHadoopKafkaHiveAirflow
databases.json

Databases

PostgreSQLMongoDBBigQuerySnowflakeRedis
cloud_&_mlops.json

Cloud & MLOps

AWS SageMakerGCP Vertex AIAzure MLMLflowDocker
07 — Foundations

Mathematics Required

linear_algebra.md

Linear Algebra

  • Vectors & matrices
  • Eigenvalues/eigenvectors
  • Matrix decomposition (SVD, PCA)
  • Dot & cross products
statistics_&_probability.md

Statistics & Probability

  • Distributions (normal, binomial)
  • Hypothesis testing
  • Bayes' theorem
  • Confidence intervals, p-values
calculus.md

Calculus

  • Derivatives & gradients
  • Chain rule (backpropagation)
  • Partial derivatives
  • Optimization (gradient descent)
discrete_math.md

Discrete Math

  • Graph theory (networks, trees)
  • Combinatorics
  • Set theory
  • Algorithmic complexity (Big-O)
08 — Frameworks

ML & DL Frameworks

frameworks.json

Scikit-learn

Classical ML: regression, classification, clustering

TensorFlow

Production-grade deep learning at scale

PyTorch

Research-friendly deep learning, dynamic graphs

Keras

High-level API for fast neural network prototyping

XGBoost / LightGBM

Gradient-boosted trees for tabular data

Hugging Face Transformers

Pretrained NLP & LLM models

OpenCV

Computer vision & image processing

LangChain

Building AI-agent & LLM-powered pipelines

09 — Training

How AI Models Are Trained on Data

training_pipeline.svg
CollectCleanExploreFeature Eng.SplitTrainValidateDeploy
training_loop.svg
Raw DataLabeled examplesModelForward pass →prediction ŷLoss FunctionCompare ŷvs true label yBackpropagation — adjust weightsTrainedModel

The model predicts, a loss function scores the error, and backpropagation nudges the weights to reduce that error — repeated over many epochs until performance plateaus.

10 — Requirements

How Much Data Does a Model Need?

volume.req

Volume

Enough examples to cover the pattern space — too little data means high variance.

variety.req

Variety

Diverse examples across edge cases, demographics, and conditions to avoid bias.

veracity.req

Veracity

Clean, accurate, correctly-labeled data — garbage in, garbage out.

balance.req

Balance

Roughly even class representation, or techniques like SMOTE/weighting to correct skew.

relevance.req

Relevance

Features that actually correlate with what you're trying to predict.

freshness.req

Freshness

Recent data that reflects the current real-world distribution, not a stale snapshot.

rule-of-thumb.md

There's no fixed number — a simple linear model might work with a few hundred rows, while a deep neural network on images may need tens of thousands. What matters more than raw volume is whether the data represents the real-world scenarios the model will face after deployment.

11 — Reference

Cheat Sheets

pandas-cheatsheet.pdf

Pandas Cheat Sheet

numpy-cheatsheet.pdf

NumPy Cheat Sheet

sql-ds-cheatsheet.pdf

SQL for Data Science

statistics-cheatsheet.pdf

Statistics Formulas

sklearn-cheatsheet.pdf

Scikit-learn Workflow

model-selection-cheatsheet.pdf

ML Model Selection Guide

12 — Best Practices

Important Things to Keep in Mind

best_practices.md
  • Always split data into train/validation/test BEFORE any preprocessing to avoid leakage.
  • Understand your data before modeling — EDA saves hours of debugging later.
  • Track every experiment (params, metrics, data version) — reproducibility matters.
  • Start with a simple baseline model before jumping to deep learning.
  • Don't chase accuracy alone — check for bias, fairness, and real-world cost of errors.
  • Don't ignore data drift — a model that worked last year may silently be failing today.
  • Don't skip domain knowledge — the best data scientists understand the business, not just the math.
13 — Interview Prep

Puzzled Interview Questions

14 — Big Picture

The Data Science Ecosystem

ecosystem.svg
DataScientistRaw DataSourcesBusinessStakeholdersML Models &PipelinesDashboards &APIs