##(My)sql commands I encountered throughout my sql-experience
####Basics #####Create database and tables
DROP DATABASE IF EXISTS database_name;
CREATE DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
##(My)sql commands I encountered throughout my sql-experience
####Basics #####Create database and tables
DROP DATABASE IF EXISTS database_name;
CREATE DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## Correlation matrix with p-values. See http://goo.gl/nahmV for documentation of this function | |
cor.prob <- function (X, dfr = nrow(X) - 2) { | |
R <- cor(X, use="pairwise.complete.obs") | |
above <- row(R) < col(R) | |
r2 <- R[above]^2 | |
Fstat <- r2 * dfr/(1 - r2) | |
R[above] <- 1 - pf(Fstat, 1, dfr) | |
R[row(R) == col(R)] <- NA | |
R | |
} |
library(lars) #load lars library | |
# load data from csv file | |
fullData <- read.csv('/Users/adityanisal/Dropbox/ExtractedResultFiles/CSV/fireplace-mv1.csv') | |
# display data | |
fullData | |
# remove "null" columns (columns with all 0s) | |
M <- fullData[,colSums(fullData^2) !=0] | |
M | |
# Take all columns (features) except the last solutionVector | |
x <- M[,c(1:8)] |