Fundamentals of Business Analytics

Chapter 11
Machine Learning, AI and Generative AI

Bachelors Program in Business Analytics
Fundamentals of Business Analytics   •   Bachelor

Machine Learning, AI and Generative AI

Introduction

Business analytics has expanded from reporting what happened to predicting what is likely to happen and recommending what an organization should do. Machine learning (ML), artificial intelligence (AI), natural language processing (NLP), recommendation systems and generative AI are central technologies in this development. They allow organizations to detect patterns in large datasets, automate decisions, interpret unstructured information and support human creativity and problem solving.

These technologies, however, are not automatically intelligent, objective or reliable. A model can be accurate on historical data but fail when customer behaviour changes. A language model can produce fluent but false information. A recommendation system can optimize clicks while reducing customer choice. Effective business analytics therefore requires both technical understanding and critical evaluation.

This chapter examines the main forms of machine learning, their business applications, evaluation methods, limitations and governance requirements. Particular attention is given to accuracy, explainability, hallucination, data and concept drift, human oversight and responsible human–AI collaboration.

Learning Objectives

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

  1. Distinguish AI, machine learning, deep learning and generative AI.
  2. Explain supervised, unsupervised and reinforcement learning.
  3. Select suitable business use cases for classification, regression, clustering, recommendation, NLP and generative AI.
  4. Interpret common evaluation metrics and recognize inappropriate uses of accuracy.
  5. Explain explainability, hallucination, drift, bias, privacy and human oversight.
  6. Design a responsible human–AI workflow for business decision-making.

1. Artificial Intelligence and Machine Learning

Artificial intelligence is the broad field concerned with computational systems that perform tasks commonly associated with human intelligence, such as perception, language understanding, reasoning, learning and planning. Machine learning is a subfield of AI in which a system learns patterns from data rather than being programmed with every rule explicitly.

A traditional rule-based system might apply the instruction: “If an invoice exceeds a threshold and the supplier is new, send it for review.” A machine-learning system may infer risk patterns from thousands of historical invoices. The rule-based system is often transparent and predictable; the ML system may detect more complex relationships but can be harder to explain.

Deep learning is a form of machine learning using multilayer neural networks. It is particularly effective for images, speech, language and other high-dimensional data. Generative AI refers to systems that create new content—such as text, images, audio, code or synthetic data—based on learned patterns. Generative AI is therefore a capability or application category, not a replacement for all other types of AI.

A useful distinction is:

ConceptMain purposeTypical output
Descriptive analyticsUnderstand past eventsReports and dashboards
Predictive analyticsEstimate future or unknown outcomesRisk score or forecast
Prescriptive analyticsRecommend an actionSuggested price or allocation
Machine learningLearn patterns from dataPrediction, classification or grouping
Generative AIProduce new contentDraft, summary, image or code

2. The Machine-Learning Workflow

A business ML project normally follows a lifecycle rather than a single modelling step.

  1. Problem definition: Specify the decision, user, target outcome, time horizon and consequences of error.
  2. Data acquisition: Obtain relevant historical, operational or external data, ensuring lawful and ethical access.
  3. Data preparation: Clean records, handle missing values, encode categories, define labels and document transformations.
  4. Exploratory analysis: Examine distributions, relationships, outliers, possible leakage and subgroup differences.
  5. Model development: Select an algorithm and train it using a development dataset.
  6. Validation and testing: Evaluate performance on data not used to fit the model.
  7. Deployment: Integrate the model into a business process or decision-support tool.
  8. Monitoring: Track performance, data quality, fairness, user behaviour and operational outcomes.
  9. Review or retirement: Retrain, modify or withdraw the model when its assumptions no longer hold.

Data should commonly be divided into training, validation and test sets. The training set estimates model parameters; the validation set supports model selection and tuning; the test set provides a final estimate of generalization performance. The test set should not repeatedly influence development decisions. Otherwise, reported performance becomes optimistically biased.

A central danger is data leakage: information unavailable at the time of a real decision is accidentally included as a predictor. For example, using a customer’s final repayment status to predict whether that customer will default produces an apparently powerful but unusable model.

3. Supervised Learning

In supervised learning, a model learns from examples containing input variables and a known target. Let the input vector be x and the target be y. The model estimates a function f(x) so that its prediction ŷ = f(x) is useful for new observations.

3.1 Classification

Classification predicts a categorical outcome. Examples include:

  • fraudulent or legitimate transaction;
  • customer churn or retention;
  • approved or referred loan application;
  • positive, neutral or negative sentiment.

For binary classification, a probability model may estimate p = P(y = 1|x). A classification threshold converts the probability into an action. If the threshold is 0.5, cases with p ≥ 0.5 may be labelled positive. The threshold should instead reflect the relative costs of false positives and false negatives.

The confusion matrix summarizes binary classification results:

Actual positiveActual negative
Predicted positiveTrue positive (TP)False positive (FP)
Predicted negativeFalse negative (FN)True negative (TN)

Important measures are:

Accuracy = (TP + TN) ÷ (TP + TN + FP + FN)
Precision = TP ÷ (TP + FP)
Recall = TP ÷ (TP + FN)

Accuracy is the proportion of all predictions that are correct. Precision is the proportion of predicted positives that are actually positive. Recall, also called sensitivity or true-positive rate, is the proportion of actual positives detected. These measures assume a fixed classification threshold and should be interpreted with the business costs of errors.

For example, suppose a fraud model identifies 90 fraudulent transactions correctly, misses 10 fraudulent transactions and incorrectly flags 30 legitimate transactions. Then TP = 90, FN = 10 and FP = 30. If there are 870 true negatives, accuracy is 960 ÷ 1,000 = 96%, precision is 90 ÷ 120 = 75%, and recall is 90 ÷ 100 = 90%. The high accuracy does not mean every alert is reliable: one quarter of alerts are false positives.

The F1 score is the harmonic mean of precision and recall:

F1 = 2 × (Precision × Recall) ÷ (Precision + Recall)

It is useful when both precision and recall matter, but it does not incorporate monetary costs. In highly imbalanced problems, such as rare fraud, accuracy can be misleading because a model that predicts “not fraud” for every transaction may appear accurate.

3.2 Regression

Regression predicts a numerical quantity, such as sales, delivery time, demand or customer lifetime value. Common measures include mean absolute error (MAE) and root mean squared error (RMSE):

MAE = (1 ÷ n) ∑ᵢ₌₁ⁿ |yᵢ − ŷᵢ|
RMSE = √[(1 ÷ n) ∑ᵢ₌₁ⁿ (yᵢ − ŷᵢ)²]

Here, n is the number of observations, yᵢ is the observed value and ŷᵢ is the prediction. MAE has the same units as the target and weights errors linearly. RMSE also has the same units but penalizes large errors more strongly because errors are squared before averaging. These formulas assume that observations and their errors have been defined consistently; the choice between them should reflect the decision context.

3.3 Common Supervised Algorithms

Linear regression is useful when a roughly additive relationship is plausible and interpretability is important. Decision trees divide observations into rule-like regions. Random forests combine many trees and can provide strong performance on tabular data. Gradient-boosting methods build sequentially improved trees and often perform well in structured business datasets. Neural networks can represent complex relationships but generally require careful tuning, substantial data and stronger operational controls.

No algorithm is universally best. Model selection should consider predictive performance, interpretability, latency, cost, data availability, security and the consequences of error.

4. Unsupervised Learning

Unsupervised learning works with data for which a target label is not supplied. Its purpose may be exploration, compression, anomaly detection or discovering structure.

4.1 Clustering

Clustering groups observations that are similar according to selected features. A retailer may group customers by purchase frequency, average order value and product categories. A common method, k-means, assigns observations to k clusters by minimizing within-cluster squared distance:

J = ∑ⱼ₌₁ᵏ ∑ₓ∈Cⱼ ||x − μⱼ||²

Here, Cⱼ is cluster j, μⱼ is its centroid and ||x − μⱼ||² is squared distance from observation x to that centroid. K-means requires the analyst to choose k, is sensitive to feature scaling and may perform poorly for non-spherical clusters or strong outliers.

Clusters are not automatically real customer types. They depend on the variables, distance measure and preprocessing choices. Business users should validate whether clusters are stable, understandable and actionable.

4.2 Association and Anomaly Detection

Association analysis identifies items that occur together, such as bread and spreads in a basket. Anomaly detection identifies observations that differ substantially from normal patterns, such as unusual network traffic or procurement activity. An anomaly is not necessarily fraud; it is a signal for investigation.

Dimensionality-reduction methods summarize many variables in fewer dimensions, supporting visualization or computational efficiency. They can be useful exploratory tools but may make substantive interpretation more difficult.

5. Recommendation Systems

Recommendation systems estimate which products, services or content a user may value. They support e-commerce, streaming, banking offers and workforce learning.

Content-based filtering recommends items similar to items a user previously liked, using item attributes. Collaborative filtering uses patterns across users and items; for example, users with similar histories may receive similar recommendations. Hybrid systems combine both approaches and may also use context such as time, device, location or inventory.

Evaluation should extend beyond click-through rate. Useful measures include conversion, revenue, repeat use, margin, diversity, novelty, coverage and customer satisfaction. A system optimized only for clicks may promote sensational content or low-margin products. Recommendations also face the cold-start problem: little information exists for a new user or item. Feedback loops can reinforce popularity and reduce exposure for less-established suppliers.

6. Natural Language Processing

Natural language processing enables computers to work with human language. Business applications include search, document classification, sentiment analysis, named-entity extraction, translation, transcription, summarization and conversational interfaces.

A language-processing workflow may include text collection, tokenization, representation, model inference and evaluation. Modern systems commonly use embeddings—numerical representations that capture aspects of linguistic meaning—and transformer-based architectures. The technical sophistication of a model does not remove the need to examine training data, domain vocabulary, privacy and error patterns.

NLP outputs can be probabilistic and context-dependent. Sentiment tools may interpret sarcasm poorly; entity extraction may confuse a product name with a person; automated summaries may omit qualifications. Human review is particularly important for legal, medical, employment and customer-complaint applications.

7. Generative AI and Large Language Models

Generative AI models learn statistical patterns in data and generate outputs conditioned on an instruction or context. Large language models (LLMs) generate text by repeatedly estimating a likely next token. A token may be a word, part of a word or punctuation symbol. The generated response is therefore not a direct database lookup and should not be assumed to be factually verified.

A typical enterprise use case combines a foundation model with instructions, organizational documents, access controls and evaluation. Retrieval-augmented generation (RAG) retrieves relevant documents and supplies them as context to the model. RAG can improve grounding, but it cannot guarantee correctness: retrieval may be incomplete, documents may be outdated and the model may misinterpret evidence.

Suitable uses include drafting a first version of a report, summarizing internal documents, generating code suggestions, answering routine questions from an approved knowledge base and supporting scenario analysis. High-risk uses—such as making final credit, employment, insurance or medical decisions without qualified review—require strong safeguards and may be prohibited or restricted by law or policy.

Hallucination and Verification

A hallucination is an output that appears plausible but is unsupported, fabricated or incorrect. It may involve invented citations, incorrect calculations, nonexistent policies or confident statements beyond the supplied evidence. Hallucination risk increases when prompts are ambiguous, information is missing or the model is asked about niche or current facts.

Controls include grounding responses in approved sources, requiring citations, using structured output, restricting the model’s scope, testing representative questions, adding calculators or deterministic software for numerical work, and requiring human verification. Fluency is not evidence of truth.

8. Model Evaluation Beyond Accuracy

Evaluation should occur at several levels.

LevelQuestions
TechnicalIs predictive performance acceptable on unseen data?
OperationalDoes the system meet speed, availability and integration requirements?
BusinessDoes it improve a meaningful outcome such as cost, service or revenue?
HumanCan users understand, challenge and appropriately use the output?
Social and legalAre privacy, fairness, safety and regulatory obligations satisfied?

Explainability

