Data Cleaning and Preprocessing Workflows

5 minutes 5 Questions

In the PMI-CPMAI framework, data cleaning and preprocessing workflows belong to the Data Preparation phase of the CPMAI methodology. This phase sits between Data Understanding and Model Development, and it directly shapes model quality. CPMAI stresses that AI projects are data-centric, so poor data preparation is a leading cause of AI project failure. Project managers must treat these workflows as planned, governed, and iterative activities rather than ad hoc technical tasks. Data cleaning finds and corrects quality problems in raw data. Typical issues include missing values, duplicate records, inconsistent formats, outliers, mislabeled examples, and noise. Common techniques are imputation, deduplication, standardization of units and formats, outlier treatment, and label validation. Every cleaning decision should be documented, because these choices can introduce bias or remove meaningful signal. Preprocessing transforms clean data into a form that algorithms can use. Key steps include: - Normalization or scaling of numerical features. - Encoding of categorical variables. - Tokenization for text data. - Resizing or augmenting images. - Feature engineering and feature selection. - Handling class imbalance. - Splitting data into training, validation, and test sets. Preventing data leakage is critical. Transformations should be fit only on training data and then applied consistently to the other sets. From a management perspective, CPMAI emphasizes four practices: - **Reproducible pipelines:** Automate workflows and version-control the data, so that identical transformations run in both development and production. - **Data governance and compliance:** Track privacy, consent, lineage, and regulatory requirements. - **Bias and ethics checks:** Confirm that cleaning and sampling do not distort how populations are represented, which supports trustworthy AI. - **Quality metrics and acceptance criteria:** Define measurable thresholds for completeness, accuracy, and consistency before model training begins. These workflows are iterative. Findings from Model Evaluation often send teams back to refine preparation steps. Project managers should therefore budget substantial time for this work, which often takes 60 to 80 percent of project effort. They should also secure input from subject matter experts and keep data preparation aligned with the business objectives defined at the start of the project.

Data Cleaning and Preprocessing Workflows (PMI-CPMAI: Manage AI Model Development and Evaluation)

Introduction
In the PMI Certified Professional in Managing AI (PMI-CPMAI) framework, data cleaning and preprocessing workflows sit at the heart of AI model development. The CPMAI methodology is data-centric. Its phases are Business Understanding, Data Understanding, Data Preparation, Model Development, Model Evaluation and Model Operationalization. A recurring theme is that most AI project failures trace back to data problems, not algorithm problems. This guide covers four things: why data cleaning and preprocessing matter, what they are, how the workflows operate, and how to answer exam questions on the topic.

Why Data Cleaning and Preprocessing Is Important
1. Garbage in, garbage out. A model can only be as good as the data it learns from. Inaccurate, incomplete, inconsistent or biased data produces unreliable predictions, no matter how sophisticated the algorithm.
2. It consumes most of the project effort. Industry experience shows that data preparation typically takes 60 to 80 percent of an AI project's time. Project managers must plan, budget and staff for this reality rather than treat it as a minor task.
3. It reduces risk. Poor data quality is a leading cause of AI project failure. Cleaning reduces several risks:
- model drift caused by unrepresentative data
- bias and fairness issues
- compliance violations, such as unmasked personal data
- costly rework later in the lifecycle
4. It supports trustworthy AI. Clean, well-documented and traceable data supports transparency, explainability, auditability and responsible AI, all of which are emphasized in PMI-CPMAI.
5. It enables iteration. CPMAI is iterative and agile. Repeatable, automated preprocessing pipelines let teams quickly re-run experiments, retrain models and move back to earlier phases when needed.
6. It ensures consistency between training and production. The same transformations must be applied at inference time as during training. If they are not, training-serving skew degrades model performance.

What Data Cleaning and Preprocessing Workflows Are
Data cleaning means detecting and correcting (or removing) errors, inconsistencies and inaccuracies in raw data.
Data preprocessing is broader. It transforms cleaned data into a format suitable for machine learning algorithms.
A workflow (or pipeline) is the structured, repeatable, documented sequence of steps that performs these activities. It is ideally automated and version-controlled.

Within CPMAI, this work mainly falls in Phase III: Data Preparation. It builds on findings from Phase II: Data Understanding, where data quality issues are first identified through profiling and exploration. Preparation activities are revisited during Model Development and Evaluation whenever model results reveal data issues.

How It Works: The Core Steps
Step 1: Data collection and integration
- Gather data from multiple sources (databases, APIs, files, sensors).
- Merge and join datasets, resolve schema differences and align keys.
- Address data lineage and provenance: know where each piece of data came from.

Step 2: Data profiling and quality assessment
- Assess quality dimensions: accuracy, completeness, consistency, timeliness, validity and uniqueness.
- Use descriptive statistics, distributions and visualizations to spot anomalies.

