weka的java环境配置_在Java中使用weka:options参数设置

本文介绍如何在Java环境中配置并使用Weka进行数据处理。通过设置`options`数组,例如指定训练文件和测试文件路径,可以调用`Evaluation.evaluateModel`方法进行模型评估。关键选项包括:`-t`指定训练文件,`-T`指定测试文件,以及`-c`设置类别属性等。此外,还可以设置交叉验证次数、随机种子和成本矩阵等参数。
摘要由CSDN通过智能技术生成

比如:

String []options=new String[4];

options[0]="-t";

options[1]="E:\\Program Files\\Weka-3-6\\data\\segment-challenge.arff";

options[2]="-T";

options[3]="E:\\Program Files\\Weka-3-6\\data\\segment-test.arff";

System.out.println(Evaluation.evaluateModel(new ZeroR(), options));

General options: -h or -help Output help information. -synopsis or -info Output synopsis for classifier (use in conjunction  with -h) -t Sets training file. -T Sets test file. If missing, a cross-validation will be performed on the training data. -c Sets index of class attribute (default: last). -x Sets number of folds for cross-validation (default: 10). -no-cv Do not perform any cross validation. -split-percentage Sets the percentage for the train/test set split, e.g., 66. -preserve-order Preserves the order in the percentage split. -s Sets random number seed for cross-validation or percentage split (default: 1). -m Sets file with cost matrix. -l Sets model input file. In case the filename ends with '.xml', a PMML file is loaded or, if that fails, options are loaded from the XML file. -d Sets model output file. In case the filename ends with '.xml', only the options are saved to the XML file, not the model. -v Outputs no statistics for training data. -o Outputs statistics only, not the classifier. -i Outputs detailed information-retrieval statistics for each class. -k Outputs information-theoretic statistics. -p Only outputs predictions for test instances (or the train instances if no test instances provided and -no-cv is used), along with attributes (0 for none). -distribution Outputs the distribution instead of only the prediction in conjunction with the '-p' option (only nominal classes). -r Only outputs cumulative margin distribution. -xml filename | xml-string Retrieves the options from the XML-data instead of the command line. -threshold-file The file to save the threshold data to. The format is determined by the extensions, e.g., '.arff' for ARFF  format or '.csv' for CSV. -threshold-label The class label to determine the threshold data for (default is the first label)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值