Prepare for University Studies & Career Advancement

Data Cleaning and Preprocessing

Data Cleaning and Preprocessing form the critical first steps in any data science or analytics workflow. Before meaningful patterns can be extracted, raw datasets often require careful refinement—removing duplicates, correcting errors, standardizing formats, and addressing missing values. This process ensures the reliability of results in data analysis and downstream applications such as data visualization. Without proper preprocessing, even advanced models in big data analytics or machine learning can be misled by flawed inputs.

The significance of data cleaning is amplified when operating at scale. In sectors handling vast and diverse information, robust data collection and storage systems are paired with automated tools to preprocess records efficiently. Analysts must be skilled not only in technical routines, but also in selecting the appropriate tools and technologies in data science to fit the complexity of each dataset.

Clean data is essential for producing domain-relevant insights. Whether supporting domain-specific analytics or generating cross-industry benchmarks, high-quality input sets the stage for precision and clarity. Moreover, ethical concerns come into play during preprocessing, particularly when deciding how to handle personal or sensitive fields. This ties into the growing need to understand the ethical and social aspects of data management.

In cybersecurity contexts, preprocessing is equally vital. Effective threat intelligence depends on timely, clean, and structured logs. Automated defense mechanisms—including those supported by AI and ML in cybersecurity—require quality input to detect patterns or anomalies. Inaccuracies during cleaning could either hide malicious activity or flag benign behavior, compromising the effectiveness of incident response and forensics.

Preprocessing also aids in protecting sensitive data during analysis. For example, anonymization and data masking align with principles in cybersecurity policy and strengthen identity and access management practices. Clean datasets reduce risks of breaches, especially when operating within environments dependent on cloud security and endpoint security.

The interconnected nature of cyber and data systems means that preprocessing is often built into workflows involving network security, application security, and OT security. Logs from CPS security systems, for instance, require preprocessing to be usable in trend analyses or risk assessments. Maintaining awareness of best practices through cybersecurity awareness helps teams handle preprocessing with vigilance.

As cybersecurity landscapes evolve and emerging areas in cyber security continue to expand, preprocessing tools and strategies must keep pace. Professionals must be equipped to recognize when automation is useful, when human judgment is necessary, and how to optimize both. Cleaning data is not just about technical neatness—it’s about ensuring integrity and trust throughout the data lifecycle.

 

Data Cleaning and Preprocessing - Preparation for University Studies Prep4Uni online

Table of Contents

Data Wrangling

Data wrangling involves cleaning, transforming, and mapping raw data into a structured and usable format. This process prepares the data for analysis or modeling.

  1. Key Tasks in Data Wrangling:

    • Data Cleaning: Removing duplicates, correcting errors, and handling missing values.
    • Data Transformation: Converting data into a consistent format, such as standardizing date formats or text case.
    • Data Integration: Combining data from multiple sources into a unified dataset.
    • Data Filtering: Removing irrelevant or unnecessary data points.
  2. Challenges in Data Wrangling:

    • Dealing with diverse data formats (e.g., JSON, CSV, XML).
    • Addressing inconsistencies in data from different sources.
  3. Tools for Data Wrangling:

    • Pandas (Python): Provides powerful data manipulation capabilities, such as filtering, grouping, and reshaping data.
    • OpenRefine: An open-source tool for cleaning and transforming data interactively.
    • Excel: Useful for smaller datasets and quick fixes.
  4. Applications:

    • Preparing e-commerce transaction logs for sales analysis.
    • Cleaning survey data for market research.

Exploratory Data Analysis (EDA)

Exploratory Data Analysis (EDA) is the initial phase of data analysis, aimed at understanding the data’s structure, identifying patterns, and uncovering anomalies or relationships. It is crucial for hypothesis generation and selecting the right modeling approach.

  1. Key Tasks in EDA:

    • Data Summarization: Calculating descriptive statistics like mean, median, variance, and correlation.
    • Visualizing Distributions: Using plots to examine data distributions and relationships.
    • Detecting Outliers: Identifying data points that deviate significantly from the norm.
  2. EDA Techniques:

    • Univariate Analysis: Examining individual variables (e.g., histograms for distribution).
    • Bivariate Analysis: Studying relationships between two variables (e.g., scatterplots, correlation matrices).
    • Multivariate Analysis: Exploring relationships among multiple variables (e.g., pair plots, principal component analysis).
  3. Tools for EDA:

    • Python Libraries:
      • Matplotlib: A foundational library for creating static visualizations.
      • Seaborn: Built on Matplotlib, it simplifies the creation of attractive and informative statistical graphics.
    • R Libraries:
      • ggplot2: A powerful visualization tool for creating customizable plots.
    • Excel/Tableau: Useful for quick visual summaries.
  4. Applications:

    • Identifying seasonal trends in sales data.
    • Understanding user behavior through website analytics.

