Skip to content

Instantly share code, notes, and snippets.

View leezx's full-sized avatar
🏅
Coding

Zhixin Li, PhD leezx

🏅
Coding
  • DFCI, HMS, Broad Institute
  • MA, US.
View GitHub Profile
@mick001
mick001 / logistic_regression.R
Last active October 1, 2023 10:22
Logistic regression tutorial code. Full article available at http://datascienceplus.com/perform-logistic-regression-in-r/
# Load the raw training data and replace missing values with NA
training.data.raw <- read.csv('train.csv',header=T,na.strings=c(""))
# Output the number of missing values for each column
sapply(training.data.raw,function(x) sum(is.na(x)))
# Quick check for how many different values for each feature
sapply(training.data.raw, function(x) length(unique(x)))
# A visual way to check for missing data