Exploratory Analysis and Data Wrangling
- 86Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What information should be clearly defined before beginning a machine learning analysis?
86 questions
- 1
What information should be clearly defined before beginning a machine learning analysis?
Model answer
The problem, goal or hypothesis, data characteristics, target outcome, and data size and quality should be clearly defined.
Explanation
A well-defined problem provides direction for data collection, preparation, modeling, and evaluation.
- 2
How can domain knowledge improve the planning of a machine learning study?
Model answer
Domain knowledge can reveal potential biases, reasonable assumptions, known predictors, covariates, and features that require extraction or engineering.
Explanation
Understanding the subject area helps researchers anticipate important variables and potential problems before modeling.
- 3
What questions should be asked when determining whether available data are suitable for a target problem?
Model answer
Researchers should ask what problem is being solved, whether the data are appropriate, and what existing data sources could be accessed.
Explanation
These questions establish whether the available evidence can address the research goal.
- 4
What privacy and ethical issues may affect biomedical data access and use?
Model answer
Researchers may need to address patient privacy, ethical requirements, special permissions, training, certifications, and institutional approvals.
Explanation
Sensitive biomedical data may require formal authorization before access, analysis, or sharing.
- 5
What data-management questions should be considered after obtaining biomedical data?
Model answer
Researchers should determine where the data will be stored, whether sufficient storage exists, and whether sensitive data have appropriate security and restricted access.
Explanation
Storage and access controls are especially important when data contain patient identifiers.
- 6
How do structured, semi-structured, and unstructured data differ in relation to preparation?
Model answer
Their formats determine what processing is required before analysis; unstructured data generally require more transformation than structured data.
Explanation
Data organization affects how information can be converted into a form usable by analytical methods.
- 7
When might a study need to generate new data rather than use existing data?
Model answer
New data may be needed when sufficient existing data do not exist, in which case the researchers must design an appropriate collection study.
Explanation
The study design should specify how new observations will be collected to address the target problem.
- 8
What is the main consequence of poor-quality data in a machine learning pipeline?
Model answer
Poor-quality data can produce poor results throughout the downstream analysis.
Explanation
Errors, bias, and irrelevant information in the input data can undermine modeling and interpretation.
- 9
What is noisy data?
Model answer
Noisy data contain uninformative features or conflicting or misleading information with respect to the target problem.
Explanation
Noise makes it harder for a model to identify reliable relationships with the outcome.
- 10
What is dirty data?
Model answer
Dirty data contain missing values or value errors that do not represent the true values at the time of collection.
Explanation
Dirty data result from incomplete or inaccurate recording of observations.
- 11
What does it mean for data to be sparse?
Model answer
Data may be sparse because the sample size is small, many values are missing, or categorical features have many possible categories.
Explanation
A ZIP code variable with many unique values is an example of a high-cardinality categorical feature.
- 12
What are two possible causes of biased data?
Model answer
Bias may result from how observations were selected, from outliers, or from survivorship bias.
Explanation
Survivorship bias occurs when only individuals who remain alive or available are included in the collected data.
- 13
What is duplicate data, and how can feature duplication occur?
Model answer
Duplicate data occur when instances are accidentally repeated; duplication can also occur when features are perfectly or highly correlated.
Explanation
Both repeated observations and redundant variables can distort analysis and unnecessarily increase data size.
- 14
What three broad strategies can help address bad data?
Model answer
Clearly define the target problem, conduct exploratory analysis, and apply best practices during data collection and cleaning.
Explanation
These steps provide the perspective needed to identify and correct data problems.
- 15
Why is there no universal rule for the number of instances required in machine learning?
Model answer
The required sample size depends on problem complexity, algorithm complexity, training and evaluation proportions, and whether data are reserved for validation or replication.
Explanation
Different tasks and modeling plans require different amounts of information.
- 16
What rough minimum training sample sizes are suggested for simpler and deep learning models?
Model answer
A rough guideline is at least 100 samples per class for simpler models and at least 1,000 samples per class for deep learning models.
Explanation
These are experience-based guidelines rather than universal requirements.
- 17
What sample sizes per class are described as a comfort zone and as solid ground for many machine learning problems?
Model answer
About 5,000 samples per class is described as a comfort zone, while 10,000 samples per class provides fairly solid ground for most situations.
Explanation
The required amount still depends on the complexity and noise of the problem.
- 18
Why is collecting more data not always beneficial?
Model answer
Adding poor-quality or inconsistent observations may not improve performance and can introduce additional problems.
Explanation
More observations are useful only when they provide reliable and relevant information.
- 19
How can published research help estimate the sample size for a new machine learning study?
Model answer
Researchers can examine similar studies to see what sample sizes produced effective models.
Explanation
Comparable prior work provides empirical guidance for the new problem.
- 20
What statistical heuristics can be used to estimate a target sample size?
Model answer
Sample size may be based on the number of classes, the number of features, or the number of model parameters.
Explanation
Examples include using a fixed number of independent instances per class, more instances than features, or instances per model parameter.
- 21
Why do nonlinear algorithms and models involving complex multivariate interactions generally require more instances?
Model answer
They must estimate more complex relationships, which requires more data to identify those relationships reliably.
Explanation
Greater model complexity increases the amount of information needed for effective learning.
- 22
How can simulated data help determine an appropriate sample size?
Model answer
Simulated data can be used to evaluate empirically how dataset size affects model performance.
Explanation
The observed performance relationship can provide a better estimate of the number of instances needed.
- 23
What are the four broad purposes of data preparation?
Model answer
Data preparation helps researchers understand their data, convert it into a machine-learning-compatible format, identify and remove errors and biases, and retain a small set of informative features.
Explanation
Preparation improves both the usability and the quality of the modeling data.
- 24
What is exploratory data analysis (EDA)?
Model answer
EDA is the investigation of data using summaries of major characteristics and visualizations to understand patterns, errors, and unusual observations.
Explanation
EDA is also called descriptive analysis and is used before and during modeling preparation.
- 25
What relationships can EDA help researchers discover?
Model answer
EDA can reveal relationships between features and outcomes and relationships among features themselves.
Explanation
These relationships can suggest patterns, predictors, or possible redundancy.
- 26
How does EDA help detect problems and evaluate assumptions?
Model answer
EDA can identify anomalies, outliers, and errors, check assumptions for statistical tests, and evaluate initial hypotheses.
Explanation
These uses make EDA an important diagnostic stage of analysis.
- 27
When should EDA be conducted in a machine learning pipeline?
Model answer
EDA should be integrated continuously throughout data preparation, from initial quality assessment through the period immediately before modeling.
Explanation
Different exploratory analyses are useful at different stages rather than at only one fixed time.
- 28
What types of summary statistics might be calculated during EDA?
Model answer
Examples include the mean, median, mode, range, variance, and interquartile range.
Explanation
Summary statistics describe the distribution and central or spread characteristics of features.
- 29
Why should feature and outcome types be examined during EDA?
Model answer
Researchers should determine whether variables are categorical, numeric, or another type and count their values when appropriate.
Explanation
Variable types affect the choice of summaries, visualizations, tests, and modeling methods.
- 30
How can correlations between features be examined during EDA?
Model answer
Researchers can calculate feature correlations and visualize them, for example with a correlation heat map.
Explanation
Correlation analysis can reveal relationships and potentially redundant features.
- 31
How can EDA examine the association between an individual feature and an outcome?
Model answer
Researchers can apply appropriate statistical tests of association or create plots such as bar plots and scatter plots.
Explanation
These methods examine univariate associations between one feature and the outcome.
- 32
What is class imbalance?
Model answer
Class imbalance occurs when one class contains a much larger proportion of observations than another class.
Explanation
This imbalance can affect some algorithms and distort interpretation of model evaluation results.
- 33
What is the preferred strategy for handling class imbalance described in the content?
Model answer
The imbalance can be retained while researchers explicitly account for it and use appropriate evaluation metrics.
Explanation
Keeping the original distribution avoids altering the data, provided evaluation is interpreted carefully.
- 34
What is undersampling, and what is its main disadvantage?
Model answer
Undersampling randomly selects fewer observations from the majority class to balance the classes, but it reduces the overall sample size.
Explanation
The loss of observations can reduce the information available for learning.
- 35
What is oversampling, and why should it be used cautiously?
Model answer
Oversampling repeatedly samples the minority class to increase its apparent size, but it may introduce bias by effectively manufacturing data.
Explanation
Without a clear justification, oversampling can make the balanced dataset less representative.
- 36
What is data wrangling?
Model answer
Data wrangling, also called data munging, is the process of cleaning and unifying messy, complex datasets for access and analysis.
Explanation
In this context, it includes feature extraction, formatting, cleaning, and integration.
- 37
How are data wrangling and EDA related?
Model answer
They are often closely connected because exploratory analysis helps identify the cleaning, formatting, and transformation actions needed during wrangling.
Explanation
Findings from EDA frequently guide subsequent data preparation decisions.
- 38
What additional activities may be included in data wrangling when preparing data for others?
Model answer
Additional activities can include structuring, enriching, validating, and publishing data.
Explanation
These activities prepare data as a reusable resource, even when they are not part of the immediate analysis.
- 39
What is feature extraction, and when is it needed?
Model answer
Feature extraction creates new features when raw data cannot be used directly for analysis, such as when the data are non-tabular.
Explanation
The extracted features should accurately represent important information in the raw data.
- 40
How can feature extraction be performed?
Model answer
It can be performed manually by a researcher or automatically through machine learning methods.
Explanation
Deep learning methods can sometimes learn features automatically and may also model non-tabular data directly.
- 41
Give examples of manually extracted features from an image of a car.
Model answer
Possible features include the number of wheels and the color of the car.
Explanation
These engineered variables convert visual information into tabular predictors.
- 42
What types of raw data commonly require feature extraction?
Model answer
Examples include images, audio, video, unstructured text, and time-series data.
Explanation
These formats often cannot be supplied directly to conventional tabular modeling methods.
- 43
How could features be manually extracted from emails to predict spam?
Model answer
Features could indicate whether keywords such as “money” or “pills” occur, whether spelling is poor, or whether the sender is known.
Explanation
These engineered variables transform unstructured email text into a tabular dataset for modeling.
- 44
Why do feature extraction techniques depend on the problem and data type?
Model answer
Different data formats and prediction problems contain different useful information, so extraction methods must be selected accordingly.
Explanation
A technique suitable for text may not represent images, audio, or time-series data effectively.
- 45
What does the bag-of-words technique do?
Model answer
It represents text by counting the occurrences of words in each text sample.
Explanation
Bag-of-words disregards grammar and word order, which may remove information important for some predictions.
- 46
How can an autoencoder be used for feature extraction?
Model answer
An autoencoder uses a neural network to learn a compressed representation of raw data, such as images.
Explanation
The compressed representation can serve as a smaller set of learned features.
- 47
What is data formatting?
Model answer
Data formatting is organizing information according to preset specifications so that particular algorithms or software packages can use it.
Explanation
Formatting is a logistical part of data preparation rather than a method for discovering scientific relationships.
- 48
What file-format considerations may be required during data preparation?
Model answer
The required file type or extension may need to be specified, such as tab-delimited text files or comma-separated values files.
Explanation
Software tools may accept only particular file structures or extensions.
- 49
How may the orientation of features and instances need to be changed?
Model answer
If features are rows and instances are columns, the table may need to be transposed so that features are columns and instances are rows.
Explanation
Many analytical tools expect observations in rows and variables in columns.
- 50
What header and column-order issues can arise during data formatting?
Model answer
A file may require a header with specific labels, and columns such as outcomes, features, or instance IDs may need to appear in permitted positions or a specified order.
Explanation
Algorithms and packages may depend on expected labels and column locations.
- 51
How can dates be numerically encoded for machine learning?
Model answer
Start and stop dates can be converted into a single numerical feature such as the elapsed time or duration.
Explanation
This creates a quantitative representation that a machine-learning method can use.
- 52
Why might text values need to be numerically encoded?
Model answer
Some downstream algorithms and packages, including most scikit-learn packages, require data values to be numerical.
Explanation
Text categories must be represented numerically before such tools can process them.
- 53
What is a danger of numerically encoding categorical values?
Model answer
Many algorithms may interpret the numeric codes as quantitative values, incorrectly implying meaningful order or distance between categories.
Explanation
Numerical encoding therefore requires caution when representing categorical variables.
- 54
Why should numerical codes such as -9 or -999 generally be avoided for missing values?
Model answer
They may be mistaken for valid numerical quantities by downstream analyses.
Explanation
A standard missing-value identifier should clearly distinguish missingness from legitimate measurements.
- 55
What is data cleaning?
Model answer
Data cleaning is the process of removing corrupted, inaccurate, biased, or useless records from a dataset.
Explanation
Cleaning improves the reliability and relevance of the data used for analysis.
- 56
How can redundant features be identified and handled?
Model answer
Duplicate or perfectly correlated feature columns can be identified and all but one can be removed to reduce feature count without losing information.
Explanation
Correlations should be documented because retained features may later appear important while representing other correlated candidates.
- 57
Why should correlations among removed and retained features be documented?
Model answer
Documentation helps identify other correlated features that could be candidates for causality if the retained feature is important after modeling.
Explanation
Predictive importance does not by itself establish which correlated variable is causal.
- 58
Why must duplicate instances be examined carefully before removal?
Model answer
Some identical instances may be accidental duplicates, but two observations with identical features and outcomes may also be genuinely independent samples.
Explanation
Removing all identical rows could incorrectly reduce the sample.
- 59
What types of features should generally be removed during basic data cleaning?
Model answer
Features known to be irrelevant to prediction and features that introduce data leakage should be removed.
Explanation
Such variables add no valid predictive information or make performance unrealistically optimistic.
- 60
What is data leakage?
Model answer
Data leakage occurs when information that should not be available for training is used to train a model.
Explanation
Leakage allows the model to use information unavailable when real-world predictions are made.
- 61
How can future information create data leakage?
Model answer
A feature may contain information that was available in the training dataset but would not be available at the time a trained model makes a prediction.
Explanation
Using future information produces an unrealistic estimate of model performance.
- 62
Why would total time until ICU admission be a leakage feature when predicting ICU admission?
Model answer
The total time until admission is known only after the admission process has occurred, so it would not be available when making the prediction.
Explanation
Although recorded in the dataset, the variable represents future information relative to the prediction time.
- 63
What are two ways to prevent data leakage?
Model answer
Understand what each feature represents in relation to the target outcome and remove features that contain leaked information before analysis.
Explanation
Knowledge of the data-generating process is essential for detecting leakage.
- 64
Why should unusually high model performance be investigated skeptically?
Model answer
Performance that seems too good may indicate an analytical mistake, such as data leakage or another problem in the modeling process.
Explanation
Questioning apparently perfect results can reveal errors before they are accepted as valid findings.
- 65
What is an outlier?
Model answer
An outlier is an observation that lies an abnormally large distance from other values in a random sample.
Explanation
Outliers may be genuine extreme cases or errors in data collection.
- 66
How should impossible outliers generally be handled?
Model answer
Impossible outliers should generally be treated as collection errors, with the value changed to missing or the entire sample removed.
Explanation
For example, a human age of 180 is not a plausible measurement and should be investigated and corrected.
- 67
Why might an age of 18 be an impossible outlier in an Alzheimer’s patient study?
Model answer
The value may be inconsistent with the study population and therefore suggest a data-collection or recording error.
Explanation
Whether a value is impossible depends partly on the biological and study context.
- 68
What methods can be used during EDA to identify extreme outliers?
Model answer
Researchers can use sorting, data visualization, statistical tests such as the z-score, and the interquartile range.
Explanation
These methods help identify observations that differ substantially from the rest of the data.
- 69
What options are available after identifying a possible outlier?
Model answer
The outlier may be retained, removed, verified or corrected through recollection, or transformed to reduce its influence.
Explanation
The appropriate action depends on whether the value is real, erroneous, and important to the study goal.
- 70
Why should researchers be cautious when removing outliers?
Model answer
An outlier may be a real extreme case, and removing it based on personal bias can distort the analysis.
Explanation
Removal is safer when many other observations remain or when the value can be verified as erroneous.
- 71
How can a logarithmic transformation help with outliers?
Model answer
A logarithmic transformation can reduce the influence of extreme values and may make a non-normal distribution more nearly normal.
Explanation
Transformation de-emphasizes large values without necessarily deleting them.
- 72
What should happen when a supervised-learning instance has a missing outcome label?
Model answer
The entire instance should be removed because supervised learning requires an outcome label and the unlabeled instance contributes nothing to training.
Explanation
Without the target outcome, the instance cannot be used to learn the supervised relationship.
- 73
What is one option for handling missing feature values when the downstream method supports missing data?
Model answer
The missing values can be left in place, provided the researcher understands how the chosen method handles them.
Explanation
Some methods treat missingness as neutral information or perform imputation during processing.
- 74
What are the main drawbacks of removing features or instances that contain missing values?
Model answer
Removing a feature may discard an important predictor, while removing instances reduces sample size and statistical power.
Explanation
Deletion can simplify the data but may sacrifice useful information.
- 75
When might a feature with a high frequency of missing values be removed?
Model answer
It may be removed when its high missingness makes it a particularly low-quality component of the dataset.
Explanation
A feature with little reliable information may not justify the complications it introduces.
- 76
How can missingness itself be treated as a predictive feature?
Model answer
Researchers can engineer a feature indicating whether a value is missing and test whether that indicator predicts the outcome.
Explanation
The fact that a measurement is missing may contain information about the subject or data-collection process.
- 77
What is imputation?
Model answer
Imputation is the substitution of missing data with placeholder values.
Explanation
The placeholder is an estimate rather than a directly observed measurement.
- 78
Why should imputation be used cautiously?
Model answer
Imputation is an educated guess at best and manufactured data at worst, so it can introduce bias.
Explanation
It may be necessary when a method cannot handle missing values and deletion is unacceptable, but the results require skepticism.
- 79
How do single and multiple imputation differ?
Model answer
Single imputation estimates a missing value using other values of the same feature, whereas multiple imputation uses many or all feature values in the dataset.
Explanation
The methods differ in how much information is used to estimate each placeholder value.
- 80
What is data integration?
Model answer
Data integration combines features or instances from different sources or studies into a unified dataset.
Explanation
Integration allows complementary information to be analyzed together.
- 81
What types of biomedical data might be integrated in a single study?
Model answer
Examples include environmental, clinical, biological, genetic, and other omics data.
Explanation
These sources may include lifestyle and socioeconomic information, electronic health records, biomarkers, sequencing, gene expression, or epigenetic data.
- 82
What are data silos, and why are they a challenge?
Model answer
Data silos are isolated stores of data with restricted or separate access; they make it difficult to gather all information required for analysis.
Explanation
Data may be distributed across files, locations, institutions, or organizational boundaries.
- 83
What logistical steps may be needed to overcome data silos?
Model answer
Researchers may need permissions, data-sharing agreements, and practical arrangements for accessing and transferring the data.
Explanation
Access is often constrained by institutional, legal, ethical, and technical requirements.
- 84
Why can integrating data from different sources require format unification?
Model answer
Different sources may store information using different file structures, variable formats, encodings, or measurement conventions.
Explanation
The sources must be made compatible before they can be combined reliably.
- 85
What is data harmonization?
Model answer
Data harmonization standardizes data collected across institutions or studies so that the combined dataset uses consistent features, names, values, encodings, and measurement units.
Explanation
Harmonization makes observations comparable before they are analyzed together.
- 86
What security issues can arise during data integration?
Model answer
Patient identifiers may be needed to link records, requiring strong security during integration and when storing the final dataset.
Explanation
Identifiers increase privacy risks and therefore require heightened protection and restricted access.

Ask anything
We've read this whole study set, so questions about it get the best answers.