Applied Machine Learning for Biomedical Data Science Exam Notes

Biomedical PhD Candidacy Exam Overview: MSBD 550 Applied Machine Learning

  • Course Title: MSBD 550 Applied Machine Learning for Biomedical Data Science

  • Exam Period: Summer 2024

  • Total Possible Marks: 100 points

  • Time Limit: 120 minutes

  • Structure:

    • Questions 1 through 4 are mandatory and contain multiple parts.

    • Question 5 requires the candidate to choose between Part 1 or Part 2.

  • Response Guidelines:

    • Multiple-choice: Provide the single best response.

    • Open-ended: Brief, accurate, and concise statements.

    • Calculations: All work must be shown explicitly.

Fundamental Concepts in Machine Learning

Core Learning Paradigms
  • Unsupervised Learning: This paradigm involves modeling the underlying structure or distribution in data in order to learn more about the data. A primary example is K-means clustering, which partitions unlabeled data points into groups based on similarity. Other techniques like Linear Regression, Decision Trees, and Support Vector Machines (SVMs) typically fall under supervised learning.

  • Versatile Algorithms: Some algorithms are capable of handling both classification (predicting discrete labels) and regression (predicting continuous values). K-nearest neighbors (KNN) is a prominent example of an algorithm used for both tasks.

  • Probabilistic Classifiers: Naive Bayes classifiers are built on the assumption that features are independent given the class label, a simplification that allows for efficient computation even with high-dimensional data.

Model Performance and Optimization
  • Overfitting: This occurs when a machine learning model performs exceptionally well on the training data but fails to generalize to new, unseen data. It essentially "memorizes" the noise and specific patterns of the training set instead of the underlying trend.

  • Activation Functions: In neural networks, these functions are critical because they introduce non-linearity into the model, allowing the network to learn complex patterns that a simple linear transformation cannot capture.

  • Gradient Descent: This is a fundamental optimization algorithm used to iteratively minimize the loss function by moving in the direction of the steepest descent defined by the negative of the gradient.

  • Confusion Matrix: This is a performance evaluation tool used specifically for classification models (not regression). It summarizes the number of correct and incorrect predictions broken down by each class (True Positives, True Negatives, False Positives, False Negatives).

Ensemble Methods
  • Ensemble Learning Definition: A technique that combines multiple individual models (often called "base learners" or "weak learners") to create a single, more robust predictive model. The goal is to improve the overall performance, stability, and accuracy compared to any single model.

  • Bagging (Bootstrap Aggregating):

    • Process: Models are built independently and in parallel. Multiple subsets of the training data are created using sampling with replacement (bootstrapping), and a model is trained on each.

    • Goal: Primarily used to decrease variance and prevent overfitting.

    • Example: Random Forest, which builds multiple independent decision trees and aggregates their results.

  • Boosting:

    • Process: Models are built sequentially. Each subsequent model attempts to correct the errors made by the previous models in the sequence by increasing the weight of misclassified instances.

    • Goal: Primarily used to decrease bias and improve predictive power.

    • Example: AdaBoost (Adaptive Boosting) or Gradient Boosting Machines (GBM).

Comparative Machine Learning Definitions

  • Inference vs. Prediction:

    • Inference: Focuses on understanding the relationship between the independent variables and the output (e.g., how does median income affect house prices?). It is about testing hypotheses and determining the significance of predictors.

    • Prediction: Focuses on accurately forecasting the output for new observations (e.g., what will the price of this specific house be?). The "black box" nature of the model is often acceptable as long as the output is accurate.

  • Supervised vs. Reinforcement Learning:

    • Supervised Learning: The model is trained on a labeled dataset where both inputs and the correct outputs are provided.

    • Reinforcement Learning: The model (agent) learns to make a sequence of decisions by interacting with an environment to maximize a cumulative reward signal. There is no labeled dataset; only a feedback loop of actions, states, and rewards.

  • Overfitting vs. Underfitting:

    • Overfitting: Low training error, high testing error. The model is too complex.

    • Underfitting: High training error and high testing error. The model is too simple to capture the underlying structure of the data.

  • Batch vs. Online Learning:

    • Batch Learning: The system is incapable of learning incrementally. It must be trained using all available data at once. Updating the model requires retraining from scratch with the old and new data.

    • Online Learning: The system learns incrementally by feeding it data instances sequentially (either individually or in small groups called "mini-batches"). It is ideal for systems that receive data as a continuous flow.

Case Study: Emergency Room ICU Admission Prediction

Problem Context

A hospital ER measures 17 variables (demographics/clinical) for new patients. A decision must be made: Admit to ICU or not? High priority is given to patients who may survive less than a month due to high costs.

Analysis
  1. Identification of Variables:

    • Features: The 17 clinical and demographic variables (age, heart rate, blood pressure, etc.).

    • Target Variable: Binary outcome indicating Risk/Priority (e.g., 1 for High Risk/ICU Priority, 0 for Low Risk/No ICU).

  2. Machine Learning Workflow:

    • Data Collection: Gather the 17 variables and historical outcomes for previous patients.

    • Data Preprocessing: Handle missing values, normalize numerical data, and encode categorical variables.

    • Feature Selection/Engineering: Determine which of the 17 variables are most predictive of survival/risk.

    • Model Selection: Choose appropriate classification algorithms (e.g., Logistic Regression, Random Forest).

    • Training: Split data into training and testing sets; fit the model to the training data.

    • Evaluation: Assess performance using a confusion matrix, specifically looking at sensitivity (recall) to ensure high-risk patients are not missed.

    • Deployment: Integrate the model into the ER workflow for real-time decision support.

Dataset Analysis: California Housing Prices

Dataset Attributes
  1. housingMedianAge: Median age of builds in a block (lower = newer).

  2. totalRooms: Total rooms in a block.

  3. latitude: Block group latitude.

  4. longitude: Block group longitude.

  5. totalBedrooms: Total bedrooms in a block.

  6. population: Total residents in a block.

  7. households: Groups of people residing in a home unit per block.

  8. medianIncome: Measured in tens of thousands of USD (10410^4).

  9. oceanProximity: Categorical location relative to the sea.

  10. medianHouseValue (Target): Measured in hundreds of thousands of USD (10510^5).

Observation and Modeling Strategy
  • Histograms: Used to observe distributions, identify skewness, and spot outliers (e.g., vacation resorts with high room counts but low households).

  • Correlation Matrix: High correlation is expected between totalRooms, totalBedrooms, households, and population as they all relate to block size. medianIncome is expected to have the strongest positive correlation with medianHouseValue.

  • Relevant Features: medianIncome is traditionally the most relevant. Engineered features like rooms_per_household or population_per_household may provide better insights than raw totals.

  • Model Suitability: Regression models are required. Linear Regression provides a baseline, while Random Forest Regressor or Gradient Boosting (XGBoost) would likely perform better due to non-linear relationships and housing data complexities.

Decision Tree Calculations: Credit Risk Dataset

Dataset Statistics
  • Total Instances (NN): 14

  • Classes (Risk): High (H), Medium (M), Low (L)

Entropy Formulas

Entropy measures the impurity of a dataset SS: H(S)=∑i=1c−pilog⁡2(pi)H(S) = \sum_{i=1}^{c} -p_i \log_2(p_i) Where pip_i is the proportion of the dataset belonging to class ii.

Information Gain Formula

Gain(S,A)=H(S)−∑v∈Values(A)∣Sv∣∣S∣H(Sv)Gain(S, A) = H(S) - \sum_{v \in Values(A)} \frac{|S_v|}{|S|} H(S_v) Where SvS_v is the subset of SS for which attribute AA has value vv.

Computation Steps
  1. Individual Class Entropies: Calculate the probability of H, M, and L within the dataset.

  2. Overall Entropy: Apply the entropy formula to the total distribution (N=14N=14).

  3. Attribute Evaluation (Income/Debt or Collateral/Credit History):

    • Calculate the entropy for each subset partitioned by the attribute values (e.g., High Income subset, Medium Income subset, Low Income subset).

    • Compute the weighted average of these entropies.

    • Subtract this weighted average from the overall entropy to find the Information Gain.

  4. Best Split: The attribute with the highest Information Gain is selected as the best split for the decision tree node.