Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rm(list=ls())
- setwd("C:/Users/Mati/Desktop/Seminarium/Projektowanie rozmytych systemów regółowych w języku R/FRBS")
- library(frbs)
- varinp.mf <- matrix(c( 5, -1, 0.8493, NA, NA,
- 5, 1, 0.8493, NA, NA,
- 5, -1, 0.8493, NA, NA,
- 5, 1, 0.8493, NA, NA),
- nrow = 5, byrow = FALSE)
- num.fvalinput <- matrix(c(2,2), nrow=1)
- x1 <- c("A1","A2")
- x2 <- c("B1","B2")
- names.varinput <- c(x1, x2)
- range.data <- matrix(c(-1.5,1.5, -1.5,1.5), nrow=2)
- type.defuz <- "5"
- type.tnorm <- "MIN"
- type.snorm <- "MAX"
- type.implication.func <- "MIN"
- name <- "Przykład"
- newdata <- matrix(c(-0.6, 0.3), ncol = 2, byrow = TRUE)
- colnames.var <- c("x1", "x2")
- type.model <- "TSK"
- func.tsk <- matrix(c(1,1,1,
- 2,1,0,
- 1,-2,-1,
- -1,0.5,-2),
- nrow = 4, byrow = TRUE)
- rule <- matrix(c("A1","and","B1","->",
- "A1","and","B2","->",
- "A2","and","B1","->",
- "A2","and","B2","->"),
- nrow = 4, byrow = TRUE)
- object <- frbs.gen(range.data, num.fvalinput, names.varinput,
- num.fvaloutput, varout.mf=NULL, names.varoutput, rule,
- varinp.mf, type.model, type.defuz, type.tnorm, type.snorm,
- func.tsk, colnames.var, type.implication.func, name)
- plotMF(object)
- object
- #res <- predict(object, newdata)$predicted.val
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement