Analytics means using data to answer questions and make smart decisions. We can group analytics into four types based on the questions they answer. Understanding these four types helps you choose the right tool for any business problem.
Loading diagram...
| Type | Question Answered | Example | Complexity |
|---|---|---|---|
| Descriptive | What happened? | Last month's sales report | Low |
| Diagnostic | Why did it happen? | Why did our sales drop in March? | Medium |
| Predictive | What will happen? | Next month's sales forecast | High |
| Prescriptive | What should we do? | Adjust prices to make more money | Very High |
Descriptive analytics looks at past data to summarize and describe what already happened. It is the starting point for all analysis—you must first understand what happened before you can explain it or predict it.
This is a daily task for any data scientist. Diagnostic Analytics builds on this by explaining the actual reasons behind what happened.
What this code does: This code takes sales numbers from four different regions (North, South, East, West). It then uses a simple function called describe() to quickly calculate general statistics like average sales, lowest sales, and highest sales. Finally, it checks the data to find and print which region had the best sales.
Loading code block...
Diagnostic analytics goes deeper than just describing facts. It asks why something happened. It uses statistical methods and business knowledge to find true cause-and-effect relationships, not just random links.
The most important rule in data science is: Correlation does not mean causation.
Diagnostic analytics helps us find real causes so we do not make wrong business decisions.
Observation: "Sales dropped 20% right after we updated our website banner."
Observation: "Customers who stay with us a long time spend more money."
CausalML, DoWhy, EconML, Causal ForestWhat this code does: This code shows why simple comparisons can sometimes be misleading when trying to find real causes (reasons why things happened). First, it calculates a simple guess of a group's change (the general outcome difference). Then, it explains that a true diagnostic study needs to account for surrounding factors (like age and income) to ensure we find the true cause-and-effect impact, rather than a false correlation.
Loading code block...
Predictive analytics uses past and present data to forecast what is likely to happen in the future. It uses statistical models and machine learning to find patterns and project them forward.
This is also a major part of a data scientist's job. Prescriptive Analytics takes this one step further by recommending exactly what actions we should take.
What this code does: This code uses past sales numbers from month 1 through month 6 to train a simple machine learning model (called a LinearRegression model). The model learns the general pattern (how fast sales are growing each month) and extends that pattern into the future to forecast (predict) the sales score for month 7.
Loading code block...
| Aspect | Descriptive | Diagnostic | Predictive | Prescriptive |
|---|---|---|---|---|
| Time focus | Past | Past (explaining) | Future | Future (action) |
| Output | Reports, charts, summaries | Root causes, insights | Forecasts, probabilities | Recommendations, actions |
| Tools | SQL, Tableau, pandas | Causal inference, A/B tests, statsmodels | Scikit-learn, TensorFlow, Prophet, LLMs | Optimization, RL, decision algorithms |
| Who uses it | Analysts, managers | Data scientists, product teams | Data scientists, ML engineers | ML engineers, optimization experts |
| Data needed | Historical data only | Historical + experimental data | Historical + real-time data | Models + business constraints |
| Example | "Sales were $1M last quarter." | "Sales dropped due to competitor price change." | "Sales will be $1.2M next quarter." | "Lower prices by 5% to increase volume 15%." |
To make this simple, think of a weather service:
Descriptive analytics answers "What happened?" using historical data—it is the starting point of all analysis.
Diagnostic analytics answers "Why did it happen?" using causal inference, A/B tests, and statistical methods to find root causes, not just correlations.
Predictive analytics answers "What will happen?" using models trained on past data. Modern methods include time-series forecasting, ensemble methods, and fine-tuned LLMs.
Prescriptive analytics answers "What should we do?" by recommending specific actions to optimize outcomes using optimization algorithms and reinforcement learning.
In practice, data scientists work across all four types. Start with descriptive to understand patterns, move to diagnostic to find causes, build predictive models for forecasts, and use prescriptive analytics to drive business decisions.
Remember: Correlation does not imply causation. Always validate causal claims with experiments (A/B tests) or causal inference methods before making business decisions.