/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* PairedTTester.java
* Copyright (C) 1999 University of Waikato, Hamilton, New Zealand
*
*/
package weka.experiment;
import weka.core.Attribute;
import weka.core.FastVector;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.Option;
import weka.core.OptionHandler;
import weka.core.Range;
import weka.core.RevisionHandler;
import weka.core.RevisionUtils;
import weka.core.Utils;
import java.io.BufferedReader;
import java.io.FileReader;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.Vector;
/**
* Calculates T-Test statistics on data stored in a set of instances. <p/>
*
<!-- options-start -->
* Valid options are: <p/>
*
* <pre> -D <index,index2-index4,...>
* Specify list of columns that specify a unique
* dataset.
* First and last are valid indexes. (default none)</pre>
*
* <pre> -R <index>
* Set the index of the column containing the run number</pre>
*
* <pre> -F <index>
* Set the index of the column containing the fold number</pre>
*
* <pre> -G <index1,index2-index4,...>
* Specify list of columns that specify a unique
* 'result generator' (eg: classifier name and options).
* First and last are valid indexes. (default none)</pre>
*
* <pre> -S <significance level>
* Set the significance level for comparisons (default 0.05)</pre>
*
* <pre> -V
* Show standard deviations</pre>
*
* <pre> -L
* Produce table comparisons in Latex table format</pre>
*
* <pre> -csv
* Produce table comparisons in CSV table format</pre>
*
* <pre> -html
* Produce table comparisons in HTML table format</pre>
*
* <pre> -significance
* Produce table comparisons with only the significance values</pre>
*
* <pre> -gnuplot
* Produce table comparisons output suitable for GNUPlot</pre>
*
<!-- options-end -->
*
* @author Len Trigg (trigg@cs.waikato.ac.nz)
* @version $Revision: 6431 $
*/
public class PairedTTester
implements OptionHandler, Tester, RevisionHandler {
/** for serialization */
static final long serialVersionUID = 8370014624008728610L;
/** The set of instances we will analyse */
protected Instances m_Instances;
/** The index of the column containing the run number */
protected int m_RunColumn = 0;
/** The option setting for the run number column (-1 means last) */
protected int m_RunColumnSet = -1;
/** The option setting for the fold number column (-1 means none) */
protected int m_FoldColumn = -1;
/** The column to sort on (-1 means default sorting) */
protected int m_SortColumn = -1;
/** The sorting of the datasets (according to the sort column) */
protected int[] m_SortOrder = null;
/** The sorting of the columns (test base is always first) */
protected int[] m_ColOrder = null;
/** The significance level for comparisons */
protected double m_SignificanceLevel = 0.05;
/**
* The range of columns that specify a unique "dataset"
* (eg: scheme plus configuration)
*/
protected Range m_DatasetKeyColumnsRange = new Range();
/** An array containing the indexes of just the selected columns */
protected int [] m_DatasetKeyColumns;
/** The list of dataset specifiers */
protected DatasetSpecifiers m_DatasetSpecifiers =
new DatasetSpecifiers();
/**
* The range of columns that specify a unique result set
* (eg: scheme plus configuration)
*/
protected Range m_ResultsetKeyColumnsRange = new Range();
/** An array containing the indexes of just the selected columns */
protected int [] m_ResultsetKeyColumns;
/** An array containing the indexes of the datasets to display */
protected int[] m_DisplayedResultsets = null;
/** Stores a vector for each resultset holding all instances in each set */
protected FastVector m_Resultsets = new FastVector();
/** Indicates whether the instances have been partitioned */
protected boolean m_ResultsetsValid;
/** Indicates whether standard deviations should be displayed */
protected boolean m_ShowStdDevs = false;
/** the instance of the class to produce the output. */
protected ResultMatrix m_ResultMatrix = new ResultMatrixPlainText();
/** A list of unique "dataset" specifiers that have been observed */
protected class DatasetSpecifiers
implements RevisionHandler {
/** the specifiers that have been observed */
FastVector m_Specifiers = new FastVector();
/**
* Removes all specifiers.
*/
protected void removeAllSpecifiers() {
m_Specifiers.removeAllElements();
}
/**
* Add an instance to the list of specifiers (if necessary)
*
* @param inst the instance to add
*/
protected void add(Instance inst) {
for (int i = 0; i < m_Specifiers.size(); i++) {
Instance specifier = (Instance)m_Specifiers.elementAt(i);
boolean found = true;
for (int j = 0; j < m_DatasetKeyColumns.length; j++) {
if (inst.value(m_DatasetKeyColumns[j]) !=
specifier.value(m_DatasetKeyColumns[j])) {
found = false;
}
}
if (found) {
return;
}
}
m_Specifiers.addElement(inst);
}
/**
* Get the template at the given position.
*
* @param i the index
* @return the template
*/
protected Instance specifier(int i) {
return (Instance)m_Specifiers.elementAt(i);
}
/**
* Gets the number of specifiers.
*
* @return the current number of specifiers
*/
protected int numSpecifiers() {
return m_Specifiers.size();
}
/**
* Returns the revision string.
*
* @return the revision
*/
public String getRevision() {
return RevisionUtils.extract("$Revision: 6431 $");
}
}
/** Utility class to store the instances pertaining to a dataset */
protected class Dataset
implements RevisionHandler {
/** the template */
Instance m_Template;
/** the dataset */
FastVector m_Dataset;
/**
* Constructor
*
* @param template the template
*/
public Dataset(Instance template) {
m_Template = template;
m_Dataset = new FastVector();
add(template);
}
/**
* Returns true if the two instances match on those attributes that have
* been designated key columns (eg: scheme name and scheme options)
*
* @param first the first instance
* @return true if first and second match on the currently set key columns
*/
protected boolean matchesTemplate(Instance first) {
for (int i = 0; i < m_DatasetKeyColumns.length; i++) {
if (first.value(m_DatasetKeyColumns[i]) !=
m_Template.value(m_DatasetKeyColumns[i])) {
return false;
}
}
return true;
}
/**
* Adds the given instance to the dataset
*
* @param inst the instance to add
*/
protected void add(Instance inst) {
m_Dataset.addElement(inst);
}
/**
* Returns a vector containing the instances in the dataset
*
* @return the current contents
*/
protected FastVector contents() {
return m_Dataset;
}
/**
* Sorts the instances in the dataset by the run number.
*
没有合适的资源?快使用搜索试试~ 我知道了~
hzl.rar_jxta开发
共52个文件
java:42个
oracle:1个
mssqlserver:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 112 浏览量
2022-09-23
01:42:05
上传
评论
收藏 86KB RAR 举报
温馨提示
jxta平台的开发包,2,4版本,含有源代码,所需要的其他的开发包等
资源推荐
资源详情
资源评论
收起资源包目录
hzl.rar (52个子文件)
DatabaseUtils.java 41KB
ResultMatrixSignificance.java 7KB
RandomSplitResultProducer.java 29KB
RemoteExperimentEvent.java 2KB
DensityBasedClustererSplitEvaluator.java 19KB
RemoteExperiment.java 29KB
DatabaseUtils.props.sqlite3 3KB
Task.java 1KB
InstanceQuery.java 19KB
Stats.java 6KB
ResultMatrixHTML.java 9KB
PairedStats.java 9KB
DatabaseUtils.props.msaccess 4KB
OutputZipper.java 4KB
CSVResultListener.java 10KB
DatabaseUtils.props.postgresql 8KB
ResultListener.java 3KB
ResultMatrixPlainText.java 12KB
CrossValidationResultProducer.java 26KB
Experiment.java 34KB
PropertyNode.java 4KB
DatabaseUtils.props.oracle 3KB
ClassifierSplitEvaluator.java 35KB
PairedTTester.java 43KB
DatabaseUtils.props.mssqlserver 4KB
RemoteEngine.java 12KB
Tester.java 8KB
DatabaseUtils.props.hsql 3KB
DatabaseUtils.props.odbc 2KB
LearningRateResultProducer.java 29KB
RemoteExperimentSubTask.java 4KB
CostSensitiveClassifierSplitEvaluator.java 18KB
TaskStatusInfo.java 3KB
DatabaseUtils.props.mssqlserver2005 4KB
AveragingResultProducer.java 38KB
PairedStatsCorrected.java 3KB
DatabaseResultProducer.java 23KB
DatabaseUtils.props.mysql 4KB
DatabaseResultListener.java 11KB
ResultProducer.java 6KB
ResultMatrixLatex.java 12KB
DatabaseUtils.props 2KB
PairedCorrectedTTester.java 11KB
xml
XMLExperiment.java 11KB
ResultMatrixCSV.java 7KB
RegressionSplitEvaluator.java 23KB
ResultMatrixGnuPlot.java 8KB
SplitEvaluator.java 4KB
RemoteExperimentListener.java 1KB
InstancesResultListener.java 8KB
ResultMatrix.java 40KB
Compute.java 2KB
共 52 条
- 1
资源评论
御道御小黑
- 粉丝: 58
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Qt开发知识、经验总结 包括Qss,数据库,Excel,Model/View等
- IV数据.xlsx
- 一些深度学习中的小例子,适合新手学习使用
- foldcraftlauncher_262944.apk
- 珍藏多年的基于matlab实现潮流计算程序源代码集合,包含多个潮流计算程序.rar
- 使用FPGA实现串-并型乘法器
- 基于matlab实现针对基于双曲线定位的DV-Hop算法中误差误差出一种基于加权双曲线定位的DV-Hop改进算法.rar
- 基于matlab实现由遗传算法开发的整数规划,车辆调度问题.rar
- 电视家7.0(对电视配置要求高).apk
- 免费计算机毕业设计-基于JavaEE的医院病历管理系统设计与实现(包含论文+源码)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功