Weka_interfaces(RWeka)
Weka_interfaces()所属R语言包:RWeka
R/Weka interfaces
R / Weka中的接口
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Create an R interface to an existing Weka learner/filter, or show the available interfaces.
创建一个R接口Weka中学习到现有的/过滤器,或显示可用的接口。
用法----------Usage----------
make_Weka_associator(name, class = NULL, init = NULL)
make_Weka_classifier(name, class = NULL, handlers = list(), init = NULL)
make_Weka_clusterer(name, class = NULL, init = NULL)
make_Weka_filter(name, class = NULL, init = NULL)
list_Weka_interfaces()
make_Weka_package_loader(p)
参数----------Arguments----------
参数:name
a character string giving the fully qualified name of a Weka learner/filter class in <acronym>JNI</acronym> notation.
一个字符串的完全限定名称的WEKA学习者/过滤器类中<acronym> JNI </首字母缩写>符号。
参数:class
NULL (default), or a character vector giving the names of R classes the objects returned by the interface function should inherit from in addition to the default ones (for representing associators, classifiers, and clusterers).
NULL(默认),或字符向量给R类的接口函数返回的对象应该继承,除了默认(为代表社员,分类,clusterers的的)的名字。
参数:handlers
a named list of special handler functions, see Details.
特殊的处理函数的命名列表,请参阅详细信息。
参数:init
NULL, or a function with no arguments to be called when the interface is used for building the learner/filter, or queried for available options via WOW. Typically, this is used for loading Weka packages when interfacing functionality in these.
NULL,或不带参数的函数时被调用的接口,用于建设学习/过滤器,或通过WOW查询可用的选项。通常情况下,这是用来Weka中包加载在这些接口功能。
参数:p
a character string naming a Weka package to be loaded via WPM.
一个字符串,命名Weka中包加载通过WPM。
Details
详细信息----------Details----------
make_Weka_associator and make_Weka_clusterer create an R function providing an interface to a Weka association learner or a Weka clusterer, respectively. This interface function has formals x and control = NULL, representing the training instances and control options to be employed. Objects created by these interface functions always inherit from classes Weka_associator and Weka_clusterer, respectively, and have at least suitable print methods. Fitted clusterers also have a predict method.
make_Weka_associator和make_Weka_clusterer创建一个R函数提供一个接口,一个Weka中组织学习或Weka中的聚类器。本接口函数的形参x和control = NULL,占被雇用的训练实例和控制选项。这些接口函数创建的对象始终继承类Weka_associator和Weka_clusterer,分别在最不适合print方法。该贴clusterers也有一个predict方法。
make_Weka_classifier creates an interface function for a Weka classifier, with formals formula, data, subset, na.action, and control (default: none), where the first four have the “usual” meanings for statistical modeling functions in R, and the last again specifies the control options to be employed by the Weka learner. Objects created by these interfaces always inherit from class Weka_classifier, and have at least suitable print and predict methods.
make_Weka_classifier的WEKA分类,创建一个接口函数的形参formula,data,subset,na.action和control(默认:无),其中前四有“通常”的含义在R统计建模功能,最后再指定的控制选项被雇用的WEKA学习者。通过这些接口中创建的对象始终继承类Weka_classifier,在最不适合print和predict方法。
make_Weka_filter creates an interface function for a Weka filter, with formals formula, data, subset, na.action, and control = NULL, where the first four have the “usual” meanings for statistical modeling functions in R, and the last again specifies the control options to be employed by the Weka filter. Note that the response variable can be omitted from formula if the filter is “unsupervised”. Objects created by these interface functions are (currently) always of class data.frame.
make_Weka_filter创建一个Weka中过滤器的接口功能,与甲醛formula,data,subset,na.action,和control = NULL,其中的第一四有“通常”的含义,在R统计建模功能,最后再指定的控制选项被雇用的WEKA过滤器。需要注意的是响应变量可以省略formula,如果过滤器是“无监督”。通过这些接口函数中创建的对象(目前)总是的类data.frame。
Certain aspects of the interface function can be customized by providing handlers. Currently, only control handlers (functions given as the control component of the list of handlers) are used for processing the given control arguments before passing them to the Weka classifier. This is used, e.g., by the meta learners to allow the specification of registered base learners by their “base names” (rather their full Weka/Java class names).
可定制的接口功能的某些方面,通过提供的处理程序。目前,只有控制处理程序的(功能control处理程序列表中的组成部分),用于处理给定的控制参数,然后将它们传递给在WEKA分类。这是用于,例如,元学习者允许注册的基本学习他们的“碱基名称”(而不是完整的Weka中/ Java类名)的规范。
In addition to creating interface functions, the interfaces are registered (under the name of the Weka class interfaced), which in particular allows the Weka Option Wizard (WOW) to conveniently give on-line information about available control options for the interfaces.
除了创建界面功能,接口下的WEKA类接口),特别是在WEKA选项向导(WOW),可以方便地给上线的信息可用的控制选项的名称注册(接口。
list_Weka_interfaces lists the available interfaces.
list_Weka_interfaces列出了可用的接口。
Finally, make_Weka_package_loader generates init hooks for loading required and already installed Weka packages.
最后,make_Weka_package_loader初始化的钩子,加载并已安装Weka中包。
It is straightforward to register new interfaces in addition to the ones package RWeka provides by default.
注册新的套件“RWeka默认提供的接口是简单的。
参考文献----------References----------
Open-source machine learning: R meets Weka. Computational Statistics, 24/2, 225–232,
实例----------Examples----------
## Create an interface to Weka's Naive Bayes classifier.[#创建一个WEKA的朴素贝叶斯分类器的接口。]
NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes")
## Note that this has a very useful print method:[#请注意,这有一个非常有用的打印方法:]
NB
## And we can use the Weka Option Wizard for finding out more:[#我们可以使用在Weka中选项向导寻找更多:]
WOW(NB)
## And actually use the interface ...[#实际使用的界面...]
if(require("e1071", quietly = TRUE) &&
require("mlbench", quietly = TRUE)) {
data("HouseVotes84", package = "mlbench")
model <- NB(Class ~ ., data = HouseVotes84)
predict(model, HouseVotes84[1:10, -1])
predict(model, HouseVotes84[1:10, -1], type = "prob")
}
## (Compare this to David Meyer's naiveBayes() in package 'e1071'.)[(与此相比,大卫·梅尔的naiveBayes()“e1071”包)。]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|