Step 3: Handling missing data
- Deletion: remove rows or columns with missing values. This is appropriate only when missingness is small and random.
- Imputation: fill gaps using the mean, median or mode, forward or backward fill, regression, or KNN imputation.
- Flagging: add an indicator feature showing that a value was missing.
- Understand the type of missingness: MCAR (missing completely at random), MAR (missing at random) or MNAR (missing not at random).

Step 4: Removing duplicates and resolving inconsistencies
- Deduplicate records.
- Standardize formats such as dates, units, currencies, capitalization and categorical labels (for example, 'NY', 'New York', 'N.Y.').

Step 5: Handling outliers and noise
- Detect outliers with z-scores, IQR, visualization or domain rules.
- Decide whether to remove, cap (winsorize), transform or keep them.
- Some outliers are legitimate and valuable, such as fraud cases. Domain experts should be consulted.

Step 6: Data transformation
- Normalization: rescale values to a range such as 0 to 1 (min-max).
- Standardization: rescale to zero mean and unit variance (z-score).
- Log or power transforms to reduce skew.
- Encoding categorical variables: one-hot, label or ordinal encoding, or embeddings.
- Discretization or binning of continuous values.

Step 7: Feature engineering and selection
- Create new features from domain knowledge, such as ratios, time-based features and aggregations.
- Select relevant features and remove redundant or highly correlated ones.
- Apply dimensionality reduction (such as PCA) where appropriate.

Step 8: Handling unstructured data
- Text: tokenization, lowercasing, stop-word removal, stemming or lemmatization, vectorization.
- Images: resizing, normalization, augmentation.
- Audio: resampling, noise reduction, feature extraction.

Step 9: Data labeling and annotation (for supervised learning)
- Create ground-truth labels through human annotators, crowdsourcing or semi-automated methods.
- Measure label quality using inter-annotator agreement.
- Manage the cost, time and quality of labeling.

Step 10: Addressing class imbalance
- Use oversampling (such as SMOTE), undersampling, class weighting or synthetic data generation.

Step 11: Data splitting
- Divide data into training, validation and test sets. Use stratification where needed and time-based splits for time series.
- Prevent data leakage. Fit transformations such as scalers and imputers only on training data, then apply them to validation and test sets.

Step 12: Data augmentation and enrichment
- Add external or third-party data, or create synthetic variations to increase volume and diversity.

Step 13: Privacy, security and compliance
- Anonymize, pseudonymize, mask or tokenize personally identifiable information (PII).
- Ensure compliance with GDPR, HIPAA, CCPA and organizational data governance policies.

Step 14: Documentation, versioning and automation
- Version datasets and pipelines so experiments are reproducible.
- Document every transformation with data dictionaries, datasheets and lineage records.
- Automate pipelines (MLOps and DataOps) so they can be reused for retraining and production inference.

Bias and Fairness Considerations
Preprocessing is a key point for detecting and mitigating bias. Project managers should:
- check whether training data represents all relevant populations
- identify proxy variables for protected attributes
- use techniques such as re-weighting or re-sampling
- document known limitations
Removing a protected attribute alone does not eliminate bias if proxies remain.

The Project Manager's Role
The AI project manager usually does not perform the cleaning personally. They manage the process:
- plan realistic time and resources for data preparation
- engage data owners, data engineers, data scientists and subject matter experts
- establish data quality acceptance criteria tied to business objectives
- ensure governance, compliance and ethics reviews take place
- track data-related risks in the risk register
- decide when data is 'good enough' to move forward, or when to iterate back to Data Understanding or Business Understanding
- support go/no-go decisions when data is insufficient for the AI solution's feasibility

Common Pitfalls
- Underestimating data preparation effort.
- Data leakage, such as using test data to compute normalization parameters, or including features unavailable at prediction time.
- Inconsistent preprocessing between training and production.
- Removing outliers that carry critical signal.
- Ignoring bias in the source data.
- Lack of documentation and version control, which makes results irreproducible.
- Proceeding to model development before data quality is acceptable.

Exam Tips: Answering Questions on Data Cleaning and Preprocessing Workflows
Tip 1: Think data-first. When a scenario describes poor model performance, first ask whether the root cause is data. CPMAI strongly favors fixing data quality before changing algorithms or adding compute. Answers like 'try a more complex model' are usually distractors.

Tip 2: Know the phase order. Data Understanding (profiling, identifying issues) comes before Data Preparation (cleaning, transforming). If a question asks what to do first with a newly acquired dataset, the answer is usually to assess, profile or understand the data, not to clean or model it immediately.

Tip 3: Remember iteration. CPMAI is iterative. If evaluation reveals data issues, the correct response is often to return to Data Preparation or Data Understanding rather than push into deployment.

