Data Mining and Data Warehousing

Chapter 1
Foundations of Data Mining and Data Warehousing

Bachelors Program in AI & ML
Data Mining and Data Warehousing   •   Bachelor

Foundations of Data Mining and Data Warehousing

Introduction

Modern organizations generate data continuously through sales transactions, websites, mobile applications, sensors, enterprise systems, scientific instruments, and social platforms. Data alone, however, does not automatically create value. Organizations must collect it accurately, organize it appropriately, integrate data from different sources, analyze it responsibly, and communicate findings to decision-makers. Data mining and data warehousing provide important foundations for this process.

Data warehousing focuses primarily on the systematic storage, integration, historical preservation, and analysis of organizational data. Data mining focuses on discovering useful patterns, relationships, trends, and predictive models from data. These areas are closely related but are not identical. A data warehouse may provide a reliable analytical foundation, while data mining may use warehouse data, operational data, data lakes, or other repositories.

This chapter introduces the concepts required to understand the broader field of data mining and data warehousing. It distinguishes data, information, and knowledge; compares databases, data warehouses, data lakes, business intelligence, analytics, machine learning, knowledge discovery in databases, and data mining; and examines common tasks, applications, limitations, governance issues, and professional practices.

Learning Objectives

By the end of this chapter, you should be able to:

1. Explain the relationships among data, information, knowledge, and decision-making.

2. Distinguish operational databases, data warehouses, data lakes, and data lakehouses.

3. Differentiate business intelligence, analytics, machine learning, KDD, and data mining.

4. Describe major data-mining tasks and their applications.

5. Explain the roles of data integration, metadata, data quality, and governance.

6. Analyze practical limitations and ethical risks associated with data-driven systems.

7. Select an appropriate data and analytics approach for a real organizational problem.

From Data to Knowledge

Data

Data are recorded representations of observations, events, entities, or measurements. They may be numerical, categorical, textual, visual, audio-based, or generated by machines. Examples include a product identifier, a temperature reading, a customer complaint, a transaction amount, or an image captured by a camera.

Data may be structured, semi-structured, or unstructured. Structured data follow a defined schema, as in a relational table. Semi-structured data contain organizational markers but do not necessarily conform to fixed rows and columns; JSON and XML documents are common examples. Unstructured data include free text, images, video, and audio, although modern systems can extract structured features from them.

Data are not automatically reliable. They may contain missing values, duplicate records, inconsistent formats, measurement errors, outdated attributes, or biased samples. Consequently, data quality is a central concern in both warehousing and mining.

Information

Information is data organized and interpreted in a context that makes it meaningful. A list of individual sales transactions is data. A monthly report showing total sales by region is information because it summarizes and contextualizes the transactions.

Information commonly answers questions such as what happened, when it happened, where it happened, and how frequently it occurred. It is more useful than raw data, but it does not necessarily explain causes or recommend actions.

Knowledge

Knowledge consists of justified understanding that supports interpretation, prediction, explanation, or action. Knowledge may come from formal analysis, domain expertise, repeated experience, scientific research, or discovered patterns. For example, an organization may learn that delivery delays increase substantially when orders are placed after a particular cutoff time and may use that insight to change scheduling policies.

A useful conceptual progression is:

Data → Information → Knowledge → Decision or Action

This progression is not automatic. Human judgment, organizational context, analytical methods, and validation are required. A statistically strong association may not represent a causal relationship. Knowledge must therefore be interpreted in relation to business processes, domain expertise, and the consequences of action.

A Simple Example

Suppose a supermarket records the following transaction data: product code, quantity, price, timestamp, and store identifier. After aggregation, managers receive information showing that weekend sales of cold beverages are higher than weekday sales. Further analysis may generate knowledge that sales increase especially during hot weather and near outdoor events. The organization can then use this knowledge to improve inventory planning. The quality of the decision still depends on factors such as weather forecasts, event schedules, storage capacity, and the cost of excess inventory.

The Data Environment of an Organization

Operational Databases

An operational database supports the routine processing of current business transactions. Examples include systems for banking, order processing, reservations, payroll, and inventory management. These systems are often designed for frequent insertion, modification, and retrieval of individual records. Their design usually emphasizes transaction consistency, speed, and operational reliability.

