Skip to content

Instantly share code, notes, and snippets.

@tadelv
Created May 23, 2010 18:48
Show Gist options
  • Save tadelv/411156 to your computer and use it in GitHub Desktop.
Save tadelv/411156 to your computer and use it in GitHub Desktop.
#podaj vektor atributov, katere
#funkcija odstrani iz dataseta in izracuna napovedi
#atributi so podani z indeksom (da jih lazje odstranimo)
odstrani.atr.in.izr.napovedi <- function(dataset, attributes, model, formula, ...) {
cat("OHAI!1!\n")
results <- ""
predictions <- ""
for(i in 1:length(attributes)) {
pr <- izracunaj.napovedi(formula, model, dataset[,-attributes[i]],...)
#predictions <- c(predictions,pr)
val <- rmse(pr)
results <- c(results,val)
cat("value: ",val," attribute: ",attributes[i],"\n")
}
cat("done.\n")
data <- data.frame(results=results)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment