首页 > > 详细

解析R程序、R语言解析、解析Statistics统计、R语言解析

# Naive Bayes
library(plyr)
library(reshape2)

class_prob 40",">40",">40","31-40","40","40"),
income = c("high","high","high","medium","low","low","low","medium","low","medium","high","medium","high","medium"),
student = c("no","no","no","no","yes","yes","yes","no","yes","yes","yes","no","yes","no"),
credit_rating = c("fair","excellent","fair","fair","fair","excellent","excellent","fair","fair","fair","excellent","excellent","fair","excellent"),
buys_computer = c("no","no", "yes", "yes", "yes","no", "yes","no", "yes", "yes", "yes", "yes", "yes","no")
)
oneObs <- data.frame(
feature.name = c("age","income","student","credit_rating"),
feature.value = c("31-40","medium","no","fair")
)
pc <- class_prob(train.computer,"buys_computer")
pfc <- feature_class_prob(train.computer,"buys_computer")
pre_class(oneObs, pc,pfc)

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!