This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library('caTools') | |
| library('ROCR') | |
| data <- read.csv('quality.csv') | |
| # 98 received good care (0), 33 poor care (1). | |
| table(data$PoorCare) | |
| rbPal <- colorRampPalette(c('red','blue')) | |
| data$col <- rbPal(10)[as.numeric(cut(data$PoorCare, breaks = 10))] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(caTools) | |
| library(ROCR) | |
| framingham <- read.csv('framingham.csv') | |
| set.seed(1000) | |
| split <- sample.split(framingham$TenYearCHD, SplitRatio = 0.65) | |
| train <- subset(framingham, split == TRUE) | |
| test <- subset(framingham, split == FALSE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| State | Year | Rasmussen | SurveyUSA | DiffCount | PropR | Republican | |
|---|---|---|---|---|---|---|---|
| Alabama | 2004 | 11 | 18 | 5 | 1 | 1 | |
| Alabama | 2008 | 21 | 25 | 5 | 1 | 1 | |
| Alaska | 2004 | 1 | 1 | 1 | |||
| Alaska | 2008 | 16 | 6 | 1 | 1 | ||
| Arizona | 2004 | 5 | 15 | 8 | 1 | 1 | |
| Arizona | 2008 | 5 | 9 | 1 | 1 | ||
| Arizona | 2012 | 8 | 4 | 0.833333333 | 1 | ||
| Arkansas | 2004 | 7 | 5 | 8 | 1 | 1 | |
| Arkansas | 2008 | 10 | 5 | 1 | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| songs <- read.csv('songs.csv') | |
| table(songs$year == 2010) | |
| table(songs$artistname == 'Michael Jackson') | |
| songs[songs$artistname == 'Michael Jackson' & songs$Top10 == 1, 'songtitle'] | |
| table(songs$timesignature) | |
| # or | |
| unique(songs$timesignature) | |
| summary(songs$timesignature) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(caTools) | |
| library(ROCR) | |
| parole <- read.csv('parole.csv') | |
| table(parole$violator) | |
| unique(parole$state) | |
| unique(parole$crime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mice) | |
| library(caTools) | |
| library(ROCR) | |
| loans <- read.csv('loans.csv') | |
| # What proportion of the loans in the dataset were not paid in full? | |
| table(loans$not.fully.paid) | |
| table(loans$not.fully.paid)['1'] / nrow(loans) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(caTools) | |
| library(rpart) | |
| library(rpart.plot) | |
| library(ROCR) | |
| library(randomForest) | |
| library(caret) | |
| library(e1071) | |
| stevens <- read.csv('stevens.csv') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(caTools) | |
| library(rpart) | |
| library(rpart.plot) | |
| claims <- read.csv('claimsdata.csv') | |
| table(claims$bucket2009) / nrow(claims) | |
| set.seed(88) | |
| spl <- sample.split(claims$bucket2009, SplitRatio = 0.6) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| nwjs: { | |
| options: { | |
| platforms: ['win64', 'osx64'], | |
| buildDir: './builds', | |
| macZip: true | |
| }, | |
| src: ['../myapp/**/*'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rpart) | |
| library(rpart.plot) | |
| library(caTools) | |
| library(caret) | |
| library(e1071) | |
| boston <- read.csv('boston.csv') | |
| plot(boston$LON, boston$LAT) |