Courseiva
PMLEChapter 3 of 16Objective 1.3

Data Exploration, Validation, and Quality Assessment

Exam objective 1.3 asks you to perform data exploration, validation, and quality assessment so that the machine learning model you build has a fighting chance of being accurate and reliable. This matters because a model trained on messy, incorrect, or biased data will produce nonsense predictions — what engineers call 'garbage in, garbage out'. By mastering this chapter, you learn how to inspect raw data, confirm it is what it claims to be, and decide whether it is good enough to use for training.

12 min read
Intermediate
Updated Jul 23, 2026
Editorial oversight: Johnson Ajibi· Security Systems Architect · MSc IT Security · IEEE Senior Member

A simple way to picture Data Exploration, Validation, and Quality Assessment

The Food Safety Inspector Analogy

You are a senior food safety inspector for a chain of 50 high-end restaurants. Your job is not to cook the meals or to design the menu. Your job is to check the ingredients before they ever reach a chef’s knife. A shipment of tomatoes arrives. You pick up a random box, slice open a tomato, and smell it. You check for bruises, mould, and discolouration. That first look — the sniff test, the visual scan — is data exploration.

Then you move to validation. You pull out a calibrated thermometer and check that the tomatoes were stored below 5°C during transit. You look at the supplier’s paperwork to confirm the farm is certified and the batch number matches the invoice. You weigh the box to make sure the quantity is correct to within 2%. You are not guessing. You are measuring against a rulebook.

Finally, you assess quality. You ask: are these tomatoes consistent? Do they have the same ripeness, size, and colour as last week’s shipment? If one box is full of tiny, rock-hard green tomatoes while the rest are deep red, that is a quality problem even if every individual tomato is technically edible. You write a report. The chef can either accept the shipment, reject it, or request a better grade. The entire kitchen depends on your judgment because bad ingredients mean bad dishes, no matter how skilled the cook.

How It Actually Works

Data exploration, validation, and quality assessment form the three-part ritual that every machine learning engineer performs before they let a single algorithm touch the data. Think of it as the prep work before cooking: you check the fridge, you check the expiry dates, and you check whether the ingredients actually taste good. Skipping this step is like building a house without inspecting the foundation.

Let’s define each term in plain language.

Data exploration means looking at your data to understand its shape, size, and obvious problems. You open the file, count the rows, look at the column names, and glance at the first few entries. You ask questions like: how many rows are there? How many columns? Are the numbers plausible or are there entries like 'age = 999' where age should be between 0 and 120? You make summary statistics — average, minimum, maximum, and the most common values. This step gives you a gut feeling for whether the data is roughly what you expected.

Data validation means checking that each piece of data meets the rules you defined in advance. If a column is supposed to contain email addresses, validation checks that every entry has an '@' symbol and a domain name. If a column is supposed to be a date, validation checks that no entry says 'potato' or '32/13/2024'. This step uses a schema — a formal description of what each column should contain. The schema is your rulebook.

Quality assessment goes deeper than validation. Quality assessment asks: is this data 'good enough' for machine learning? Even if every value passes validation, the data might still be useless. For example, if you are building a model to predict house prices and every house in your data was sold in the same neighbourhood, the quality is low because the data lacks variety. Quality assessment involves measuring completeness (are there missing values?), consistency (does the same address appear in different formats?), and distribution (do the numbers follow a realistic pattern?).

Why do we separate these three steps? Because they catch different kinds of problems. - Exploration catches the 'obviously wrong' problems — a missing column, a file that won’t open, a column full of NULL values. - Validation catches the 'technically wrong' problems — a date in the year 3000, a negative price for a product, a country code that doesn’t exist. - Quality assessment catches the 'subtly wrong' problems — a dataset that has no examples of a particular customer type, a column where 90% of the entries are the same value, a timestamp column that only records data during business hours (giving you a biased view).

