Digging into question 3
This commit is contained in:
@@ -8,27 +8,39 @@ chip <- read.csv("/home/shmick/Downloads/chip_dataset.csv")
|
|||||||
##BONUS: convert from EPOCH: as.Date(as.POSIXct(1100171890,origin = "1970-01-01"))
|
##BONUS: convert from EPOCH: as.Date(as.POSIXct(1100171890,origin = "1970-01-01"))
|
||||||
#View(chip)
|
#View(chip)
|
||||||
##For question 1, we have chosen to examine which type of chip has examined the greater improvement over the years - GPU chips or CPU chips.
|
##For question 1, we have chosen to examine which type of chip has examined the greater improvement over the years - GPU chips or CPU chips.
|
||||||
#+As chip perfomance is most directly correlated with the number of transistors, we have measured the pace of development based on pace of
|
#+As chip performance is most directly correlated with the number of transistors, we have measured the pace of development based on pace of
|
||||||
#+increasing transistor count.
|
#+increasing transistor count.
|
||||||
CPU <- chip[chip$Type == 'CPU',]
|
CPU <- chip[chip$Type == 'CPU',]
|
||||||
CPU <- subset(CPU, select= c(Product,Type,Release.Date,Process.Size..nm.,TDP..W.,Die.Size..mm.2.,Transistors..million.,Freq..MHz.))
|
CPU <- subset(CPU, select= c(Product,Type,Release.Date,Process.Size..nm.,TDP..W.,Die.Size..mm.2.,Transistors..million.,Freq..MHz.))
|
||||||
GPU <- chip[chip$Type == 'GPU',]
|
GPU <- chip[chip$Type == 'GPU',]
|
||||||
GPU <- subset(GPU, select= c(Product,Type,Release.Date,Process.Size..nm.,TDP..W.,Die.Size..mm.2.,Transistors..million.,Freq..MHz.))
|
GPU <- subset(GPU, select= c(Product,Type,Release.Date,Process.Size..nm.,TDP..W.,Die.Size..mm.2.,Transistors..million.,Freq..MHz.))
|
||||||
#Calculate a crude 'performance factor' - the number of transistors multiplied by their frequency.
|
#Calculate a crude 'performance factor' - the number of transistors multiplied by their frequency.
|
||||||
CPU["Performance Factor"] <- CPU$Transistors..million.*CPU$Freq..MHz.
|
#CPU["Performance Factor"])
|
||||||
GPU["Performance Factor"] <- GPU$Transistors..million.*GPU$Freq..MHz.
|
|
||||||
View(CPU)
|
|
||||||
View(GPU)
|
|
||||||
#Range of total transistor advancement
|
#Range of total transistor advancement
|
||||||
max(CPU$Transistors..million.,na.rm=TRUE) - min(CPU$Transistors..million.,na.rm=TRUE)
|
max(CPU$Transistors..million.,na.rm=TRUE) - min(CPU$Transistors..million.,na.rm=TRUE)
|
||||||
max(GPU$Transistors..million.,na.rm=TRUE) - min(GPU$Transistors..million.,na.rm=TRUE)
|
max(GPU$Transistors..million.,na.rm=TRUE) - min(GPU$Transistors..million.,na.rm=TRUE)
|
||||||
#Omit chips with missing data
|
#Omit chips with missing data
|
||||||
CPU <- na.omit(CPU)
|
#CPU <- na.omit(CPU)
|
||||||
GPU <- na.omit(GPU)
|
#GPU <- na.omit(GPU)
|
||||||
##Iterate over date entries
|
##Iterate over date entries
|
||||||
#for (i in 1:length(CPU$Release.Date)){print(i)}
|
#for (i in 1:length(CPU$Release.Date)){print(i)}
|
||||||
##Get date
|
##Get date
|
||||||
#for (i in 1:length(CPU$Release.Date)){print(CPU$Release.Date[i])}
|
##Install the 'lubridate' package to deal with conversion to EPOCH time
|
||||||
|
#install.packages('lubridate')
|
||||||
|
#library(lubridate)
|
||||||
|
#dates <- strptime(CPU$Release.Date,format="%Y-%m-%d")
|
||||||
|
#as.integer(as.POSIXct(CPU$Release.Date))
|
||||||
|
#posix_format_date <- c()
|
||||||
|
#or (date in 1:length(CPU$Release.Date)){
|
||||||
|
# cat("Date is", date)
|
||||||
|
# human_format_date <- CPU$Release.Date[date]
|
||||||
|
# print(human_format_date)
|
||||||
|
# posix_format_date[date] <- strptime(human_format_date,format="%Y-%m-%d")
|
||||||
|
#}
|
||||||
|
#for (i in CPU$Release.Date){
|
||||||
|
# print(i)
|
||||||
|
#}
|
||||||
|
|
||||||
|
|
||||||
##QUESTION 2: measure number of columns in our dataset and calculate a permutation and combination of
|
##QUESTION 2: measure number of columns in our dataset and calculate a permutation and combination of
|
||||||
#+that number, minus two, and 3.
|
#+that number, minus two, and 3.
|
||||||
@@ -37,4 +49,18 @@ GPU <- na.omit(GPU)
|
|||||||
#n <- ncol(kernel_commits)
|
#n <- ncol(kernel_commits)
|
||||||
#View(n)
|
#View(n)
|
||||||
|
|
||||||
##QUESTION 3: pick two categorcial variables - month (?), is documentation
|
##QUESTION 3: pick two categorcial variables (Chip type, foundry) and see whether they're dependent
|
||||||
|
#+1. Probablity of chip type
|
||||||
|
#+2. Probability of foundry
|
||||||
|
#+3. Multiplty
|
||||||
|
|
||||||
|
#Sample 1 variable from 'Type' column
|
||||||
|
chip_type_sample <- sample(chip$Type,1)
|
||||||
|
#Count how many times it appears in it's column
|
||||||
|
p_chip_type_sample <- (length(which(chip$Type==chip_type_sample)))/length(chip$Type)
|
||||||
|
chip_foundry_sample <- sample (chip$Foundry,1)
|
||||||
|
p_chip_foundry_sample <- (length(which(chip$Foundry==chip_foundry_sample)))/length(chip$Foundry)
|
||||||
|
chip_type_sample_matrix <- chip[chip$Type == chip_type_sample,]
|
||||||
|
p_chip_type_foundry_sample <- (length(which(chip_type_sample_matrix$Foundry==chip_foundry_sample)))/length(chip_type_sample_matrix$Foundry)
|
||||||
|
#p_victim_bastard <- p_neo_bastard * nrow(CPU )
|
||||||
|
p_chip_type_foundry_sample * p_chip_type_sample
|
||||||
Reference in New Issue
Block a user