Tip 4: Watch for data leakage. Questions may describe suspiciously high accuracy in testing that collapses in production. Suspect leakage, an improper train/test split, or training-serving skew. Preprocessing parameters must be fitted on training data only.

Tip 5: Choose the context-appropriate technique. No single answer is always right. Deleting rows is fine for small, random missingness, while imputation is better when data is scarce. Outliers may be fraud signals, so do not automatically delete them. Look for answers that involve domain experts and consider context.

Tip 6: Prioritize governance, privacy and ethics. If a scenario involves PII, sensitive attributes or regulated data, favor answers that apply anonymization, consent checks, compliance review and bias assessment before using the data.

Tip 7: Favor repeatable, documented, automated pipelines. Answers that emphasize reproducibility, version control, documentation and consistent transformations across training and production are usually preferred over ad hoc manual fixes.

Tip 8: Take the project manager's perspective. The exam tests management decisions. Prefer answers that involve:
- planning adequate time for data preparation
- engaging stakeholders and SMEs
- defining data quality criteria linked to business goals
- managing risks
- escalating feasibility concerns
Avoid answers where the PM bypasses the team or skips steps to meet a deadline.

Tip 9: Recognize 'data not sufficient' scenarios. Sometimes the right answer is that the data cannot support the AI objective. The PM should then revisit Business Understanding, acquire more or better data, adjust scope, or recommend a no-go. CPMAI values this honesty over forcing a flawed project forward.

Tip 10: Know the key terms. Be comfortable with:
- imputation, normalization versus standardization, one-hot encoding
- feature engineering, class imbalance and SMOTE
- stratified sampling, data augmentation, data lineage
- data drift, labeling and inter-annotator agreement
- data quality dimensions: accuracy, completeness, consistency, timeliness, validity, uniqueness

Tip 11: Eliminate extreme answers. Options with 'always', 'never', 'delete all' or 'immediately deploy' are often wrong. The best answer is usually balanced, risk-aware and aligned with business objectives.

Tip 12: Link back to business value. Data preparation decisions should serve the business problem defined in Phase I. If an option improves technical neatness but ignores business requirements, it is likely not the best choice.

Sample Question Walkthrough
Scenario: A model achieves 98 percent accuracy in testing but performs poorly after deployment. The team discovers that normalization was applied to the full dataset before splitting. What should the project manager do?
Reasoning: This is data leakage, and it compounds a training-serving mismatch. The best answer is to have the team rebuild the preprocessing pipeline so transformations are fitted only on training data, apply them consistently in production, re-evaluate the model, and document the change. Distractors such as 'collect more data' or 'switch algorithms' do not address the root cause.

Summary
Data cleaning and preprocessing workflows turn raw, messy data into reliable, model-ready input. In PMI-CPMAI, they are central to project success, consume most of the project effort, and drive model quality, fairness and compliance. For the exam:
- think data-first
- respect the phase sequence and iteration
- guard against leakage and bias
- favor documented, automated pipelines
- always answer from the project manager's perspective of governance, stakeholder engagement and business alignment
Test mode:
More Data Cleaning and Preprocessing Workflows questions
15 questions (total)

Other Manage AI Model Development and Evaluation concepts

Algorithm Selection Criteria and DocumentationCoding Standards and Best Practices for AI DevelopmentConfiguration Management for Model Versions and ParametersCPMAI Phase III: Data PreparationCPMAI Phase IV: Model DevelopmentCPMAI Phase V: Model EvaluationCross-Validation and Model SelectionData Augmentation and Synthetic DataData Normalization and StandardizationData Readiness Decisions and DocumentationDeployment Readiness and Infrastructure RequirementsEvaluating Algorithms for Specific Use CasesEvaluating Model Performance Against Success CriteriaFeature Engineering and Feature SelectionFinal Approval for Model DeploymentFinal Data Quality Assessment Before TrainingHyperparameter Tuning and OptimizationModel Documentation and Operational ProceduresModel Evaluation Metrics: Accuracy, Precision, Recall and BeyondModel Robustness and GeneralizationModel Testing Protocols and Quality AssuranceMonitoring Model Performance Metrics in DevelopmentMonitoring Training Progress and Compute UtilizationOverfitting, Underfitting and GeneralizationPeer Review and Technical Validation of Model DesignsRepresentativeness and Bias Checks Before ModelingReproducible and Documented Data TransformationSupervised, Unsupervised and Reinforcement LearningTrade-offs Between Model Complexity, Performance and InterpretabilityTraining Data Versioning and Experiment TrackingTraining Schedules and Resource AllocationValidating Preprocessing and Transformation ResultsWorking with Data Scientists on Model Architecture