In the real world, these three steps often blend together. You might explore the data, notice missing values, run a validation check to count them, then decide that the missing values are too numerous for quality purposes. But it is useful to think of them as a pipeline: first you look, then you check, then you judge.

What does this process replace? Before rigorous data validation became standard in machine learning, engineers would often train models on whatever data they had, trusting that the source was correct. That approach led to disasters: models that recommended products that didn’t exist, fraud detection systems that flagged every transaction because the input dates were corrupted, medical diagnostic tools that failed because the training data had typos in patient IDs. The three-step process is a safety net.

For the Google Professional Machine Learning Engineer exam, you need to know the specific Google Cloud tools that help with each step. For exploration, engineers use BigQuery to query large datasets and Dataflow to inspect streams of incoming data. For validation, they use TensorFlow Data Validation (TFDV) to automatically compare new data against a schema. For quality assessment, they compute statistics like mean, median, standard deviation, and null count using tools like Cloud Data Loss Prevention (DLP) or custom Python scripts.

The key insight is that data preparation is not a one-time task. Data changes over time. A column that always had five possible values might suddenly contain a sixth value after a software update. A quality metric that was fine last month might degrade because a sensor broke. Therefore, professional ML engineers set up automated monitoring — pipelines that re-run validation and quality checks every time new data arrives.

Beginners often think that data exploration is the 'fun' part and validation is the 'boring' part. In reality, validation saves you from the most embarrassing failures. Imagine presenting a model to your boss, only to discover that the model was trained on data where prices were recorded in Euros while the production system uses Dollars. Validation would have caught that unit mismatch. Quality assessment would have flagged the abnormally high price variance. Exploration might have shown you the column name 'price_eur' — but only if you looked. The three steps together protect you from human oversight.

A flowchart showing the three sequential steps of data exploration, validation, and quality assessment before data is approved for machine learning training.

Walk-Through

1

Open and inspect the raw data

Load the dataset into a tool like BigQuery or a Jupyter notebook. Run a simple SELECT * LIMIT 10 to see column names, data types, and sample values. Count total rows and columns. This gives you a first impression of the data's structure and reveals obvious problems like missing headers or unreadable formats.

2

Compute summary statistics for each column

For numeric columns, calculate the mean, median, minimum, maximum, and standard deviation. For categorical columns, count the frequency of each category. For datetime columns, find the earliest and latest dates. This step helps you spot implausible values (e.g., age=300) and understand the data's range and central tendency.

3

Identify and quantify missing values

Check every column for NULLs, empty strings, or placeholder values (like -1 or 'N/A'). Compute the percentage of missing data per column. This matters because high levels of missingness (over 30%) may force you to drop a column entirely, while low levels can be handled with imputation.

4

Define a schema and run validation checks

Create a schema using TensorFlow Data Validation that specifies data types, allowed value ranges, required fields, and pattern constraints (e.g., regex for postcodes). Run TFDV on a sample of the data. The output will list every value that violates the schema — these are your validation failures that must be investigated.

5

Assess data quality for ML suitability

Check for class imbalance in your target variable, measure feature importance, look for duplicate rows, and examine the distribution of each feature. Decide whether the dataset is representative of the real-world problem. Document any quality issues and plan how to address them before training.

What This Looks Like on the Job

Let’s walk through what a real data engineer or ML engineer does on a Tuesday morning at a mid-sized company that sells gardening equipment online. The company wants to build a model that predicts whether a customer will buy a lawnmower in the next month.

The engineer starts by pulling the last three months of customer data from BigQuery. This is a table with columns: customer_id, age, postcode, purchase_history (a JSON string), page_views (an integer), last_purchase_date, and loyalty_tier. The first step is exploration. The engineer runs a quick SQL query:

SELECT COUNT(*) FROM customer_data;

That returns 450,000 rows. Good. Next, they check for obvious nonsense:

SELECT MIN(age), MAX(age), AVG(age) FROM customer_data;

