0
我想在naive_bayes函数(naivebayes包),predict.naive_bayes函数(naivebayes包)和naiveBayes函数(e1071)中查看底层算法(代码)包)。 我得到像下面这样的东西,但我看不到算法本身。 naiveBayes 功能(X,...) UseMethod( “naiveBayes”) 我该如何查看朴素贝叶斯的R函数的算法
naive_bayes
function (x, ...)
{
UseMethod("naive_bayes")
}
<environment: namespace:naivebayes>
predict.naive_bayes
Error: object 'predict.naive_bayes' not found
> predict
function (object, ...)
UseMethod("predict")
<bytecode: 0x000000000ad686d0>
<environment: namespace:stats>
naivebayes::naive_bayes
function (x, ...)
{
UseMethod("naive_bayes")
}
<environment: namespace:naivebayes>
> naivebayes:::naive_bayes
function (x, ...)
{
UseMethod("naive_bayes")
}
<environment: namespace:naivebayes>
>
I also tried this
> download.packages(naivebayes)
Error in dir.exists(destdir) :
argument "destdir" is missing, with no default
> download.packages(naivebayes, destdir = ".",type = "source")
Error in unique(pkgs) : object 'naivebayes' not found
> download.packages(e1071, destdir = ".",type = "source")
Error in unique(pkgs) : object 'e1071' not found
>
很酷!谢谢。 – matt