Feature Engineering

Feature engineering involves creating new features or modifying existing ones to improve the predictive power of machine learning models. It plays a critical role in enhancing model performance.

  1. Key Tasks in Feature Engineering:

    • Feature Creation:
      • Deriving new features from existing data (e.g., extracting the day of the week from a timestamp).
    • Feature Transformation:
      • Applying mathematical transformations to improve model interpretability or performance (e.g., logarithmic transformations to handle skewed data).
    • Feature Selection:
      • Identifying the most relevant features for the problem at hand, reducing dimensionality and noise.
  2. Techniques in Feature Engineering:

    • Normalization:
      • Scaling features to a standard range (e.g., 0 to 1) to ensure fair treatment in models sensitive to magnitude.
      • Example: Scaling income values to a range for better compatibility in distance-based algorithms like k-NN.
    • Encoding Categorical Data:
      • One-Hot Encoding: Converts categorical variables into binary indicator variables.
      • Label Encoding: Assigns numeric labels to categories.
    • Dimensionality Reduction:
      • Techniques like Principal Component Analysis (PCA) reduce the number of features while preserving essential information.
  3. Tools for Feature Engineering:

    • Python Libraries:
      • Scikit-learn: Offers preprocessing utilities for scaling, encoding, and PCA.
      • Feature-engine: A Python library specifically for feature engineering.
    • R Libraries:
      • caret: Provides tools for data preprocessing and feature selection.
    • AutoML Tools:
      • Automated feature engineering platforms like H2O.ai or DataRobot.
  4. Applications:

    • Enhancing model accuracy for fraud detection in banking.
    • Creating derived features for recommendation systems (e.g., user preferences).

How These Sub-Areas Interact

Data Wrangling

ensures the data is clean and in a usable format for EDA and modeling.

EDA (Exploratory Data Analysis)

helps identify data issues and informs which features may need engineering.

Feature Engineering

transforms and optimizes the cleaned and analyzed data to improve predictive performance.


Why Study Data Cleaning and Preprocessing

Building Reliable Foundations for Accurate Analysis

Data cleaning and preprocessing are essential steps in any data analysis or machine learning pipeline. For students preparing for university, studying this area teaches them how to transform raw, messy, or incomplete data into a usable format. Clean data forms the foundation of trustworthy analysis—without it, even the most sophisticated models or visualizations can produce misleading or invalid results.

Understanding the Sources and Impacts of Dirty Data

Real-world data often contains errors, duplicates, missing values, or inconsistencies. Students learn how such problems arise from manual data entry, sensor malfunctions, system migrations, or poorly structured databases. Understanding the types and causes of dirty data helps learners appreciate why data quality is crucial for achieving accurate, reproducible outcomes in both academic research and professional projects.

Mastering Practical Techniques for Data Preparation

Students are introduced to techniques such as handling missing values, correcting errors, normalizing data, encoding categorical variables, and removing outliers. These skills are practiced using tools like Excel, Python (with pandas and NumPy), and R. By gaining confidence in data preprocessing, learners build a strong technical foundation for working with clean datasets across disciplines.

Enhancing the Value of Analytical and Machine Learning Models

The quality of input data directly affects the performance of analytical models. Students studying data science or AI soon realize that preprocessing often takes more time than model selection or training. By investing effort in preparing data correctly, students ensure that the outputs of their models are valid, interpretable, and actionable—an essential habit for both coursework and real-world applications.

Preparing for Data-Centric Careers and Research Roles

A solid understanding of data cleaning and preprocessing supports further study in data science, statistics, machine learning, business analytics, and scientific research. It also prepares students for practical roles such as data analyst, research assistant, data engineer, or quality assurance specialist. For university-bound learners, these skills are vital for working responsibly with data from the ground up.
 