Minimum age is 0, maximum age is 150. Red flag. Age 0 is impossible for a customer — it could be a default value or a placeholder. The engineer also notices that the postcode column has 5,000 distinct entries, but some are 4 digits and some are 6 digits. The schema says they should all be 5-digit UK postcodes.

Now the engineer moves to validation. They define a schema using TensorFlow Data Validation. The schema specifies:

age must be between 18 and 120.

postcode must match the regex pattern for UK postcodes.

page_views must be an integer >= 0.

last_purchase_date must be a valid date and cannot be in the future.

The engineer runs TFDV on a sample of the data. It reports that 2% of age values are below 18, 0.5% of postcodes fail the regex check, and 1% of last_purchase_date entries are in 2027 (impossible since today is 2025). These are validation failures. The engineer has decisions to make: delete the bad rows, replace (impute) the bad values with NULL, or go back to the source database to fix the root cause.

Next, the engineer performs quality assessment. They look at the distribution of page_views. Most customers have between 1 and 50 page views, but there is a spike of exactly 100,000 for 200 customers. That seems suspicious — maybe a bot or a logging error. The engineer also checks loyalty_tier. There are three tiers: Bronze, Silver, Gold. But 60% of rows are NULL, meaning no tier was recorded. That is a quality problem: the model cannot use a feature that is missing for most customers.

The engineer also runs a check for class imbalance. The target variable — whether a customer bought a lawnmower — shows that only 5% of customers purchased one. That is a highly imbalanced dataset. The engineer notes that the model will need special techniques (like upsampling or weighted loss) to avoid always predicting 'no purchase'.

Finally, the engineer documents all findings in a data quality report. They decide to:

Remove rows where age is below 18 or above 100.

Delete rows with invalid postcodes (since it’s a small fraction).

Set future dates to NULL and treat them as missing.

Investigate the spike in page_views (suspect bot traffic).

Drop loyalty_tier entirely because it has too many missing values.

Plan for a resampling strategy to handle the class imbalance.

The entire process took two hours on Tuesday and will be repeated next month when new data arrives. The model that results from this cleaned dataset will be far more reliable than if the engineer had skipped these steps.

How PMLE Actually Tests This

The Google Professional Machine Learning Engineer exam tests data exploration, validation, and quality assessment in several ways. Expect 3 to 5 questions on this topic in the 'Data Preparation' section. The questions are scenario-based: they describe a dataset and ask you to identify the correct next step or the right tool.

Here are the specific concepts the exam loves:

The distinction between data validation and data quality. A common trap: they describe a scenario where all values pass validation (they are in the correct format, no NULLs in required fields) but the data is still unsuitable for ML. They want you to recognise that quality issues like bias, lack of variety, or class imbalance are not caught by validation alone.

TensorFlow Data Validation (TFDV) capabilities. You need to know that TFDV generates statistics, infers a schema, and detects anomalies. They may ask what tool to use to compare training data against serving data to detect drift.

Schema definition. They expect you to know that a schema includes data types, value ranges, and domain constraints. A question might ask: 'You have a column 'income' with values like 45000, 60000, and -200. What step in data validation catches the negative value?' Answer: value range check in the schema.

Missing value strategies. The exam asks about imputation methods: mean, median, mode, or dropping rows. They can present a dataset where 30% of a numeric column is missing and ask which approach preserves the most information while avoiding bias.

Data leakage. This is a major trap. The exam gives a scenario where you perform validation on the entire dataset before splitting into train/test. They want you to recognise that validation statistics should be computed only on the training set, not the combined data, to avoid leaking information from the test set into the training process.

Distribution comparison. Questions that describe training data from 2022 and serving data from 2024, and ask how to detect if the underlying distribution has shifted (concept drift). The correct answer is to use TFDV to compare statistics between the two datasets.

Outlier detection. They may ask about methods: Z-score, IQR (interquartile range), or visualisation with box plots. A question: 'Which method is robust to non-normal distributions?' Answer: IQR.

