找回密码
 注册
查看: 1234|回复: 0

R语言 rminer包 mmetric()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-27 00:02:23 | 显示全部楼层 |阅读模式
mmetric(rminer)
mmetric()所属R语言包:rminer

                                         Compute classification or regression error metrics.
                                         计算分类或回归误差指标。

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Compute classification or regression error metrics.
计算分类或回归误差指标。


用法----------Usage----------


mmetric(y, x = NULL, metric, D = 0.5, TC = -1, val = NULL)



参数----------Arguments----------

参数:y
if there are predictions (!is.null(x)), y should be a numeric vector or factor with the target desired responses (or output values).<br> Else, y should be a list returned by the  mining function.
如果有预测(!is.null(x))y应该是一个数值向量或与目标所需的响应(或输出值)。<BR>其他因素,y应该是返回一个列表由mining功能。


参数:x
the predictions (should be a numeric vector if task="reg", matrix if task="prob" or factor if task="class" (use if y is not a list).
预测(应该是一个数值向量,如果task="reg",矩阵task="prob"或因素,如果task="class"(使用y如果是不是一个列表)。


参数:metric
a R function or if a character valid options are:  
一个R函数或字符有效的选项有:

AUC &ndash; overall area under the curve (of ROC curve, classification).
AUC - 总面积下的曲线(ROC曲线,分类)。

NAUC &ndash; normalized AUC (given a fixed val=FPR, classification).
NAUC  - 归AUC(给定固定val=FPR分类)。

TPRATFPR &ndash; the TPR (given a fixed val=FPR, classification).
TPRATFPR  -  TPR(给定固定val=FPR分类)。

ALIFT &ndash; area of the accumulative percent of responses captured (LIFT accumulative curve, classification).
ALIFT - 面积的累计%的捕获(LIFT累计曲线,分类)的响应。

NALIFT &ndash; normalized ALIFT (given a fixed val=percentage of examples, classification).
NALIFT - 归一的A抬起(固定val=百分比的例子,分类)。

ALIFTATPERC &ndash; ALIFT value (given a fixed val=percentage of examples, classification).
ALIFTATPERC - 的A抬起价值(固定val=百分比的例子,分类)。

ACC &ndash; overall classification accuracy rate (classification).
ACC  - 整体分类准确率(分类)。

BRIER &ndash; overall Brier score (for probabilistic classification).
BRIER  - 整体的野蔷薇得分的概率分类。

CONF &ndash; confusion matrix (classification).
CONF  - 混淆矩阵(分类)。

TPR &ndash; true positive rate (classification).
TPR - 真阳性率(分类)。

TNR &ndash; true negative rate (classification).
TNR - 真阴性率(分类)。

KAPPA &ndash; kappa index (classification).
KAPPA  -  Kappa指数(分类)。

SAD &ndash; sum absolute error (regression).
SAD - 和绝对误差(回归)。

MAD or MAE &ndash; mean absolute error (regression).
MAD或MAE  - 平均绝对误差(回归)。

MdAE &ndash; median absolute error (regression).
MdAE - 平均绝对误差(回归)。

GMAE or GMAD &ndash; geometric mean absolute error (regression).
GMAE或GMAD  - 几何平均绝对误差(回归)。

RMAD or RAE &ndash; relative absolute error (regression).
RMAD或RAE  - 相对绝对误差(回归)。

SSE &ndash; sum squared error (regression).
SSE  - 平方和错误(回归)。

MSE &ndash; mean squared error (regression).
MSE  - 均方误差(回归)。

RSE &ndash; relative squared error (regression).
RSE  - 相对误差(回归)。

RMSE &ndash; root mean squared error (regression).
“RMSE  - 均方根误差(回归)。

ME &ndash; mean error (regression).
ME  - 平均误差(回归)。

COR &ndash; correlation (regression).
COR  - 相关(回归)。

R2 &ndash; R^2 (regression).
R2 -  R ^ 2(回归)。

NAREC &ndash; normalized REC area (given a fixed val=tolerance, regression).
NAREC - 归REC区域(固定val=宽容,回归)。

TOLERANCE &ndash; the tolerance (y-axis value) of a REC curve (given a fixed val=tolerance, regression).
TOLERANCE  - 公差(Y轴值)拍摄的曲线(固定val=宽容,回归)。

MdAPE &ndash; Mean Absolute Percentage mmetric forecasting metric (regression).
MdAPE  - 平均绝对百分比mmetric预测的度量(回归)。

RMSPE &ndash; Root Mean Square Percentage mmetric forecasting metric (regression).
RMSPE  - 根均方的百分比mmetric预测公制的(回归)。

RMdSPE &ndash; Root Median Square Percentage mmetric forecasting metric (regression).
RMdSPE  - 根中位数广场百分比mmetric预测指标(回归)。

MAPE &ndash;  Mean Absolute Percentage mmetric forecasting metric (regression).
MAPE  - 平均绝对百分比mmetric预测的度量(回归)。

SMAPE &ndash;  Symmetric Mean Absolute Percentage mmetric forecasting metric (regression).
SMAPE  - 对称均值绝对百分比mmetric的预测度量(回归)。

SMdAPE &ndash; Symmetric Median Absolute Percentage mmetric forecasting metric  (regression).


MRAE &ndash; Mean Relative Absolute mmetric forecasting metric (val includes the time series in-samples, or training data, regression).
MRAE - 平均的相对绝对mmetric预测度量(val包括时间序列的样本,培训资料,回归)。

MdRAE &ndash; Median Relative Absolute mmetric forecasting metric (val includes the time series in-samples, or training data, regression).
MdRAE - 中位数的相对绝对mmetric预测:公制(val包括时间序列的样本,培训资料,回归)。

GMRAE &ndash; Geometric Mean Relative Absoluate mmetric forecasting metric  (val includes the time series in-samples, or training data, regression).
GMRAE - 几何平均相对Absoluate mmetric预测度量(val包括时间序列的样本,培训资料,回归)。

THEILSU2 &ndash; Theils'U2 forecasting metric (val includes the time series in-samples, or training data, regression).
THEILSU2 -  TheilsU2预测度量(val包括时间序列的样本,培训资料,回归)。

MASE &ndash; MASE forecasting metric  (val includes the time series in-samples, or training data, regression).
MASE  -  MASE预测公吨(val包括时间序列的样本,培训资料,回归)。


参数:D
decision threshold (for task="prob", probabilistic classification) within [0,1]. The class is TRUE if prob>D.
决策阈值(task="prob",概率分类)在[0,1]。类是真实的,如果概率> D。


参数:TC
target class (for multi-class classification class) within 1,...,Nc, where Nc is the number of classes. Notes: if TC==-1 (the default value), then it is assumed:  
目标多类分类的类内类1,...,NC,NC的班级数目。注:如果TC==-1(默认值),然后是假设:

if metric is "AUC", "ACC", "CONF", "KAPPA" or "BRIER" &ndash; the global metric (for all classes) is computed.
如果metric是“AUC”,“ACC”,“CONF”,“KAPPA”,“野蔷薇” - 全球度量(类)计算。

if metric is "ALIFTATPERC", "NALIFT", "LIFT", "NAUC", "TPRATFPR", "TPR" or "TNR" &ndash; TC is set to the index of the last class.
如果metric是“ALIFTATPERC的”,“LIFT”的“NALIFT”,中,“NAUC”中,“TPRATFPR”,“TPR”或“TNR” - TC·被设置为索引的最后一个类。


参数:val
auxiliary value, check the metric argument for details.
辅助值,检查metric参数的详细信息。


Details

详细信息----------Details----------

Compute classification or regression error metrics:  
计算分类或回归误差指标:

mmetric &ndash; compute one error metric given y and x or given a mining list.
mmetric  - 计算一个误差度量y和x或给出了采矿列表。

metrics &ndash; computes several classification or regression metrics. Additional arguments are:  
metrics - 计算几个分类或回归指标。其他参数是:

AUC &ndash; if TRUE compute the AUC metrics.
AUC - 如果为true计算的AUC的指标。

BRIER &ndash; if TRUE compute the Brier score.
BRIER - 如果为true计算的蒺藜得分。

task &ndash;see fit.
task,看到fit。

In metrics, tauc is the global AUC and acc class is the each class accuracy.<br> The metrics usage is: metrics(y, x, D = 0.5, TC = -1, AUC = TRUE, BRIER = FALSE, Run=1, task = "default")<br> where:  
在metrics,tauc是全球AUC和acc class是每级的精度。参考metrics的用法是:metrics(y, x, D = 0.5, TC = -1, AUC = TRUE, BRIER = FALSE, Run=1, task = "default")<BR>其中:

Run &ndash; is the Run of mining execution if y is a mining object.
Run - “运行”采矿执行y是一个挖掘对象。

if AUC=TRUE or BRIER=TRUE then AUC/BRIER statistics are also computed.
如果AUC=TRUE或BRIER=TRUE那么AUC /野蔷薇统计的也计算。

</ul>
</ ul>


值----------Value----------

Returns the computed error metric(s).
返回的计算误差度量(S)。


注意----------Note----------

See also http://www3.dsi.uminho.pt/pcortez/rminer.html
也http://www3.dsi.uminho.pt/pcortez/rminer.html


(作者)----------Author(s)----------



Paulo Cortez <a href="http://www3.dsi.uminho.pt/pcortez">http://www3.dsi.uminho.pt/pcortez</a>




参考文献----------References----------


To check for more details about rminer and for citation purposes:<br> P. Cortez.<br> Data Mining with Neural Networks and Support Vector Machines Using the R/rminer Tool.<br> In P. Perner (Ed.), Advances in Data Mining - Applications and Theoretical Aspects 10th Industrial Conference on Data Mining (ICDM 2010), Lecture Notes in Artificial Intelligence 6171, pp. 572-583, Berlin, Germany, July, 2010. Springer. ISBN: 978-3-642-14399-1.<br> @Springer: http://www.springerlink.com/content/e7u36014r04h0334<br> http://www3.dsi.uminho.pt/pcortez/2010-rminer.pdf<br>

About the Brier and Global AUC scores:<br> A. Silva, P. Cortez, M.F. Santos, L. Gomes and J. Neves.<br> Rating Organ Failure via Adverse Events using Data Mining in the Intensive Care Unit.<br> In Artificial Intelligence in Medicine, Elsevier, 43 (3): 179-193, 2008.<br> http://dx.doi.org/10.1016/j.artmed.2008.03.010<br>

About the classification and regression metrics:<br> I. Witten and E. Frank.<br> Data Mining: Practical machine learning tools and techniques.<br> Morgan Kaufmann, 2005.

About the forecasting metrics:<br> R. Hyndman and A. Koehler<br> Another look at measures of forecast accuracy.<br> In International Journal of Forecasting, 22(4):679-688, 2006.<br> </ul>

参见----------See Also----------

fit, predict.fit, mining, mgraph, savemining and Importance.
fit,predict.fit,mining,mgraph,savemining和Importance。


实例----------Examples----------


### regression[##回归]
y=c(1:94,95.01,96.1,97.2,97.8,99.3,99.7);x=rnorm(100,5,0.3)+y
print(mmetric(y,x,"MAE"))
print(mmetric(y,x,"RMSE"))
print(mmetric(y,x,"TOLERANCE",val=5))
print(mmetric(y[95:100],x[95:100],"THEILSU2",val=y[1:94])) # b = in-samples[B =样本]
print(mmetric(y[95:100],x[95:100],"MASE",val=y[1:94])) # b = in-samples[B =样本]
print(metrics(y,x)) # several regression metrics[数回归指标]
# user defined error function example:[用户定义的误差函数的例子:]
# myerror = number of samples with absolute error above 10% of y: [myerror =与y的绝对误差在10%以上的样本数:]
myerror=function(y,x){return (sum(abs(y-x)>(0.1*y)))}
print(mmetric(y,x,metric=myerror))

### binary classification [##二进制分类]
y=factor(c("a","a","b","b"))
x=factor(c("a","b","b","b"))
print(mmetric(y,x,"CONF"))
print(mmetric(y,x,"ACC"))
print(metrics(y,x))
px=matrix(nrow=4,ncol=2)
px[1,]=c(0.7,0.3)
px[2,]=c(0.4,0.6)
px[3,]=c(0.7,0.3)
px[4,]=c(0.3,0.7)
print(px)
print(mmetric(y,px,"CONF"))
print(mmetric(y,px,"ACC"))
print(mmetric(y,px,"CONF",D=0.7,TC=2))
print(metrics(y,px,D=0.7,TC=2))
px2=px[,2]
print(px2)
print(mmetric(y,px,"CONF"))
print(mmetric(y,px2,"CONF",D=0.7,TC=2))
print(mmetric(y,px,"AUC"))
print(mmetric(y,px2,"AUC"))
print(mmetric(y,px2,"AUC",TC=2))

### multi-class classification [##多类分类]
data(iris)
M=mining(Species~.,iris,model="dt",Runs=2)
print(mmetric(M,metric="ACC",TC=2,D=0.7))
print(mmetric(M,metric="CONF",TC=2,D=0.7))
print(mmetric(M,metric="AUC",TC=3))
print(mmetric(M,metric="AUC",TC=1))
print(mmetric(M,metric="TPR",TC=1))
print(mmetric(M,metric="TPRATFPR",TC=3,val=0.05))
print(mmetric(M,metric="NAUC",TC=3,val=0.05))
print(mmetric(M,metric="ALIFT",TC=3))
print(mmetric(M,metric="ALIFTATPERC",TC=3,val=0.1))
print(mmetric(M,metric="NALIFT",TC=3,val=0.1))
print(metrics(M,BRIER=TRUE,Run=1)) # several Run 1 classification metrics[几个运行1分类指标]
print(metrics(M,BRIER=TRUE,Run=1,TC=3)) # several Run 1 TC=3 classification metrics[几个运行1 TC = 3类指标]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-24 04:41 , Processed in 0.027175 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表