0% found this document useful (0 votes)
6 views28 pages

Data Science: Understanding Data Requirements

Uploaded by

saqib ullah
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views28 pages

Data Science: Understanding Data Requirements

Uploaded by

saqib ullah
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Week # 4

Recorded Lecture
INTRODUCTION TO DATA SCIENCE
2. Working with the Data

What data is Where is the


needed to data coming
answer the from? Or how
question? to get it?

Is the data What additional


collected work is required
representative to manipulate
of the problem and work with
being solved? the data?

2
2.1 Data Requirements

• How to cook Tiramisu?


• Problem to resolve
• How to cook Tiramisu?
• Data
• Ingredients
• Which ingredients are required?
• How to collect them?
• How to prepare the ingredients to cook the desired
dish?

3
2.1 Data Requirements

What are data


Six Key Questions
requirements? What Type of Data is required?
What

How the data will be used? How Where Where Do you Get the Data?

Data
How Do you obtain the Data? How When When Do you Need The Data?

Why
Why We need The Data

4
[Link] Study
• Define data requirements for the decision tree classification
approach
• Define and select cohort
• In-patient within health insurance provider’s service area
• Primary diagnosis of CHF in one year
• Continuous enrollment for at least 6 months prior to primary
CHF admission
• Disqualifying conditions
31

• Patients with other significant medical conditions


Case Study
Defining the Data
• Contents, formats, representation suitable for
decision tree classifier
• One record per patient
• Columns representing variables
• Contents covering all aspects of patient’s clinical
history
• Transactional format
• Transformation required

6
Case Study
• Available data source
• Corporate data warehouse
• Single source of medical and claims
• In-patient record system
• Claim payment system
• Disease management program information

8
2.2 Data Collection
• Assessment of the data collected by the data scientist is

required after initial data collection.

• Determine if the data is what is required?

• Some data might be missing.

• Some might be hard to get.


9
2.2 Data Collection
• Various techniques can be
applied to asses the
contents, quality and
initial insight about the
data.
• Visualization
• Descriptive Statistics

10
Case Study

• Data wanted but not


available
• Pharmaceutical
records
• Ok to defer

11
Case Study

Merging the data

Eliminate the redundant


data

12
2.3 Data Understanding

• Is the data to be collected representative of the problem


to be solved?
• What does it mean to “prepare” or “clean” the data?

13
2.3 Data Understanding

• Describe Data
• Check data volume and examine its properties
• Accessibility and availability of attributes
• Attributes types, range, correlations, identifiers
• Understand the meaning of each attribute and attribute value in
business terms.
• For each attribute, compute basic statistics
• Distribution
• Average ,Max, Min
• Std deviation, variance, skewness
14
2.3 Data Understanding
• Explore Data
• Analyze properties of interesting attributes in detail
• Verify Data Quality
• Identify special values and catalogue their meaning
• Does it cover all the cases required?
• Does it contain error?
• Identify missing attributes.
• Do the meaning of attributes and contained values fit together?
• Check spelling of values (“The case of exploding mangoes”, “the Case of Exploding Mangoes”)

15
Case Study Data Understanding

• Run Descriptive Statistics against data column that can


become variables in the model.
• Descriptive Statistics
• Univariate Statistics
• Pairwise Correlation
• Histogram

16
Case Study Data Understanding

• Data Quality
• Missing Values
• Invalid or misleading
values

17
Case Study Data Understanding

• Iterative Data Collection and


Understanding
• Refined definition of “CHF admission”
• Initial definition
• Initial diagnosis of primary diagnosis
of CHF
• Refine the definition based on the
clinical information

18
2.3 Data Understanding

• Data Cleaning
• Correct, remove or ignore noise
• Decide how to deal with special values and their
meaning
• 0 Male, 1 Female
• Aggregation Level
• Outliers

19
2.4 Data Preparation
• Feature Engineering
• Process of using domain knowledge to create
features that make the machine learning
algorithm work.

20
2.4 Data Preparation
• Integrate Data
• Integrate sources and store result
• Format Data
• Re-arrange attributes
• First field identifier, last field the label(readmission or
not)
• Re-ordering records
• Reformatted within value
• Removing illegal characters
• Upper case to lowercase etc
21
2.4 DCase Studyta
Preparation
• CHF broad definition
• Define the readmission criterion
• Index admission (first time admission for heart related
issue)
• Readmission
• Based on the expert advise and data, a 30 day time frame
is set for readmission.

22
2.4 DCase Studyta
Preparation
• Aggregating Records
• Claims :
• Professional provider , facility, pharmaceutical
• Inpatient and out patient records
• Diagnosis procedure, prescription etc
• Possibly thousands per patients (depends on clinical
history)

23
2.4 DCase Studyta
Preparation
• Aggregate to patient level
• Roll up to 1 record per patient
• Create new columns representing the
transaction
• Outpatients visits
• Inpatient episodes
• Frequency,
• Recency

24
2.4 DCase Studyta
Preparation
• More or less data needed?
• Literature review of important factors for CHF
readmission

25
Case Studyreparation
• Completing the Data Set
• Merge all records
• List of variables used in modeling
• Target
• CHF readmission within 30 days (Yes/No)
following discharge from CHF hospitalization

26
2.4 2.4 DCase Study
• Target
• CHF readmission within 30 days (Yes/No) following discharge
from CHF hospitalization

• Measures • Gender • Age • Primary Drug


• Length of Stay • Prior Admission • CHF Diagnosis
Important (Primary,
• Diagnosis Secondary, Tertiary)

Flag • CHF • Renal Failure • Hypertension


• Diabetes • Pneumonia

27
Case Study
• Using Training Set

• Total records :: 2,343

• Randomly divide into training and test sets (70%,


30% split)
• Training – 1,640

• Testing – 703

28

Common questions

Powered by AI

Challenges include incomplete records that may lead to biased models and predictions. Solutions involve techniques like imputation, using averages or domain knowledge to fill gaps, leveraging correlations to infer missing values, and sometimes choosing to omit certain records if they compromise dataset quality. These approaches help ensure the dataset is robust and comprehensive for machine learning applications, reducing the risk of skewed or inaccurate predictions .

Defining clear target variables is crucial for setting precise objectives and measuring specific outcomes. In CHF readmission studies, the target variable determines the prediction goal, such as readmission within 30 days following discharge. Clear definition aids in aligning data collection, preparation, and analysis processes to ensure the study effectively addresses the primary research question. It helps in creating robust models that can effectively predict patient outcomes, guiding clinical decisions and interventions .

Splitting data into training and testing sets enhances reliability by allowing the model to be trained on one subset and validated on another, ensuring that the model's predictions generalize to new, unseen data. In a clinical context, having a properly stratified split (like 70% training and 30% testing) ensures that the model can accurately predict on real-world data and not just the data it was optimized on, thereby preventing overfitting and bias .

The main considerations include defining the cohort, such as patients within a health insurance provider's service area, with a primary diagnosis of CHF, and continuous enrollment for at least six months prior to the primary CHF admission. It is crucial to identify disqualifying conditions like other significant medical issues. Additionally, the data contents, formats, and representation must be suitable for decision tree classifiers, include transactional format with one record per patient, and cover all aspects of the patient's clinical history .

Exploratory data analysis helps in assessing data quality by analyzing the properties of interesting attributes in detail, verifying data quality, identifying special values, checking for missing or invalid values, and ensuring that attribute meanings align with their values. Techniques such as running descriptive statistics, univariate statistics, and pairwise correlations provide insights into the distribution, average, max, min, and skewness of attributes. This analysis aids in data cleaning and ensures the data is correctly formatted for modeling .

Data cleaning involves correcting or managing special values and noise by deciding how to treat values that may distort model insights, such as coding inconsistencies or erroneous entries (e.g., noise correction or ignoring specific anomalies). Handling special values might involve decisions like denoting gender numerically (0 for Male, 1 for Female) and dealing with outliers. Proper cleaning enhances model performance by ensuring data integrity, leading to more accurate predictive insights .

Steps in refining data definitions for CHF involve iteratively assessing clinical information to refine definitions, such as distinguishing between initial and refined definitions for CHF admission. This includes understanding primary diagnoses, evaluating clinical insights, and using iterative data collection and understanding to adapt the definitions based on emerging data quality standards and expert advice. This ensures that the data accurately reflects the clinical reality and is suitable for modeling purposes .

Feature engineering is crucial because it involves using domain knowledge to create features that improve machine learning algorithms' performance. In the context of CHF readmission prediction, feature engineering involves integrating and formatting data, such as ensuring attributes are rearranged and records reordered. It also includes transforming values (e.g., changing cases or removing illegal characters) and creating new features like aggregation at the patient level (e.g., outpatient visits, inpatient episodes). This helps capture relevant patterns and variables critical for prediction models .

Assessing data representativeness is essential to ensure that the data accurately reflects the problem domain, making predictions and analyses relevant and applicable. This can be achieved by evaluating the cohort definition, understanding the primary and disqualifying conditions, and verifying if the available data aligns with the actual problem parameters. Techniques such as visualizations and descriptive statistics help identify gaps in representation, ensuring comprehensiveness and relevance .

Integrating multiple data sources improves completeness and accuracy by merging diverse datasets, such as corporate data warehouses, inpatient record systems, and claims payment system information. This process ensures that all necessary data points (e.g., medical history, service use) are available and that transactional records are comprehensive, reducing redundancy. This comprehensive amalgamation helps cover all cases required for a solid analysis and prediction framework .

You might also like