Sei sulla pagina 1di 9

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.

csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)
# Find the number of dimensions with lowest cross validation error
cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))


library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1
# Rerun the model
pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))
cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))
cola.url = "http://wiki.q-researchsoftware.com/images/d/db/Stacked_colas.csv"
colas = read.csv(cola.url)
str(colas)

colas = subset(colas, select = -c(URLID, brand))

library(pls)
pls.model = plsr(pref ~ ., data = colas, validation = "CV")
summary(pls.model)

# Find the number of dimensions with lowest cross validation error


cv = RMSEP(pls.model)
best.dims = which.min(cv$val[estimate = "adjCV", , ]) - 1

# Rerun the model


pls.model = plsr(pref ~ ., data = colas, ncomp = best.dims)
summary(pls.model)

coefficients = coef(pls.model)
sum.coef = sum(sapply(coefficients, abs))
coefficients = coefficients * 100 / sum.coef
coefficients = sort(coefficients[, 1 , 1])
barplot(tail(coefficients, 5))

Potrebbero piacerti anche