Data Cleaning and Preprocessing: Conclusion

By combining these steps, data scientists can turn raw, unstructured data into actionable insights and robust predictive models. 

Data Cleaning and Preprocessing: Review Questions and Answers:

1. What is data cleaning and preprocessing, and why is it essential in data science?
Answer: Data cleaning and preprocessing are the processes of identifying and correcting errors, inconsistencies, and missing values in raw data to prepare it for analysis. These steps are essential in data science because high-quality data is crucial for building accurate models and generating reliable insights. Clean data improves the performance of machine learning algorithms and helps avoid misleading results that could arise from faulty input. Moreover, preprocessing transforms data into a standardized format, enabling efficient analysis and better decision-making.

2. What are the primary steps involved in the data cleaning process?
Answer: The primary steps in data cleaning include data collection, identification of errors, handling missing values, and removing duplicates. Initially, data is gathered from various sources and then scrutinized for inconsistencies and inaccuracies. Missing or anomalous data is either corrected or imputed using appropriate techniques, and duplicate entries are removed to avoid skewed analysis. This systematic approach ensures that the dataset is accurate, consistent, and ready for further analysis.

3. How does data preprocessing improve the performance of machine learning models?
Answer: Data preprocessing improves machine learning model performance by ensuring that the input data is standardized and free from noise. Techniques such as normalization, standardization, and encoding help in scaling and transforming data, making it suitable for model training. This step reduces bias and variance in the dataset, leading to more accurate and robust predictions. In addition, preprocessing facilitates the removal of irrelevant features, thereby enhancing the model’s efficiency and interpretability.

4. What methods can be used to handle missing data during preprocessing?
Answer: Common methods to handle missing data include deletion, imputation, and using algorithms that support missing values. Deletion removes rows or columns with missing entries when the missingness is minimal or random. Imputation involves substituting missing values with statistical measures such as the mean, median, or mode, or using advanced methods like k-nearest neighbors imputation. These techniques help maintain the integrity of the dataset while reducing the potential for bias in subsequent analyses.

5. Why is it important to remove duplicates in a dataset, and how does it affect analysis?
Answer: Removing duplicates is important because duplicate records can distort statistical analyses and machine learning model outcomes. Duplicates may lead to overrepresentation of certain data points, resulting in biased insights and inaccurate predictions. By ensuring that each record is unique, the dataset becomes more representative of the true underlying distribution. This practice enhances the reliability and validity of the analysis, leading to more trustworthy conclusions and decisions.

6. What role does normalization play in data preprocessing?
Answer: Normalization plays a critical role in data preprocessing by scaling numerical data to a common range, typically between 0 and 1. This process ensures that no single feature dominates the analysis due to its scale, which is especially important for distance-based algorithms. Normalization improves the convergence of gradient descent in machine learning models and enhances overall model performance. It also facilitates the comparison and integration of data from different sources by standardizing the scale of the features.

7. How does feature engineering relate to data cleaning and preprocessing?
Answer: Feature engineering is closely related to data cleaning and preprocessing as it involves creating new features or transforming existing ones to improve model performance. After cleaning the data, feature engineering uses techniques such as aggregation, transformation, and encoding to extract meaningful information. This process can reveal hidden relationships within the data and provide additional predictive power. By carefully crafting features, data scientists can enhance the accuracy and robustness of analytical models.

8. What challenges might arise during data cleaning and preprocessing, and how can they be mitigated?
Answer: Challenges during data cleaning and preprocessing include dealing with inconsistent data formats, handling a large volume of missing values, and managing noisy or outlier data. These issues can lead to inaccurate analyses if not properly addressed. Mitigation strategies involve the use of automated tools, robust statistical techniques, and domain knowledge to inform data cleaning decisions. Additionally, iterative validation and continuous monitoring of data quality can help ensure that preprocessing steps effectively enhance the dataset’s reliability.

9. How does data transformation differ from data normalization, and why are both important?
Answer: Data transformation involves changing the structure or format of data, such as through logarithmic scaling, encoding categorical variables, or aggregating data, whereas data normalization specifically scales numerical values to a common range. Both processes are important because they prepare the data for analysis in different ways. Transformation can reveal underlying patterns and make complex data more interpretable, while normalization ensures that all features contribute equally to the analysis. Together, they enhance the overall quality and usability of the data, improving the performance of analytical models.

10. How can data cleaning and preprocessing impact the overall success of a data science project?
Answer: Data cleaning and preprocessing have a profound impact on the success of a data science project by ensuring that the input data is accurate, consistent, and ready for analysis. Clean data reduces the risk of errors and biases, leading to more reliable models and insightful results. Effective preprocessing transforms raw data into a format that can be efficiently analyzed, which is critical for uncovering actionable insights and making informed decisions. Ultimately, these processes lay the foundation for successful analytics, driving better business outcomes and competitive advantage.

Data Cleaning and Preprocessing: Thought-Provoking Questions and Answers

1. How will emerging trends in data collection and storage technologies influence future data cleaning and preprocessing techniques?
Answer: Emerging trends in data collection and storage technologies, such as IoT, edge computing, and cloud-based data lakes, will significantly influence data cleaning and preprocessing techniques by introducing new challenges and opportunities. These technologies generate vast amounts of heterogeneous data, which often comes in real time and from diverse sources, necessitating more advanced, automated cleaning methods. As data volumes grow, traditional manual preprocessing methods will become less feasible, pushing organizations to adopt machine learning and AI-driven techniques that can handle large-scale, dynamic datasets effectively.
Moreover, as storage technologies evolve to support unstructured and semi-structured data, preprocessing techniques will need to adapt to different data formats and ensure that data integrity is maintained. Innovations in distributed computing and parallel processing will also play a crucial role in scaling preprocessing tasks, making them faster and more efficient. This evolution will drive the development of more sophisticated algorithms and tools that can seamlessly integrate with modern data architectures, ultimately enhancing the quality of insights derived from big data analytics.

2. What are the implications of data quality issues on business intelligence, and how can organizations proactively address these challenges?
Answer: Data quality issues can have profound implications on business intelligence by leading to inaccurate analyses, misguided decision-making, and significant financial losses. Poor-quality data can distort trends, obscure true patterns, and result in erroneous forecasts that negatively impact strategic planning. The ripple effects of these issues can undermine customer trust, reduce operational efficiency, and ultimately compromise an organization’s competitive position.
Organizations can proactively address data quality challenges by implementing robust data governance frameworks, employing advanced data cleaning tools, and establishing continuous monitoring systems. Regular audits and validation processes ensure that data remains accurate and up-to-date, while employee training on data management best practices helps maintain a culture of quality. By investing in both technology and processes, businesses can safeguard the integrity of their data and ensure that their business intelligence initiatives deliver reliable, actionable insights.

3. How does the integration of machine learning algorithms in data preprocessing improve the overall efficiency of data analysis workflows?
Answer: The integration of machine learning algorithms in data preprocessing improves the overall efficiency of data analysis workflows by automating tasks that were traditionally performed manually. These algorithms can learn from the data to detect anomalies, fill in missing values, and remove duplicates, significantly reducing the time and effort required for cleaning. This automation enables data scientists to focus on higher-level analysis and model development, accelerating the entire analytical process.
Furthermore, machine learning techniques can continuously adapt to new data patterns, ensuring that preprocessing remains effective even as data sources and formats evolve. This dynamic capability not only enhances efficiency but also improves the accuracy of subsequent analyses by ensuring that only high-quality, well-structured data is used. As a result, organizations benefit from faster turnaround times, reduced operational costs, and more reliable data insights that drive informed decision-making.

4. What strategies can be employed to handle and preprocess unstructured data effectively, and why is this important for modern analytics?
Answer: Handling and preprocessing unstructured data effectively requires a combination of natural language processing (NLP), text mining, and advanced parsing techniques. Strategies include using algorithms to extract meaningful information from text, images, and audio, and then converting these into structured formats that can be analyzed using traditional statistical methods. Tools such as sentiment analysis, topic modeling, and entity recognition help transform unstructured data into actionable insights. This process is critical for modern analytics because a significant portion of valuable data exists in unstructured formats, from social media posts to customer reviews and multimedia content.
Effective preprocessing of unstructured data allows organizations to harness a wider range of information, providing a more comprehensive view of customer behavior, market trends, and operational challenges. By integrating these strategies into their analytics workflows, businesses can unlock hidden value, drive innovation, and maintain a competitive edge in today’s data-driven landscape.