Explainability concerns how an analyst or affected person can understand a model’s behaviour. Global explanations describe overall patterns, such as which features tend to influence predictions. Local explanations describe one case. Feature importance, partial-dependence plots, counterfactual examples and inherently interpretable models can assist explanation, but each has limitations.

An explanation is not automatically a causal account. If an application is rejected because income and account activity correlate with a model score, that does not prove either variable caused repayment failure. Explanations should be accurate, stable and understandable to their audience.

Calibration and Thresholds

A probability forecast is calibrated when, among cases assigned probability p, approximately a proportion p actually has the outcome. Calibration matters when probabilities inform resource allocation or risk thresholds. A model can rank cases well but be poorly calibrated. Thresholds should be selected with business costs, capacity and fairness considerations rather than defaulting to 0.5.

Drift

Data drift occurs when the distribution of inputs changes. Concept drift occurs when the relationship between inputs and the target changes. For example, a fraud model may face data drift when a new payment channel changes transaction patterns, and concept drift when criminals adopt a new strategy.

Monitoring may compare current feature distributions with reference data, track missingness and monitor outcome metrics when labels become available. Drift does not always mean the model is invalid, but it should trigger investigation. Responses may include recalibration, retraining, a changed threshold, additional data collection or temporary suspension.

9. Responsible AI and Human Oversight

Responsible AI is the practice of designing and using AI consistently with organizational values, professional duties, human rights and applicable law. Core principles include:

  • Fairness: assess unequal error rates and possible discriminatory effects across relevant groups.
  • Transparency: communicate the system’s purpose, limitations and use of automated processing.
  • Privacy: minimize data, protect sensitive information and define retention and access rules.
  • Security: defend models, prompts and data against unauthorized access and manipulation.
  • Accountability: assign named owners for deployment, monitoring, complaints and remediation.
  • Safety and reliability: test failure modes and provide fallback procedures.

Fairness cannot be reduced to one universal metric. Equal selection rates, equal false-positive rates and equal calibration may not all be simultaneously achievable when groups differ in base rates. The appropriate assessment depends on the decision, legal context, affected groups and consequences. Fairness analysis should be performed before deployment and continuously afterward.

Human oversight should be meaningful rather than symbolic. A reviewer needs adequate time, information, authority to override the system and training about automation bias. “Human in the loop” is ineffective if staff simply approve every model output or are penalized for disagreement. A risk-based workflow may permit automatic handling of low-risk cases while escalating uncertain, novel or high-impact cases.

A useful governance record includes the intended purpose, data sources, model version, performance measures, known limitations, approval authority, monitoring plan, incident process and retirement conditions. Organizations should also distinguish between a model’s recommendation and the person or institution legally responsible for the final decision.

10. Human–AI Collaboration

Responsible collaboration treats AI as an assistive system whose role is explicitly defined. A sound workflow is:

  1. Define the decision and human responsibility.
  2. Ask the system for a bounded task and provide reliable context.
  3. Check sources, calculations, assumptions and sensitive claims.
  4. Compare the output with independent evidence or a second method.
  5. Record material changes and the basis for the final decision.
  6. Monitor outcomes and report failures.

AI is often effective at generating alternatives, summarizing large volumes and identifying patterns for review. Humans remain essential for contextual judgment, value choices, accountability, empathy and handling exceptional cases. Collaboration should improve human capability, not obscure responsibility.

11. Applied Case: Retail Demand and Customer Support Assistant

This is an illustrative case.

Background

A medium-sized retailer sells household goods through stores and an online channel. It experiences stockouts for popular items, excess inventory for seasonal products and a growing volume of customer-service enquiries.

Problem

Management proposes one AI project to forecast weekly demand and another to create a generative-AI support assistant. The organization wants lower inventory cost and faster service but must avoid inaccurate answers and unfair treatment of customers.

Analysis

The analytics team defines demand forecasting at product-store-week level. It separates historical data by time, reserving the most recent period for testing. Promotional discounts, holidays, price, inventory availability and prior sales are considered. The team recognizes that observed sales understate true demand when an item was out of stock; using raw sales without adjustment could teach the model that stockouts imply low demand.