The three-step order. A tricky question might present a mess of tasks and ask you to put them in the correct sequence (exploration first, validation second, quality assessment third).

Trap patterns to watch for:

They give a validation failure (e.g., a date in 1900) but frame it as a quality issue. The correct answer is that it is a validation failure because it violates the schema rule.

They suggest using Cloud DLP for validation when TFDV is the correct tool. DLP is for sensitive data redaction, not general validation.

They say 'clean the data before exploring' — that is backwards. You explore first to understand what needs cleaning.

Key vocabulary to memorise:

Schema: the formal definition of your data's structure.

Anomaly detection: flagging data points that deviate from the schema or historical statistics.

Drift: a change in the statistical properties of the data over time.

Imputation: filling missing values with estimated values.

Class imbalance: a target variable with unequal group sizes.

Brush up on BigQuery SQL syntax for basic exploration (SELECT, COUNT, GROUP BY, WHERE) and the TFDV command-line interface. You will not need deep coding, but you must recognise the tool names and their purposes.

Key Takeaways

Data exploration, validation, and quality assessment exist to prevent 'garbage in, garbage out' by catching data problems before they reach the machine learning model.

Data exploration is the first step, using summary statistics and visualisations to understand the shape, size, and obvious issues in a dataset.

Data validation uses a formally defined schema to check that each value meets predefined rules, catching format and constraint violations.

Data quality assessment evaluates completeness, consistency, balance, and distribution of the data to determine if it is suitable for training a model.

A dataset can pass all validation checks and still fail quality assessment due to issues like class imbalance, bias, or lack of variety.

TensorFlow Data Validation (TFDV) is the primary Google Cloud tool for generating statistics, inferring schemas, and detecting anomalies in tabular data.

Outliers are not automatically errors; they must be investigated to decide whether to keep, transform, or remove them.

Missing values should be imputed (filled) rather than deleted unless the missing fraction is very small and truly random.

Data validation and quality assessment must be automated and re-run every time new data arrives, because data distributions can shift over time.

On the PMLE exam, scenario questions will test your ability to choose the correct tool (TFDV vs DLP vs BigQuery) and the correct order of operations (explore first, then validate, then assess quality).

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Data Validation

Checks each individual value against a predefined schema (e.g., must be an integer, must not be NULL).

Catches format errors, out-of-range values, and missing required fields.

Results are binary: a value either passes or fails.

Data Quality Assessment

Evaluates the dataset as a whole for suitability in ML (e.g., class balance, distribution, bias).

Catches subtle issues like lack of diversity, skewed distributions, or concept drift.

Results are a judgement (low, medium, high quality) rather than a pass/fail.

BigQuery Exploration

Used for ad hoc queries to count rows, inspect columns, and compute aggregates using SQL.

Best suited for interactive, one-time, or small-scale exploration.

Does not automatically generate a schema or compare against historical data.

TensorFlow Data Validation (TFDV)

Automatically generates statistics and infers a schema from the data.

Designed for large-scale, repeatable validation across training and serving pipelines.

Compares new data against the inferred schema to detect anomalies and drift.

Imputation (filling missing values)

Preserves the row count and most of the information in the dataset.

Requires a method (mean, median, mode) that may introduce bias if missingness is not random.

Best when missing percentage is moderate (5-30%) and patterns exist.

Dropping rows with missing values

Removes entire rows, shrinking the dataset and losing potentially useful information.

Creates no artificial values but reduces statistical power.

Best when missing percentage is very small (under 5%) and rows are randomly missing.

Class Imbalance

Refers to unequal distribution of the target variable (e.g., 95% 'no purchase', 5% 'purchase').

Addressed through resampling (oversampling minority class, undersampling majority class) or using weighted loss functions.

Main impact: the model becomes biased toward the majority class, ignoring the minority.

Data Skew

Refers to a mismatch in feature distributions between training and serving data (e.g., serving data has newer products).