5. How might future advancements in data preprocessing impact the scalability and speed of big data analytics?
Answer: Future advancements in data preprocessing are expected to greatly enhance the scalability and speed of big data analytics by leveraging cutting-edge technologies such as distributed computing, edge processing, and artificial intelligence. These advancements will enable the automation of complex cleaning and transformation tasks, allowing large datasets to be processed more rapidly and efficiently. This improved scalability will be critical as the volume of data continues to grow, ensuring that analytics systems can handle increasing loads without compromising performance.
Moreover, innovations in algorithm design and parallel processing techniques will reduce processing times and enable real-time analytics, which are essential for timely decision-making in dynamic environments. As these technologies mature, organizations will be able to extract actionable insights from big data with unprecedented speed, driving faster innovation and more agile business responses to market changes.

6. What are the potential risks of inadequate data preprocessing, and how can organizations mitigate these risks in their analytics projects?
Answer: Inadequate data preprocessing can lead to a range of risks, including inaccurate analyses, biased models, and flawed decision-making. When data is not properly cleaned or standardized, errors and inconsistencies can propagate through the analytics pipeline, resulting in unreliable insights and potentially costly business decisions. Additionally, poor preprocessing may compromise data security and privacy, as sensitive information might not be handled correctly. These risks can undermine the credibility of analytics projects and erode stakeholder trust over time.
To mitigate these risks, organizations should invest in robust data quality assurance processes, including automated cleaning tools, regular audits, and continuous monitoring of data integrity. Establishing clear data governance policies and training staff on best practices for data management are also critical steps. By prioritizing data quality from the outset, organizations can ensure that their analytics projects are based on reliable, high-quality data that drives accurate and actionable insights.

7. How can organizations balance the trade-off between data preprocessing complexity and the need for rapid analytics turnaround?
Answer: Balancing the trade-off between data preprocessing complexity and rapid analytics turnaround requires a strategic approach that prioritizes both efficiency and data quality. Organizations can leverage automation tools and machine learning algorithms to streamline the preprocessing steps without compromising accuracy. By designing modular workflows that allow for iterative improvements and quick adjustments, businesses can adapt to changing data conditions and reduce turnaround times. This approach ensures that preprocessing remains thorough while still delivering timely insights for decision-making.
Additionally, adopting cloud-based platforms and parallel processing techniques can significantly accelerate data processing, enabling organizations to handle large volumes of data quickly. Combining these technological solutions with a focus on continuous improvement helps strike the right balance between complexity and speed, ensuring that analytics initiatives remain both robust and agile.

8. What are the implications of using automated data cleaning tools on the overall data quality and reliability of analytics outcomes?
Answer: Automated data cleaning tools can significantly enhance overall data quality by efficiently handling large datasets and reducing human error during the cleaning process. These tools standardize data formats, detect anomalies, and correct inconsistencies at scale, which improves the reliability of subsequent analytics outcomes. However, the implications of relying on automation also include the risk of overlooking context-specific nuances that may require human judgment. If not properly configured, automated tools might inadvertently remove valid data or fail to address subtle errors, leading to biased results.
To maximize the benefits of automation while mitigating risks, organizations should combine automated data cleaning with manual oversight and validation. This hybrid approach ensures that complex or context-sensitive issues are handled appropriately, maintaining both efficiency and data integrity. Regular performance evaluations and updates to the automated systems can further enhance reliability and ensure that the analytics outcomes are robust and actionable.

9. How does the process of data normalization affect the comparability and integration of datasets from diverse sources?
Answer: Data normalization plays a crucial role in ensuring that datasets from diverse sources can be effectively compared and integrated by scaling numerical values to a common range. This process minimizes the impact of differing data scales, which might otherwise distort analyses and lead to inaccurate conclusions. Normalization facilitates the merging of datasets by ensuring that variations in measurement units or magnitudes do not skew the results, thereby enabling a more consistent and reliable analysis.
Moreover, normalized data enhances the performance of machine learning algorithms by reducing biases and improving convergence rates during model training. By ensuring that all features contribute equally to the analysis, organizations can derive more accurate insights and make better-informed decisions based on a unified view of their data.