For customer support, the team identifies approved policy documents and creates a retrieval-based assistant. The assistant is instructed to answer only from current documents, cite the relevant policy and escalate refund disputes, safety issues and uncertain cases. Customer personal information is minimized and access is logged.

Approach and Solution

The forecasting model is compared with a seasonal baseline. MAE is reported in units because inventory managers can interpret it directly. Performance is examined by product category, store size and promotion status rather than only as one overall average. The support assistant is tested on a set of ordinary, adversarial and ambiguous questions. Testers check factual accuracy, citation quality, refusal behaviour, privacy leakage and escalation.

The assistant does not issue refunds autonomously. It drafts a response and presents the source policy to an employee. A monitoring dashboard tracks forecast error, stockout rates, escalation rates, unsupported claims and customer complaints. A documented owner reviews the system monthly and after policy changes.

Outcome

The retailer deploys the forecasting model for replenishment suggestions, not automatic purchasing. Managers can override recommendations and record reasons. The support assistant handles routine policy questions while routing high-risk matters to trained staff. Initial business evaluation focuses on reduced stockouts, inventory holding cost, response time and customer satisfaction—not merely model scores.

Learning Points

The case demonstrates that a suitable use case begins with a clearly defined decision. Data quality and leakage can be more important than algorithm choice. Generative AI requires grounding and escalation controls. Human oversight is meaningful when employees retain authority, receive evidence and are evaluated on outcomes rather than blind acceptance of automation.

12. Contemporary Developments and Best Practices

Foundation models are increasingly multimodal, processing combinations of text, images, audio and structured data. Smaller domain-specific models may offer lower cost, faster response and improved privacy. AI agents can plan and call tools, but their expanded autonomy increases the need for permission boundaries, audit logs and confirmation before consequential actions.

Organizations should adopt a lifecycle approach: inventory AI systems, classify risk, document data and purpose, evaluate before release, monitor after release and provide mechanisms for correction. They should avoid uploading confidential information to unapproved tools, verify generated code and content, maintain version control, and train staff to recognize automation bias and hallucination.

The most important managerial question is not “Can AI perform this task?” It is “Under what conditions can this task be performed safely, lawfully, measurably and accountably?”

Chapter Summary

Machine learning enables systems to learn patterns from data. Supervised learning uses labelled outcomes for classification and regression, while unsupervised learning discovers structure through clustering, association and anomaly detection. Recommendation systems combine user, item and contextual information, and NLP processes human language for search, classification, extraction and summarization.

Generative AI creates text and other content but may hallucinate unsupported information. Retrieval, source citation, structured outputs, testing and human review reduce—but do not eliminate—this risk. Model quality must be evaluated using appropriate metrics such as precision, recall, F1, MAE and RMSE, alongside calibration, operational results and subgroup performance.

Explainability supports understanding but is not the same as causality. Data drift and concept drift require monitoring and possible retraining. Responsible AI requires fairness, privacy, security, transparency, accountability and meaningful human oversight. Effective human–AI collaboration assigns responsibility clearly, constrains AI tasks, verifies outputs and uses escalation for uncertain or high-impact decisions.

Key Terms

Artificial intelligence: The field of computational systems performing tasks associated with human intelligence.

Machine learning: Learning patterns from data to support predictions or decisions.

Supervised learning: Learning from inputs paired with known target outcomes.

Classification: Prediction of a categorical outcome.

Regression: Prediction of a numerical outcome.

Unsupervised learning: Learning structure from data without supplied target labels.

Clustering: Grouping observations according to similarity.

Recommendation system: A system that suggests items, content or actions.

Natural language processing: Computational processing of human language.

Generative AI: AI that produces new content based on learned patterns.

Large language model: A model trained to predict and generate language across many contexts.

Hallucination: A plausible-looking but unsupported or incorrect AI output.

Explainability: The degree to which model behaviour can be understood.

Data leakage: Use of information unavailable at the time of the intended prediction.

Data drift: Change in the distribution of input data over time.

Concept drift: Change in the relationship between inputs and the target over time.

Precision: The proportion of predicted positives that are actually positive.

Recall: The proportion of actual positives detected by a model.