Operational databases are commonly associated with online transaction processing (OLTP). An OLTP system may need to update a customer address, record a payment, or reduce inventory immediately. It is usually not optimized for large historical queries that combine many departments and years of activity.

Data Warehouses

A data warehouse is a subject-oriented, integrated, time-variant, and relatively nonvolatile collection of data used to support analysis and decision-making. These characteristics are traditionally associated with the data-warehouse concept:

  • Subject-oriented: organized around subjects such as customers, products, or sales rather than individual applications.
  • Integrated: data from multiple sources are standardized and combined.
  • Time-variant: historical states and trends are preserved.
  • Nonvolatile: data are primarily loaded and read for analysis rather than continuously updated through operational transactions.

A warehouse typically receives data through an extract, transform, and load (ETL) process. In an extract, load, and transform (ELT) approach, data are loaded into the target platform before substantial transformation. The choice depends on platform capabilities, governance requirements, data volume, and processing needs.

A common dimensional design contains fact tables and dimension tables. A fact table stores measurable events, such as sales quantity or revenue. Dimension tables provide descriptive context, such as product, customer, store, and date. A star schema has a central fact table connected directly to dimensions. A snowflake schema further normalizes some dimensions into related tables.

For example, a sales fact table may contain date key, product key, store key, quantity, and sales amount. A date dimension may contain day, month, quarter, and year. The schema supports questions such as: “What was total quarterly revenue by product category and region?”

Data Marts

A data mart is a smaller analytical repository focused on a department, subject, or business function, such as marketing, finance, or human resources. Data marts may be derived from an enterprise warehouse or developed independently. Independent marts can provide agility but may create inconsistent definitions, sometimes called “multiple versions of the truth.”

Data Lakes

A data lake is a repository designed to store large amounts of data in its original or near-original form. It may contain structured, semi-structured, and unstructured data. Data lakes are useful when the structure or analytical purpose of data is not known in advance. This is often described as schema-on-read: structure and interpretation are applied when data are used.

Data lakes support exploratory analysis, data science, machine learning, and archival use cases. However, a poorly managed lake can become a “data swamp,” characterized by unclear ownership, weak metadata, duplicate content, poor quality, and difficulty locating trustworthy data.

Data Lakehouses and Cloud Platforms

A data lakehouse combines characteristics of data lakes and warehouses. It aims to provide flexible storage for varied data together with stronger management, transaction support, governance, and analytical performance. Cloud data warehouses, object storage, distributed processing platforms, and managed analytical services have made it possible to scale storage and computation independently in many environments.

Technology labels should not replace architectural analysis. An organization should select a platform based on data types, latency requirements, governance obligations, skills, cost, interoperability, and expected workloads.

Business Intelligence, Analytics, Machine Learning, KDD, and Data Mining

Business Intelligence

Business intelligence (BI) refers to technologies, processes, and practices that transform organizational data into reports, dashboards, visualizations, and performance indicators. BI commonly emphasizes descriptive and diagnostic questions:

  • What happened?
  • Where did it happen?
  • How does performance compare with a target?
  • Which departments or products contributed to the result?

BI is not limited to a particular software product. It includes data preparation, semantic definitions, visualization, reporting, and organizational use of information.

Analytics

Analytics is the systematic use of data, statistical methods, computational techniques, and domain knowledge to support understanding and decisions. A common classification is:

  • Descriptive analytics: summarizes past or current conditions.
  • Diagnostic analytics: investigates possible reasons for observed outcomes.
  • Predictive analytics: estimates likely future or unknown outcomes.
  • Prescriptive analytics: evaluates possible actions and their consequences.

These categories overlap in practice. Predictive models require descriptive data preparation, and prescriptive decisions require assumptions about objectives, constraints, and consequences.

Machine Learning

Machine learning (ML) is a field concerned with computational methods that improve performance on a task through experience or data. Supervised learning uses labeled examples for tasks such as classification and regression. Unsupervised learning seeks structure in data without a specified target, as in clustering. Reinforcement learning concerns learning through interaction and feedback from an environment.

Machine learning and data mining overlap substantially. Data mining is often broader in its emphasis on discovering useful patterns from datasets, integrating algorithms with data preparation and interpretation. Machine learning may focus more specifically on learning models that generalize to new cases. Neither field eliminates the need for problem definition, data quality assessment, evaluation, or human judgment.

Knowledge Discovery in Databases

Knowledge Discovery in Databases (KDD) is a broader, iterative process for discovering useful and understandable knowledge from data. A typical KDD framework includes:

1. Understanding the domain and objectives

2. Selecting relevant data

3. Cleaning and preprocessing data

4. Transforming or reducing data

5. Applying data-mining methods

6. Evaluating discovered patterns or models

7. Presenting and using knowledge

Data mining is therefore one important step within KDD, not a complete substitute for the entire process. In practice, the steps are iterative. Evaluation may reveal a data problem, while domain interpretation may require a new analysis.

Major Data-Mining Tasks

Classification

Classification assigns records to predefined categories. Examples include classifying an email as legitimate or spam, a loan application as a risk category, or a medical image as belonging to one of several diagnostic classes. The target variable is categorical. Evaluation may involve accuracy, precision, recall, specificity, F1-score, or measures based on a confusion matrix. The appropriate measure depends on the costs of different errors and the balance of classes.

Regression and Prediction

Regression estimates a numerical value, such as demand, delivery time, energy consumption, or property price. Prediction more generally refers to estimating unknown or future values. Evaluation may use measures such as mean absolute error or root mean squared error, but the choice should reflect the practical cost of errors and the scale of the target.

Clustering

Clustering groups observations according to similarity without predefined class labels. It can support customer segmentation, document organization, anomaly investigation, or image analysis. Clusters are not automatically natural or meaningful; their interpretation depends on selected features, similarity measures, algorithmic assumptions, and business context.

Association and Pattern Discovery

Association analysis identifies items or events that occur together. In retail, it may reveal that customers who purchase one product often purchase another. Such associations can support recommendations, promotions, or store layout decisions. Association does not establish causation. A relationship may result from seasonality, a third variable, or a common promotion.

Anomaly Detection

Anomaly detection identifies observations that differ substantially from expected behavior. Applications include fraud detection, network security, equipment monitoring, and quality control. An anomaly may be an error, a rare but legitimate event, or evidence of a new condition. Human review and contextual investigation are often necessary.

Summarization and Characterization

Summarization produces compact descriptions of data, such as profiles of customer groups, departmental performance summaries, or trends over time. Effective summaries should preserve decision-relevant information while avoiding misleading aggregation.

Sequential and Temporal Analysis

Sequential analysis examines ordered events, while temporal analysis studies changes over time. Examples include clickstream sequences, equipment failure histories, and recurring purchasing cycles. Temporal relationships require care because trends, seasonality, changing measurement processes, and external events can influence results.

A Practical Data-Mining Workflow

A reliable project begins with a clearly stated problem rather than with an algorithm. A general workflow is:

1. Define the decision problem. Identify the users, decision, time horizon, constraints, and success criteria.

2. Understand data sources. Document ownership, collection methods, definitions, access rights, and expected quality.

3. Acquire and integrate data. Resolve identifiers, formats, units, duplicates, and conflicting definitions.

4. Assess and prepare data. Examine missingness, outliers, distributions, leakage risks, and sampling bias.

5. Select appropriate methods. Match the task to the target, data type, interpretability needs, and operational setting.

6. Evaluate honestly. Use suitable validation procedures and compare performance with a meaningful baseline.

7. Interpret and validate with experts. Determine whether patterns are plausible, useful, stable, and ethically acceptable.

8. Deploy and monitor. Track data drift, model performance, user behavior, fairness, and unintended effects.

A model that performs well in a laboratory but cannot be integrated into a workflow may have little organizational value. Similarly, a pattern that is accurate but impossible to explain may be inappropriate in a high-stakes setting.

Worked Conceptual Example: Retail Demand Analysis

An online retailer wants to reduce stockouts. Its operational system stores orders, payments, and inventory updates. The company creates a warehouse containing historical sales facts and product, store, date, and promotion dimensions. BI dashboards show weekly sales and stockout rates by category. Analysts then use predictive methods to estimate demand for the next week.

The stages illustrate the distinction among technologies:

  • The operational database records transactions.
  • The warehouse integrates and preserves historical data.
  • BI summarizes performance.
  • Predictive analytics estimates future demand.
  • Data mining may identify relationships between promotions, weather, product categories, and stockouts.
  • Machine learning may provide a model for demand prediction.
  • KDD includes the entire cycle from problem definition through evaluation and use.

The retailer must also avoid leakage. For example, using an inventory value recorded after the prediction time would give the model information that would not be available when the real decision is made. The retailer should evaluate predictions using time-appropriate validation and measure whether stockouts decline without causing excessive overstock.

Applied Case: Illustrative Hospital Readmission Project

Background

The following is an illustrative case. A hospital wants to identify patients who may require additional support after discharge. The intention is to allocate follow-up resources, not to deny treatment.

Problem

The hospital has data from an electronic health-record system, laboratory systems, appointment records, and discharge summaries. The data differ in coding systems, time conventions, completeness, and access restrictions. Leaders ask whether a predictive model can support follow-up planning.

Analysis

A project team first defines the prediction time: immediately before discharge. It defines the outcome as readmission within a specified period after discharge and identifies which information is legitimately available at prediction time. The team discovers missing values, inconsistent patient identifiers, and changes in clinical coding across years. It also recognizes that historical care patterns may reflect unequal access to services.

Approach and Solution

The team establishes governance approval, limits access to authorized personnel, and removes unnecessary identifiers. Data engineers integrate sources and document definitions in a metadata catalogue. Analysts create a transparent baseline model and compare it with more complex alternatives. Evaluation uses a time-based holdout to better represent future deployment. Performance is examined not only overall but also across relevant patient groups.

The hospital does not use the score as an automatic decision. Instead, it provides a risk indicator with contributing factors and a review process for clinicians. The workflow includes an appeal or correction mechanism when records are inaccurate. After deployment, the team monitors calibration, changes in patient populations, missing-data patterns, and whether follow-up resources actually improve outcomes.

Outcome

The project demonstrates that the main challenge is not simply selecting an algorithm. Reliable results depend on precise outcome definitions, high-quality integration, appropriate validation, clinical interpretation, privacy protection, and continuous monitoring. A model can support professional judgment but should not replace it without strong evidence and governance.

Learning Points

1. The prediction point determines which variables are valid.

2. Data integration and documentation are as important as modeling.

3. Accuracy alone is insufficient for high-stakes applications.

4. Historical data may encode institutional and social inequalities.

5. Human oversight and post-deployment monitoring are essential.

Limitations and Risks

Data Quality and the “Garbage In, Garbage Out” Problem

Incomplete, inaccurate, outdated, or inconsistent data can produce misleading reports and models. Cleaning is not merely deleting unusual records. An unusual value may be a measurement error, a legitimate extreme, or evidence of an important event. Every transformation should be documented and justified.

Bias and Representativeness

A dataset may not represent the population or conditions in which a system will be used. Sampling bias, historical discrimination, under-recording, proxy variables, and unequal access to services can affect results. Removing a sensitive attribute does not necessarily remove bias because other variables may act as proxies.

Association Is Not Causation

Data mining often discovers correlations. Correlation can support investigation, but it does not by itself show that changing one variable will change another. Causal conclusions require suitable study designs, assumptions, and domain reasoning.

Overfitting and Poor Generalization

A method may fit accidental patterns in historical data instead of relationships that persist in new data. Overfitting is addressed through appropriate validation, regularization or model constraints where suitable, careful feature selection, and testing on data that reflect future use. Repeatedly tuning against a test set can undermine its independence.

Privacy and Security

Data systems may expose personal, financial, health, location, or behavioral information. Responsible practice includes data minimization, purpose limitation, access control, encryption, retention policies, audit trails, secure development, and lawful processing. De-identification reduces risk but is not always irreversible, especially when datasets can be linked.

Interpretability and Accountability

People affected by automated or data-informed decisions may require understandable explanations, correction mechanisms, and avenues for appeal. Organizations should document data sources, transformations, model versions, evaluation results, responsible owners, and known limitations.

Concept Drift and Operational Change