10. What role do outlier detection and handling play in ensuring the integrity of data analysis, and what methods can be used to address outliers?
Answer: Outlier detection and handling are essential for ensuring the integrity of data analysis because outliers can significantly distort statistical measures and lead to erroneous conclusions. By identifying and addressing outliers, organizations can improve the accuracy and reliability of their analytical models. Common methods for handling outliers include statistical techniques such as z-scores and the interquartile range (IQR), as well as domain-specific approaches that consider the context of the data.
Proper management of outliers involves deciding whether to remove, transform, or cap these extreme values based on their impact on the analysis. This process helps maintain a balanced dataset that accurately reflects the underlying trends without being skewed by anomalous data points. Addressing outliers is therefore a critical step in the data cleaning and preprocessing workflow, ensuring that subsequent analyses yield valid and actionable insights.

11. How can the integration of data cleaning and preprocessing techniques drive operational efficiencies in large-scale analytics projects?
Answer: Integrating robust data cleaning and preprocessing techniques drives operational efficiencies by streamlining the data preparation phase, which is often one of the most time-consuming aspects of analytics projects. When data is accurately cleaned and standardized, subsequent analysis becomes faster and more reliable, reducing the time to insight. This integration minimizes the need for repeated corrections and reprocessing, thereby enhancing productivity and reducing costs.
Furthermore, automated preprocessing pipelines can handle large volumes of data with minimal human intervention, allowing organizations to scale their analytics efforts effectively. By ensuring that data quality is maintained throughout the process, businesses can achieve more consistent and accurate results, ultimately driving better decision-making and operational performance.

12. How might advancements in cloud computing and distributed processing influence data cleaning and preprocessing practices?
Answer: Advancements in cloud computing and distributed processing are poised to significantly influence data cleaning and preprocessing practices by providing scalable and flexible infrastructures that can handle massive datasets efficiently. These technologies enable parallel processing of data, allowing for faster cleaning and transformation processes that can be executed across multiple nodes simultaneously. This scalability is critical as data volumes continue to grow, ensuring that preprocessing tasks do not become bottlenecks in the analytics workflow.
Moreover, cloud-based solutions offer integrated tools and services that facilitate automated data cleaning, validation, and integration. This integration not only speeds up the preprocessing phase but also improves data quality and consistency across diverse sources. As a result, organizations can derive actionable insights more rapidly and at a lower cost, enhancing overall competitiveness in a data-driven market.

Data Cleaning and Preprocessing: Numerical Problems and Solutions:

1. A dataset contains 10,000,000 records. If a preprocessing step selects 5% of these records for analysis, calculate the sample size, then determine the total sample size for a 30-day period, and finally compute the average daily sample size.
Solution:
• Step 1: Daily sample size = 10,000,000 × 0.05 = 500,000 records.
• Step 2: Total sample size for 30 days = 500,000 × 30 = 15,000,000 records.
• Step 3: Average daily sample size = 15,000,000 ÷ 30 = 500,000 records.

2. A data cleaning algorithm reduces missing values by 80% in a dataset with 1,000,000 missing entries. Calculate the number of missing entries after cleaning, the number of entries fixed, and the percentage reduction.
Solution:
• Step 1: Entries fixed = 1,000,000 × 0.80 = 800,000 entries.
• Step 2: Missing entries after cleaning = 1,000,000 – 800,000 = 200,000 entries.
• Step 3: Percentage reduction = (800,000 ÷ 1,000,000) × 100 = 80%.

3. A normalization process scales data values from a range of 0–100 to 0–1. For a value of 75 in the original dataset, calculate its normalized value, then compute the inverse transformation for a normalized value of 0.6.
Solution:
• Step 1: Normalized value of 75 = 75 ÷ 100 = 0.75.
• Step 2: Inverse transformation for 0.6 = 0.6 × 100 = 60.
• Step 3: Therefore, 75 becomes 0.75 normalized, and 0.6 corresponds to 60 in the original scale.

4. A data cleaning process takes 0.003 seconds per record. If there are 2,000,000 records, calculate the total processing time in seconds, then convert it to minutes, and finally to hours.
Solution:
• Step 1: Total time = 2,000,000 × 0.003 = 6,000 seconds.
• Step 2: In minutes = 6,000 ÷ 60 = 100 minutes.
• Step 3: In hours = 100 ÷ 60 ≈ 1.67 hours.

5. A dataset has 500,000 duplicate records. After a deduplication process, the duplicates are reduced by 90%. Calculate the number of duplicates removed, the number of duplicates remaining, and the percentage reduction achieved.
Solution:
• Step 1: Duplicates removed = 500,000 × 0.90 = 450,000.
• Step 2: Duplicates remaining = 500,000 – 450,000 = 50,000.
• Step 3: Percentage reduction = (450,000 ÷ 500,000) × 100 = 90%.

6. A feature scaling technique adjusts 1,200 values, originally ranging from 10 to 500, to a new range of 0 to 1. If a value of 255 is scaled, calculate its normalized value using the formula (x – min) / (max – min).
Solution:
• Step 1: min = 10, max = 500, x = 255.
• Step 2: Normalized value = (255 – 10) ÷ (500 – 10) = 245 ÷ 490 = 0.5.
• Step 3: Thus, the normalized value of 255 is 0.5.

7. A preprocessing pipeline reduces processing time per record from 0.005 seconds to 0.003 seconds. For a dataset of 10,000,000 records, calculate the total time saved in seconds, then convert that to minutes and hours.
Solution:
• Step 1: Original total time = 10,000,000 × 0.005 = 50,000 seconds.
• Step 2: New total time = 10,000,000 × 0.003 = 30,000 seconds.
• Step 3: Time saved = 50,000 – 30,000 = 20,000 seconds; in minutes = 20,000 ÷ 60 ≈ 333.33 minutes; in hours = 333.33 ÷ 60 ≈ 5.56 hours.

8. A data preprocessing task involves standardizing 4,000,000 records. If each record takes 0.0025 seconds to standardize, calculate the total processing time in seconds, convert it to minutes, and then to hours.
Solution:
• Step 1: Total time = 4,000,000 × 0.0025 = 10,000 seconds.
• Step 2: In minutes = 10,000 ÷ 60 ≈ 166.67 minutes.
• Step 3: In hours = 166.67 ÷ 60 ≈ 2.78 hours.

9. A data transformation process applies logarithmic scaling to a dataset. If the original value is 1,000 and the transformation formula is log10(x), calculate the transformed value and then the inverse transformation to retrieve the original value.
Solution:
• Step 1: Transformed value = log10(1,000) = 3.
• Step 2: Inverse transformation = 10^3 = 1,000.
• Step 3: Thus, the transformation and its inverse correctly map 1,000 to 3 and back to 1,000.

10. A cleaning process identifies 2% of 5,000,000 records as outliers. Calculate the number of outliers, and if 75% of these outliers are removed, determine the number of outliers remaining and the total percentage reduction.
Solution:
• Step 1: Outliers = 5,000,000 × 0.02 = 100,000.
• Step 2: Outliers removed = 100,000 × 0.75 = 75,000; remaining = 100,000 – 75,000 = 25,000.
• Step 3: Percentage reduction = (75,000 ÷ 100,000) × 100 = 75%.

11. A feature engineering task creates 3 new features from an original set of 20 features. Calculate the new total number of features, then determine the percentage increase in the number of features, and finally the reduction if later 25% of the new features are deemed redundant.
Solution:
• Step 1: New total = 20 + 3 = 23 features.
• Step 2: Percentage increase = (3 ÷ 20) × 100 = 15%.
• Step 3: Redundant features = 23 × 0.25 ≈ 5.75, rounding to 6; final count = 23 – 6 = 17 features.

12. A data analytics project reduces processing time by 25% for a pipeline that originally takes 800 minutes per day. Calculate the new daily processing time, the daily time saved in minutes, and the annual time saved in hours (assume 365 days).
Solution:
• Step 1: New processing time = 800 × (1 – 0.25) = 800 × 0.75 = 600 minutes.
• Step 2: Daily time saved = 800 – 600 = 200 minutes.
• Step 3: Annual time saved = 200 × 365 = 73,000 minutes; in hours = 73,000 ÷ 60 ≈ 1,216.67 hours.