Human oversight: Appropriate human authority to review, challenge and control AI use.

Responsible AI: AI development and use consistent with ethical, legal and social obligations.

Review Questions

Short Answer Questions

  1. Distinguish artificial intelligence, machine learning and generative AI.
  2. What is the difference between precision and recall?
  3. Why can accuracy be misleading for rare-event classification?
  4. Define data drift and concept drift.
  5. What is a hallucination in a generative-AI system?

Long Answer Questions

  1. Explain the machine-learning lifecycle from problem definition through monitoring.
  2. Compare supervised and unsupervised learning, including suitable business applications for each.
  3. Discuss the advantages and limitations of content-based, collaborative and hybrid recommendation systems.
  4. Explain why explainability is important in business decisions and why it should not be confused with causality.
  5. Describe the principles and practices required for responsible human–AI collaboration.

Analytical / Application Questions

  1. A fraud model produces 90 true positives, 10 false negatives, 30 false positives and 870 true negatives. Calculate accuracy, precision and recall, and explain which measure a bank should prioritize if missed fraud is much more costly than customer inconvenience.
  2. A retailer wants an LLM to answer refund questions using internal policies. Design a workflow covering data preparation, retrieval, response verification, escalation and monitoring.
  3. A customer-churn model performs well during development but its recall falls sharply after a competitor launches a new low-price service. Diagnose the likely problem and propose a monitoring and remediation plan.

Multiple Choice Questions with Answers

Question 1

Which task is an example of supervised classification?

A. Grouping customers without predefined labels

B. Predicting whether a transaction is fraudulent or legitimate

C. Reducing many variables to two dimensions for visualization

D. Generating a product description from a prompt

Correct Answer: B. Predicting whether a transaction is fraudulent or legitimate

Question 2

A model has TP = 80 and FP = 20. What is its precision?

A. 20%

B. 50%

C. 80%

D. 100%

Correct Answer: C. 80%

Question 3

Why can accuracy be misleading in fraud detection?

A. Fraud models never use labelled data

B. Fraud is often rare, so predicting no fraud may appear highly accurate

C. Accuracy measures only false positives

D. Accuracy cannot be calculated from a confusion matrix

Correct Answer: B. Fraud is often rare, so predicting no fraud may appear highly accurate

Question 4

Which method groups observations according to similarity without a supplied target label?

A. Clustering

B. Regression

C. Classification

D. Calibration

Correct Answer: A. Clustering

Question 5

What is a major purpose of retrieval-augmented generation?

A. To eliminate the need for any training data

B. To guarantee that every generated statement is true

C. To provide relevant source material as context for generation

D. To convert every text model into a database

Correct Answer: C. To provide relevant source material as context for generation

Question 6

Which statement best describes a hallucination?

A. A deliberate refusal to answer a question

B. A plausible-looking output that is unsupported or incorrect

C. A change in the distribution of input data

D. A correctly cited answer from an approved document

Correct Answer: B. A plausible-looking output that is unsupported or incorrect

Question 7

What is concept drift?

A. A change in the relationship between inputs and the target

B. A reduction in the number of model features

C. A method for selecting a classification threshold

D. A technique for encrypting customer records

Correct Answer: A. A change in the relationship between inputs and the target

Question 8

Which measure is expressed in the same units as the numerical target and averages absolute errors?

A. Accuracy

B. F1 score

C. Mean absolute error

D. Precision

Correct Answer: C. Mean absolute error

Question 9

Which practice represents meaningful human oversight?

A. Requiring employees to approve every output without reviewing it

B. Allowing qualified staff to review evidence and override the system

C. Removing all audit logs to protect privacy

D. Using the model only when its performance is unknown

Correct Answer: B. Allowing qualified staff to review evidence and override the system

Question 10

Why should a test dataset generally be kept separate from repeated model-tuning decisions?

A. To prevent optimistic estimates of generalization performance

B. To increase data leakage

C. To ensure the model memorizes test examples

D. To replace the need for validation data

Correct Answer: A. To prevent optimistic estimates of generalization performance

Fundamentals of Business Analytics
Chapter 11 of 15