Relationships may change because of economic conditions, policy changes, new products, changing user behavior, or changes in measurement systems. A model that was valid last year may degrade. Monitoring should therefore cover both input data and outcomes.

Governance and Professional Practice

Data governance establishes decision rights, responsibilities, policies, and controls for data. Important governance practices include:

  • assigning data owners and stewards;
  • maintaining data dictionaries and metadata catalogues;
  • defining common business terms and measures;
  • recording lineage from source to report or model;
  • applying role-based access and least-privilege principles;
  • monitoring quality dimensions such as completeness, accuracy, consistency, timeliness, and uniqueness;
  • retaining evidence for audits and regulatory obligations;
  • assessing privacy, fairness, safety, and security before deployment.

A professional data practitioner must understand both technical and organizational consequences. Good communication is essential because analysts must explain assumptions, uncertainty, limitations, and recommended actions to non-specialists.

Contemporary Developments

Several developments shape current data environments. Cloud platforms provide elastic storage and computing but introduce questions about cost control, data location, vendor dependence, and security configuration. Real-time and streaming analytics support fraud detection, industrial monitoring, and personalized services, but they increase requirements for low-latency processing and continuous quality checks. Generative AI and foundation models can assist with natural-language querying, code generation, document analysis, and data preparation; however, they may produce inaccurate outputs, reveal sensitive information, or obscure the provenance of results. Human verification, access controls, and documented evaluation remain necessary.

Data products and self-service analytics can bring analysis closer to business users. Without shared definitions and governance, however, self-service can multiply inconsistent metrics. Responsible organizations combine accessibility with certified data assets, clear ownership, and appropriate controls.

Best Practices

1. Begin with a decision and a measurable purpose, not with a fashionable tool.

2. Treat data definitions, metadata, lineage, and quality as core deliverables.

3. Separate operational processing from analytical workloads when requirements differ.

4. Use warehouses, lakes, or lakehouses according to actual workload and governance needs.

5. Establish meaningful baselines before adopting complex models.

6. Validate using data and time periods that represent deployment conditions.

7. Distinguish prediction from explanation and association from causation.

8. Include domain experts and affected stakeholders throughout the lifecycle.

9. Minimize sensitive data and protect it through technical and organizational controls.

10. Monitor deployed systems for performance, drift, fairness, security, and unintended consequences.

Chapter Summary

Data are recorded observations; information is organized data with meaning; and knowledge is justified understanding that supports interpretation and action. Operational databases support current transactions, whereas data warehouses integrate historical data for analysis. Data lakes store varied data flexibly, while lakehouses seek to combine flexibility with stronger analytical management.

Business intelligence emphasizes reporting and visualization. Analytics includes descriptive, diagnostic, predictive, and prescriptive uses of data. Machine learning develops models that learn from data, while data mining discovers useful patterns and models. Knowledge Discovery in Databases is the broader iterative process that includes data selection, preparation, mining, evaluation, and use.

Major data-mining tasks include classification, regression, clustering, association analysis, anomaly detection, summarization, and sequential analysis. Successful projects depend on clear objectives, sound data integration, suitable evaluation, domain interpretation, governance, and monitoring. Data quality problems, bias, privacy risks, overfitting, poor generalization, concept drift, and confusing correlation with causation are important limitations. Responsible data practice combines technical competence with ethical judgment and organizational accountability.

Key Terms

Data: Recorded representation of an observation, event, entity, or measurement.

Information: Data organized and interpreted in a meaningful context.

Knowledge: Justified understanding that supports explanation, prediction, or action.

Operational database: A system designed primarily to support routine current transactions.

OLTP: Online transaction processing for operational business activities.

Data warehouse: Integrated, historical analytical data organized to support decision-making.

Data mart: A subject- or department-focused analytical repository.

Data lake: Repository for large volumes of data in varied or original forms.

Data lakehouse: Architecture combining flexible lake storage with warehouse-like management and analytics.

ETL: Extract, transform, and load process for preparing and transferring data.

Metadata: Data describing the meaning, structure, origin, quality, or use of other data.

Business intelligence: Processes and technologies for reporting, dashboards, and organizational insight.

Analytics: Systematic use of data and methods to support understanding and decisions.

Machine learning: Computational methods that improve task performance through data or experience.