Detected by comparing TFDV statistics between the two datasets.

Main impact: model accuracy drops in production because the input patterns have changed.

Watch Out for These

Mistake

Data validation and data quality are the same thing, so if data passes validation it is automatically good quality for ML.

Correct

Validation checks format and rules (e.g., email has '@'), while quality assesses whether the data is useful (e.g., balanced classes, no bias, enough variety). Data can pass every validation check and still be terrible quality.

Beginners assume that 'valid' means 'correct' in a broad sense, but in data engineering 'valid' only means 'conforms to schema'. Quality is a separate, more subjective judgement.

Mistake

You should clean all missing values by dropping every row that has a null.

Correct

Dropping rows wastes data. A better approach is to inspect the pattern of missingness — if the missing values are random, you can impute (fill in) them. Dropping is only safe when the fraction of missing rows is very small (under 5%) and the missingness is truly random.

People overcorrect from the fear of missing data and delete too much, shrinking the dataset and potentially introducing bias (e.g., dropping all rows from a certain region that had a logging outage).

Mistake

Outliers are always errors and must be removed.

Correct

Outliers can be legitimate extreme values (a billionaire in income data). You must investigate before removing. In some ML problems (like fraud detection), outliers are the most interesting data points.

Textbooks often teach 'remove outliers' as a simple rule, but in real practice an outlier might be a genuine signal. Beginners apply the rule blindly.

Mistake

Data exploration is a quick look at the first 100 rows of the dataset.

Correct

Real exploration involves summary statistics (mean, median, standard deviation), checking distributions for each column, looking for missing value patterns, and visualising relationships between variables. The first 100 rows only show format, not substance.

In courses and tutorials, instructors often show df.head() once and call it exploration. Beginners then think that is sufficient, missing global patterns.

Mistake

Validation should be done after the model is trained to check if the predictions are reasonable.

Correct

Validation must happen before training. If you validate after training, you may have already used invalid data in your model, corrupting the results. The sequence is: explore, validate, assess quality, then train.

The word 'validation' sounds like 'verification of results' (as in 'validate the model'), so beginners transpose the order. They think of validation as a final check, not an up-front filter.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between data validation and data quality in machine learning?

Data validation checks that each piece of data matches a predefined schema (e.g., correct format, allowed values). Data quality assesses whether the dataset as a whole is useful for ML (e.g., balanced classes, no bias, enough variety). A dataset can be valid but still be low quality.

How do I handle missing values in a dataset for ML?

First, examine the pattern of missingness. If missing values are random and a small percentage (under 5%), drop the rows. For larger fractions, use imputation: fill numeric columns with the mean or median, fill categorical columns with the mode. Avoid dropping rows if the missing pattern is informative.

What tools does Google Cloud provide for data validation?

The primary tool is TensorFlow Data Validation (TFDV), which generates statistics, infers a schema, and detects anomalies. BigQuery can be used for exploration via SQL queries. Cloud DLP is for redacting sensitive data, not general validation.

Should I clean the data before or after I split it into train and test sets?

Perform data exploration, validation, and quality assessment on the entire dataset, but apply transformations (like imputation or scaling) after splitting. This prevents data leakage, where information from the test set influences training.

What is a schema in data validation for ML?

A schema is a formal definition of each column in your dataset: its data type (integer, string, date), allowed value ranges (e.g., age 0-120), required vs optional status, and domain constraints (e.g., a list of valid country codes). The schema acts as the rulebook for validation.

How do I detect outliers in my data for ML?

Common methods include using the interquartile range (IQR) — any point below Q1-1.5*IQR or above Q3+1.5*IQR is an outlier — or calculating Z-scores (values more than 3 standard deviations from the mean). Always investigate outliers before removing them.

Terms Worth Knowing

Keep going

You've finished Data Exploration, Validation, and Quality Assessment. Continue through the PMLE study guide to build a complete picture of the exam.

Done with this chapter?