Chapter 12
Analytics, Machine Learning, and Generative AI Platforms
Graduate Program in Business Analytics
Big Data & Cloud Engineering
•
Graduate
Analytics, Machine Learning, and Generative AI Platforms
Introduction and Context
Modern organisations increasingly depend on a common data foundation that supports reporting, predictive modelling, operational decisions, and generative artificial intelligence (AI). These capabilities are often implemented as separate products, but their reliability depends on shared engineering practices: governed data pipelines, reproducible transformations, secure access, observability, and clear accountability.
A business intelligence dashboard, a fraud-detection model, and a retrieval-augmented generation (RAG) assistant may appear to be different applications. Technically, however, each requires trustworthy data, metadata, scalable computation, controls over access, and mechanisms for evaluating output quality. The central challenge is therefore not simply selecting a cloud service or machine-learning library. It is designing an integrated platform in which data can move from source systems to decisions while remaining traceable, secure, reproducible, and economically sustainable.
This chapter examines the relationship among governed analytics pipelines, business intelligence, feature platforms, MLOps, vector databases, RAG, and generative AI. It also evaluates model monitoring, scalability, reproducibility, and the characteristics of AI-ready data.
Learning Objectives
After studying this chapter, you should be able to:
Explain how governed data pipelines support BI, machine learning, and generative AI.
Distinguish data platforms, feature platforms, model registries, vector databases, and AI applications.
Design an MLOps lifecycle that addresses reproducibility, deployment, monitoring, and retraining.
Explain embeddings, vector similarity, and the architecture of RAG systems.
Evaluate data and model quality using appropriate technical and business metrics.
Assess scalability, security, privacy, governance, and cost trade-offs.
Recommend an integrated architecture for an analytics and AI use case.
1. From Data Pipelines to Decision Systems
A data pipeline is a controlled sequence that collects, validates, transforms, stores, and distributes data. Traditional pipelines generally support descriptive analytics: historical reports, scorecards, and dashboards. Contemporary platforms extend the pipeline to support three related forms of intelligence:
Descriptive intelligence: What happened?
Predictive intelligence: What is likely to happen?
Generative intelligence: What information, explanation, or content can be produced in response to a request?
The layers are related but not interchangeable. A well-designed dashboard does not automatically provide a valid prediction model. Similarly, a language model connected to a document store does not automatically provide reliable answers. Each capability requires suitable data representations, evaluation criteria, and controls.
A typical architecture contains the following logical layers:
Ingestion: batch or streaming collection, schema handling, and source authentication.
Storage: raw, cleansed, curated, and feature or embedding stores.
Transformation: quality rules, joins, aggregations, feature computation, and document preparation.
Serving: semantic models for BI, online features for inference, vector retrieval, and application APIs.
Governance and observability: cataloguing, lineage, access control, quality monitoring, audit records, and cost monitoring.
Consumption: dashboards, decision services, machine-learning applications, and generative AI interfaces.
Integrated data and AI platform architecture
Figure: Integrated data and AI platform architecture
Figure: A shared governed foundation supports BI, machine learning, and generative AI workloads.
2. Governance as an Engineering Property
Governance is not merely a policy document or an approval committee. In a mature platform, governance is implemented through technical controls and operating practices. Important controls include:
Data ownership: named responsibility for definitions, quality, access, and retention.
Cataloguing: searchable descriptions of datasets, fields, models, reports, and embeddings.
Lineage: records showing how a dashboard, feature, or generated answer depends on source data.
Classification: labels such as public, internal, confidential, and regulated.
Access control: identity-based permissions, least privilege, encryption, and segregation of duties.
Quality contracts: explicit expectations for completeness, validity, timeliness, uniqueness, and consistency.
Auditability: immutable or controlled records of data access, model versions, prompts, retrieved sources, and outputs.
Data quality can be represented as a multidimensional concept. For example, completeness for a field may be calculated as:
Completeness = (number of non-null required values) ÷ (number of required records)
The measure ranges from 0 to 1 when the denominator is positive. It is meaningful only when the definition of a required value and the population of records are stable. A dataset can have high completeness but still contain inaccurate or biased values.
For a binary classification model, precision and recall are commonly defined as:
Precision = TP ÷ (TP + FP)
Recall = TP ÷ (TP + FN)
Here, TP denotes true positives, FP false positives, and FN false negatives. Precision measures the proportion of predicted positives that are correct; recall measures the proportion of actual positives that are detected. Neither metric is universally superior. The appropriate choice depends on the relative cost of missed cases and false alarms.
Governance must also address semantic consistency. If “active customer” means a customer with a purchase in the previous 30 days in one report and 90 days in another, technically correct pipelines can still produce contradictory decisions. A semantic layer, shared metric definitions, and versioned business logic reduce this risk.
3. BI and the Semantic Layer
Business intelligence platforms transform curated data into reports, dashboards, alerts, and self-service analyses. Their reliability depends on a semantic layer that defines measures, dimensions, relationships, filters, and authorised views.
A semantic layer should distinguish:
Facts: measurable events such as orders, claims, or payments.
Dimensions: descriptive entities such as customer, product, geography, or time.
Measures: calculations such as revenue, margin, or conversion rate.
Grain: the level represented by each row, such as one order line or one daily customer record.
Grain is especially important. Joining a customer-level table to an order-line table without appropriate aggregation can duplicate values and inflate revenue. Data modelling therefore remains a core engineering responsibility even when cloud platforms offer automated tools.
BI governance includes certified datasets, row-level security, report testing, usage monitoring, and controlled promotion from development to production. A dashboard should have an owner, a refresh expectation, a definition of each major metric, and a process for handling source changes.
4. Feature Platforms and Machine-Learning Data
A feature is a measurable input used by a machine-learning model. Examples include the number of transactions in the last 30 days, average delivery delay, or the time since a customer’s most recent interaction.
Feature platforms generally support:
Feature definition: business meaning, data type, transformation, owner, and sensitivity.
Offline storage: historical feature values for training and evaluation.
Online storage: low-latency values for real-time inference.
Point-in-time retrieval: selecting values that would have been available at the prediction time.
Monitoring: freshness, distribution, missingness, and usage.
Point-in-time correctness prevents target leakage, in which information unavailable at prediction time enters the training data. Suppose a model predicts whether an insurance claim will require manual review at claim submission. A feature derived from the final settlement status would produce excellent historical accuracy but would be unusable at deployment.
Feature transformations should be versioned like source code. If the training pipeline computes “30-day spend” differently from the production inference pipeline, the model experiences training-serving skew. A shared transformation definition or a carefully tested dual-serving design helps maintain consistency.
5. MLOps: From Experiment to Reliable Service
MLOps combines machine learning, software engineering, data engineering, and operations. Its purpose is to make model development repeatable and model operation observable.
A robust lifecycle includes:
Problem definition: specify the decision, population, prediction horizon, intervention, and success criteria.
Data preparation: establish provenance, labels, sampling rules, quality checks, and leakage controls.
Experimentation: track code, dependencies, parameters, datasets, random seeds, and results.
Validation: evaluate statistical performance, fairness, robustness, calibration, and business value.
Registration: store the model artifact, metadata, approval status, and intended use.
Deployment: use batch, online, streaming, or embedded deployment as appropriate.
Monitoring: observe service health, data, predictions, outcomes, and business effects.
Retraining or retirement: respond to drift, changed policy, degraded performance, or obsolete objectives.
Reproducibility means that an authorised practitioner can reconstruct a result or explain why exact reproduction is not possible. A reproducibility record should include the code commit, container or dependency specification, data snapshot or immutable reference, feature definitions, hyperparameters, random seed, hardware assumptions, model artifact, and evaluation dataset.
Exact numerical reproduction may still be difficult because distributed systems, hardware accelerators, nondeterministic algorithms, and changing libraries can produce small differences. This does not invalidate reproducibility; it requires documenting tolerance thresholds and sources of variation.
Monitoring dimensions
Model monitoring should not be reduced to a single accuracy number. It commonly includes:
Infrastructure: latency, throughput, memory, errors, and availability.
Input data: missing values, range violations, category changes, and distribution drift.
Predictions: score distributions, class proportions, and confidence levels.
Ground-truth performance: precision, recall, calibration, loss, or forecast error when labels arrive.
Fairness: performance and error rates across relevant groups, subject to legal and ethical requirements.
Business outcomes: revenue, cost, customer experience, risk, or operational workload.
A common drift measure is the population stability index (PSI), often used as a heuristic:
PSI = ∑ᵢ (Aᵢ − Eᵢ) × ln(Aᵢ ÷ Eᵢ)
Here, Aᵢ is the actual proportion in bin i and Eᵢ is the expected or reference proportion. Both proportions must be positive; bins should be defined consistently, and the result should be interpreted as a signal rather than proof of model degradation. Threshold conventions vary by organisation and do not replace outcome-based validation.
For regression, mean absolute error is:
MAE = (1 ÷ n) × ∑ᵢ₌₁ⁿ |yᵢ − ŷᵢ|
where n is the number of observations, yᵢ is the observed value, and ŷᵢ is the prediction. MAE has the same units as the target and is less sensitive to large errors than mean squared error.
6. Embeddings and Vector Databases
Generative AI applications often need to locate semantically related content. An embedding model maps text, images, or other objects to numerical vectors. Similar meanings should be represented by vectors that are close under a selected similarity measure.
Cosine similarity between vectors a and b is:
cos(θ) = (a · b) ÷ (||a||₂ × ||b||₂)
The dot product a · b is divided by the Euclidean norms ||a||₂ and ||b||₂. For nonzero vectors, the result lies between −1 and 1. In many text-embedding applications, higher cosine similarity indicates greater directional similarity, although the embedding model and indexing system determine how the score should be interpreted.
A vector database typically provides:
vector storage and indexing;
approximate nearest-neighbour search;
metadata filtering;
document or chunk identifiers;
update and deletion mechanisms;
replication, backup, and access control.
Approximate search trades some recall for speed and lower resource consumption. Important design variables include vector dimensionality, index type, distance metric, number of retrieved candidates, metadata filters, and update frequency. A vector store should not be treated as a replacement for a governed source repository: it is an index or serving representation, not necessarily the authoritative record.
Chunking is a major quality decision. Very small chunks may lose context; very large chunks may dilute relevance and exceed context limits. Good chunking respects document structure, headings, tables, definitions, and access boundaries. Metadata should include source identity, version, date, page or section, permissions, and content type.
7. Retrieval-Augmented Generation
RAG combines information retrieval with a generative model. A basic RAG workflow is:
Ingest and classify source documents.
Extract text and preserve structure and metadata.
Divide documents into meaningful chunks.
Generate embeddings and index them.
Convert a user query into an embedding.
Retrieve relevant chunks using vector, keyword, or hybrid search.
Apply permission filters and optionally rerank results.
Construct a prompt containing instructions and retrieved evidence.
Generate an answer.
Record sources, model version, prompt template, and evaluation signals.
RAG can reduce unsupported answers by giving the model access to authoritative, current material. It does not guarantee truth. Failure can occur because the source is absent, retrieval is poor, permissions are incorrectly applied, context is truncated, or the model misinterprets evidence.
Evaluation should therefore separate retrieval from generation:
Retrieval recall: whether relevant evidence appears among the retrieved results.
Precision of retrieval: how much retrieved material is relevant.
Groundedness or faithfulness: whether claims are supported by retrieved evidence.
Answer relevance: whether the response addresses the question.
Citation quality: whether references are accurate and useful.
Operational quality: latency, cost, availability, and refusal behaviour.
For high-risk uses, the system should cite sources, distinguish evidence from inference, refuse unsupported requests, and route uncertain cases to humans. Prompt engineering cannot compensate for missing or poorly governed source data.
8. Generative AI Platform Architecture
A production generative AI platform commonly includes a model gateway, prompt and policy management, retrieval services, tool connectors, safety filters, observability, and evaluation infrastructure. A gateway can provide model selection, rate limits, authentication, redaction, logging, and fallback behaviour.
Platform decisions include:
whether to use a hosted model, a self-hosted model, or a hybrid arrangement;
whether data may leave a regulated jurisdiction;
how prompts and outputs are retained;
how model updates are tested;
whether fine-tuning, RAG, or workflow rules are most suitable;
how token consumption and latency are controlled.
Fine-tuning changes model behaviour using additional examples. RAG supplies external knowledge at inference time. Workflow rules constrain actions and can be more reliable than asking a model to follow an unconstrained instruction. These techniques are complementary rather than interchangeable.
AI-ready data is structured for machine use while retaining meaning and governance. It should be:
discoverable through metadata and catalogues;
sufficiently complete, accurate, timely, and consistent;
represented with stable identifiers and explicit units;
accompanied by definitions, provenance, and version history;
accessible through secure, documented interfaces;
partitioned according to sensitivity and retention requirements;
suitable for both structured analysis and unstructured retrieval.
Documents require additional treatment: OCR quality, table preservation, language detection, duplicate removal, document versioning, access inheritance, and chunk-level provenance.
9. Scalability and Cost Engineering
Scalability has multiple dimensions. A system may scale in data volume, concurrent users, event rate, model size, retrieval load, or geographic distribution. Vertical scaling increases the capacity of a machine; horizontal scaling adds machines or service instances. Elastic cloud systems can adjust capacity, but elasticity introduces scheduling, quota, network, and cost-management challenges.
Batch inference is often cheaper and simpler when decisions do not require immediate responses. Online inference is appropriate when latency affects an operational decision. Streaming architectures are useful when events must be processed continuously, but they require attention to ordering, late data, replay, state management, and exactly-once or at-least-once semantics.
A simple cost model can help compare designs:
Total cost = compute cost + storage cost + network cost + model or API cost + operations cost
This is a conceptual accounting identity, not a universal pricing formula. Actual cost depends on provider pricing, reserved capacity, data transfer, request volume, token usage, storage duration, and staff effort. Cost should be evaluated alongside reliability, latency, privacy, and business value.
Caching, batching, prompt compression, smaller models, retrieval filtering, asynchronous processing, and autoscaling can reduce cost. However, aggressive compression or smaller models may reduce quality. Architecture should optimise the complete service rather than a single resource metric.
10. Illustrative Case: A Retail Returns Intelligence Platform
Background
A fictional national retailer receives product returns through stores, an e-commerce portal, and a logistics partner. Executives need dashboards showing return rates. Operations managers want to predict returns requiring manual inspection. Customer-service staff want an assistant that explains the returns policy and cites the relevant policy section.
Problem
The organisation’s reporting database contains duplicated customer and order records. The machine-learning team creates features independently from the BI team, producing inconsistent definitions. Policy documents exist in several versions, including scanned PDFs. There is no systematic record of model versions, retrieval sources, or assistant responses.
Analysis
The retailer identifies three risks:
A duplicated order join may inflate the return-rate measure.
Training data may include post-return information, causing leakage.
The assistant may disclose a policy document that the employee is not authorised to view.
The business defines a common grain for return events, an authoritative order identifier, and a certified return-rate measure. It also defines the prediction time as the moment a return request is submitted.
Approach and Solution
The platform team implements a governed ingestion process with schema validation, duplicate detection, and data-quality alerts. Curated tables feed both the BI semantic layer and a feature platform. Features include return frequency before the current request, product-category history, and shipment delay up to submission time. The feature registry records definitions and point-in-time availability.
The model is registered with its training data reference, code version, metrics, approval, and intended use. It is deployed first in shadow mode, where predictions are recorded but do not determine action. Monitoring checks input drift, latency, false-positive workload, and inspection outcomes across relevant customer and product groups.
Policy documents are classified, OCR-validated, versioned, and chunked by section. Embeddings are stored with policy version, effective date, and access metadata. Retrieval applies employee permissions before context is supplied to the language model. Responses cite the policy section and provide a controlled refusal when no authoritative evidence is found.
Outcome
The retailer obtains consistent return-rate reporting, a model that can be audited, and an assistant that distinguishes current policy from obsolete documents. The project does not eliminate human judgement. Instead, it makes evidence visible, controls access, and provides a repeatable process for updating the model and knowledge base.
Learning Points
The case demonstrates that successful AI depends on foundational engineering. Shared definitions prevent BI and ML disagreement; point-in-time features reduce leakage; document governance improves RAG; and monitoring must include operational and business outcomes rather than model accuracy alone.
11. Ethical, Legal, and Organisational Considerations
AI platforms can reproduce historical discrimination, expose confidential information, generate misleading content, or make decisions without adequate explanation. Organisations should conduct impact assessments proportionate to risk and establish human accountability for consequential decisions.
Important controls include data minimisation, purpose limitation, retention rules, consent or another lawful basis where required, access logging, encryption, secure deletion, and incident response. Sensitive attributes may be necessary for fairness auditing even when they are not used as model inputs; their collection requires careful legal and governance review.
Generative systems introduce additional concerns: prompt injection, data exfiltration through tools, insecure plugins, copyright and licensing questions, fabricated citations, and inappropriate automation. Retrieval filters must be enforced outside the model’s natural-language instructions. A model should not be trusted to enforce permissions merely because a prompt tells it to do so.
Organisational adoption also matters. Data owners, model risk teams, security specialists, domain experts, and business users need defined responsibilities. A technically sophisticated platform can fail if users do not understand its limitations or if incentives reward deployment speed over reliability.
12. Best Practices and Contemporary Directions
Effective platforms generally follow these practices:
Begin with a decision and measurable outcome, not with a fashionable model.
Establish ownership, definitions, lineage, and access controls early.
Treat data, features, prompts, evaluation sets, and models as versioned assets.
Separate development, testing, and production environments.
Test for leakage, bias, robustness, privacy, and security before deployment.
Use shadow, canary, or staged releases for high-impact models.
Monitor data, models, infrastructure, users, and business outcomes.
Prefer authoritative retrieval and explicit citations for knowledge-intensive assistants.
Design for failure: fallback responses, human escalation, rollback, and service degradation.
Measure total cost and carbon or resource implications where material.
Contemporary platform development is moving toward multimodal models, smaller specialised models, hybrid retrieval, agentic workflows, synthetic data, and more automated evaluation. These developments increase capability but also increase the need for controls. An agent that can call tools or modify records has a larger operational risk surface than a system that only produces text. The principle remains unchanged: autonomy should be proportional to verification, reversibility, and impact.
Chapter Summary
Analytics and AI platforms are integrated decision systems rather than isolated products. Governed pipelines provide the reliable data foundation for BI, feature platforms, vector search, and generative AI. Semantic layers protect consistency in business measures, while feature platforms support point-in-time correctness and reduce training-serving skew. MLOps makes experiments, deployments, monitoring, and retraining reproducible and accountable.
Embeddings enable semantic retrieval, and vector databases provide scalable similarity search with metadata filtering. RAG can improve the currency and traceability of generative responses, but it requires high-quality documents, permission-aware retrieval, evaluation, and human safeguards. AI-ready data must be discoverable, well-defined, versioned, secure, and suitable for both structured and unstructured processing.
Scalability involves latency, throughput, data volume, model serving, retrieval, and cost. Monitoring should cover infrastructure, inputs, predictions, outcomes, fairness, and business value. Ethical and regulatory responsibilities include privacy, security, transparency, accountability, and appropriate human oversight. The most durable platform strategy combines sound data engineering with disciplined model and AI governance.
Key Terms
AI-ready data: Data that is discoverable, well-defined, governed, accessible, and suitable for AI processing.
Business intelligence (BI): Technologies and practices for reporting, analysis, dashboards, and decision support.
Data lineage: A record of data origins, transformations, dependencies, and destinations.
Data quality: The degree to which data is accurate, complete, valid, consistent, timely, and fit for purpose.
Embedding: A numerical vector representation of an object such as text or an image.
Feature: An input variable used by a machine-learning model.
Feature store: A platform that manages reusable offline and online machine-learning features.
Generative AI: AI that produces content such as text, images, code, audio, or structured responses.
Inference: The process of using a trained model to produce predictions or outputs.
MLOps: Practices integrating machine learning with data engineering, software delivery, and operations.
Model drift: A change in data, relationships, or outcomes that can reduce model performance.
Point-in-time correctness: The property that features reflect only information available at the prediction time.
RAG: Retrieval-augmented generation, in which retrieved evidence is supplied to a generative model.
Semantic layer: A governed representation of business entities, measures, relationships, and definitions.
Training-serving skew: A mismatch between feature processing during training and production inference.
Vector database: A database or search system designed to store and retrieve vector representations.
Vector similarity: A measure of closeness between vectors, such as cosine similarity.
Model registry: A controlled repository for model artifacts, metadata, versions, and approval status.
Review Questions
Short Answer Questions
What is the purpose of a semantic layer in a BI platform?
Why is point-in-time correctness important in feature engineering?
Define retrieval-augmented generation.
Name three dimensions of model monitoring.
What information should accompany a document embedding?
Long Answer Questions
Explain how governance controls support BI, machine learning, and generative AI simultaneously.
Describe a complete MLOps lifecycle and identify the role of reproducibility at each stage.
Compare batch, online, and streaming inference, including appropriate use cases and trade-offs.
Explain how vector databases, chunking, metadata, and reranking contribute to RAG quality.
Discuss the ethical, legal, and organisational risks of deploying a generative AI platform.
Analytical / Application Questions
A bank’s fraud model performs well in testing but generates excessive alerts after a change in customer behaviour. Design a monitoring and response process that distinguishes data drift, concept drift, and operational failure.
Design an architecture for an internal legal-policy assistant that must preserve document permissions, cite sources, support versioned policies, and provide audit records.
A retailer wants to use one platform for dashboards, predictive demand forecasting, and an employee-facing RAG assistant. Propose the shared data assets, separate serving components, governance controls, and success metrics required.
Multiple Choice Questions with Answers
Question 1
Which control most directly prevents a machine-learning feature from using information that was unavailable when a prediction was made?
A. Point-in-time retrieval
B. Increasing vector dimensionality
C. Dashboard colour standardisation
D. Horizontal scaling
Correct Answer: A. Point-in-time retrieval
Question 2
What is the primary purpose of a semantic layer in business intelligence?
A. To train a language model
B. To define governed business measures and relationships
C. To encrypt every document
D. To replace operational databases
Correct Answer: B. To define governed business measures and relationships
Question 3
In RAG, what happens immediately before the generative model produces an answer?
A. The source documents are permanently deleted
B. Relevant retrieved content is supplied as context
C. All model monitoring is disabled
D. The vector index is converted into a spreadsheet
Correct Answer: B. Relevant retrieved content is supplied as context
Question 4
Which metric is defined as TP ÷ (TP + FP)?
A. Recall
B. Mean absolute error
C. Precision
D. Completeness
Correct Answer: C. Precision
Question 5
Why are embeddings used in a vector database?
A. To represent objects numerically for similarity search
B. To guarantee that generated answers are factual
C. To replace access-control policies
D. To eliminate the need for source documents
Correct Answer: A. To represent objects numerically for similarity search
Question 6
Which situation is an example of training-serving skew?
A. A dashboard has a dark background in production
B. A feature is calculated differently during training and inference
C. A model has a registered version number
D. A document has a publication date
Correct Answer: B. A feature is calculated differently during training and inference
Question 7
Which monitoring category measures latency, throughput, and service errors?
A. Infrastructure monitoring
B. Label monitoring
C. Fairness monitoring
D. Semantic monitoring
Correct Answer: A. Infrastructure monitoring
Question 8
What is a key limitation of RAG?
A. It cannot use external information
B. It guarantees correct answers only when vectors are large
C. Poor retrieval or poor source quality can still produce unsupported answers
D. It works only with numerical tables
Correct Answer: C. Poor retrieval or poor source quality can still produce unsupported answers
Question 9
Which deployment strategy records model predictions without initially using them to make operational decisions?
A. Shadow deployment
B. Permanent deletion
C. Data masking
D. Static partitioning
Correct Answer: A. Shadow deployment
Question 10
Which characteristic is most important for AI-ready data?
A. Lack of metadata to maximise flexibility
B. Stable definitions, provenance, quality, and governed access
C. Exclusive storage in presentation files
D. Removal of all historical versions
Correct Answer: B. Stable definitions, provenance, quality, and governed access