KDD: Knowledge Discovery in Databases, the broader process of discovering useful knowledge.

Data mining: Discovery of patterns, relationships, anomalies, or models from data.

Classification: Assignment of records to predefined categorical classes.

Clustering: Grouping observations according to similarity without predefined labels.

Data governance: Policies, responsibilities, standards, and controls for managing data.

Concept drift: Change over time in data distributions or relationships relevant to a model.

Review Questions

Short Answer Questions

1. What is the difference between data, information, and knowledge?

2. State four traditional characteristics of a data warehouse.

3. How does a data lake differ from a data warehouse?

4. What is the relationship between KDD and data mining?

5. Name four common data-mining tasks.

Long Answer Questions

1. Explain how operational databases, data warehouses, data marts, and data lakes support different organizational needs.

2. Compare business intelligence, analytics, machine learning, KDD, and data mining.

3. Describe a complete data-mining workflow from problem definition to post-deployment monitoring.

4. Discuss the causes and consequences of poor data quality in analytical systems.

5. Explain the major ethical, privacy, and governance issues involved in data-driven decision-making.

Analytical / Application Questions

1. A university wants to predict which students may need academic support. Propose a data source, target outcome, validation approach, and governance safeguards. Explain possible bias risks.

2. A retailer has an operational database, several departmental spreadsheets, and website clickstream logs. Recommend an appropriate analytical architecture and justify whether a warehouse, lake, or lakehouse should be used.

3. A fraud-detection model performs well during development but poorly after a new payment method is introduced. Analyze possible causes and propose a monitoring and response plan.

Multiple Choice Questions with Answers

Question 1

Which statement best distinguishes information from raw data?

A. Information is always numerical, whereas data are always textual.

B. Information is data organized and interpreted in context.

C. Information is necessarily more accurate than data.

D. Information can only be produced by machine learning.

Correct Answer: B. Information is data organized and interpreted in context.

Question 2

Which characteristic means that a traditional data warehouse preserves historical states and trends?

A. Subject-oriented

B. Integrated

C. Time-variant

D. Nonvolatile

Correct Answer: C. Time-variant

Question 3

What is the primary purpose of an operational database?

A. Supporting routine current transactions

B. Storing only unstructured archival data

C. Discovering clusters in historical data

D. Generating strategic reports without updates

Correct Answer: A. Supporting routine current transactions

Question 4

Which activity is part of KDD but is broader than the data-mining algorithm itself?

A. Only changing database hardware

B. Data selection and preprocessing

C. Eliminating all domain expertise

D. Guaranteeing causal conclusions

Correct Answer: B. Data selection and preprocessing

Question 5

Which task assigns observations to predefined categories?

A. Clustering

B. Classification

C. Association analysis

D. Anomaly detection

Correct Answer: B. Classification

Question 6

A system groups customers without predefined labels according to purchasing similarity. Which task is being performed?

A. Regression

B. Classification

C. Clustering

D. Prescriptive analytics

Correct Answer: C. Clustering

Question 7

Which statement about association analysis is correct?

A. It proves that one item causes another to be purchased.

B. It identifies items or events that occur together.

C. It requires a numerical target variable.

D. It can only be applied to medical data.

Correct Answer: B. It identifies items or events that occur together.

Question 8

Why can a model with high historical accuracy still perform poorly in deployment?

A. Historical data may not represent future conditions.

B. Accuracy always decreases when data are structured.

C. Deployment removes all relevant variables.

D. Machine learning cannot use warehouse data.

Correct Answer: A. Historical data may not represent future conditions.

Question 9

Which practice is most directly related to data governance?

A. Assigning data ownership and maintaining metadata

B. Removing all historical records

C. Using the most complex available algorithm

D. Avoiding validation to reduce project time

Correct Answer: A. Assigning data ownership and maintaining metadata

Question 10

In the illustrative hospital case, why must the prediction point be defined before selecting variables?

A. It determines which information would legitimately be available at prediction time.

B. It guarantees that the model will be unbiased.

C. It eliminates the need for clinical review.

D. It ensures that all missing values are removed.

Correct Answer: A. It determines which information would legitimately be available at prediction time.

Data Mining and Data Warehousing
Chapter 1 of 15