Advertisement
Guest User

Untitled

a guest
Jan 4th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. rm(list=ls())
  2. setwd("C:/Users/Mati/Desktop/Seminarium/Projektowanie rozmytych systemów regółowych w języku R/FRBS")
  3. library(frbs)
  4.  
  5.  
  6.  
  7.  
  8. varinp.mf <- matrix(c( 5, -1, 0.8493, NA, NA,
  9. 5, 1, 0.8493, NA, NA,
  10. 5, -1, 0.8493, NA, NA,
  11. 5, 1, 0.8493, NA, NA),
  12. nrow = 5, byrow = FALSE)
  13. num.fvalinput <- matrix(c(2,2), nrow=1)
  14. x1 <- c("A1","A2")
  15. x2 <- c("B1","B2")
  16. names.varinput <- c(x1, x2)
  17. range.data <- matrix(c(-1.5,1.5, -1.5,1.5), nrow=2)
  18. type.defuz <- "5"
  19. type.tnorm <- "MIN"
  20. type.snorm <- "MAX"
  21. type.implication.func <- "MIN"
  22. name <- "Przykład"
  23. newdata <- matrix(c(-0.6, 0.3), ncol = 2, byrow = TRUE)
  24. colnames.var <- c("x1", "x2")
  25. type.model <- "TSK"
  26. func.tsk <- matrix(c(1,1,1,
  27. 2,1,0,
  28. 1,-2,-1,
  29. -1,0.5,-2),
  30. nrow = 4, byrow = TRUE)
  31.  
  32. rule <- matrix(c("A1","and","B1","->",
  33. "A1","and","B2","->",
  34. "A2","and","B1","->",
  35. "A2","and","B2","->"),
  36. nrow = 4, byrow = TRUE)
  37. object <- frbs.gen(range.data, num.fvalinput, names.varinput,
  38. num.fvaloutput, varout.mf=NULL, names.varoutput, rule,
  39. varinp.mf, type.model, type.defuz, type.tnorm, type.snorm,
  40. func.tsk, colnames.var, type.implication.func, name)
  41. plotMF(object)
  42.  
  43. object
  44. #res <- predict(object, newdata)$predicted.val
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement