本文整理了Java中weka.core.Instances.checkForStringAttributes()
方法的一些代码示例,展示了Instances.checkForStringAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instances.checkForStringAttributes()
方法的具体详情如下:
包路径:weka.core.Instances
类名称:Instances
方法名:checkForStringAttributes
[英]Checks for string attributes in the dataset
[中]检查数据集中的字符串属性
代码示例来源:origin: com.googlecode.obvious/obviousx-weka
@Override
public boolean checkForStringAttributes() {
return super.checkForStringAttributes();
}
代码示例来源:origin: nz.ac.waikato.cms.weka/distributedWekaBase
@Override
public Instances getOutputFormat() {
Instances outFormat = m_delegate.getOutputFormat();
if (!m_stringsChecked) {
m_hasStringAtts = outFormat.checkForStringAttributes();
m_stringsChecked = true;
}
return outFormat;
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Sets the format of the input instances.
*
* @param instanceInfo an Instances object containing the input instance
* structure (any instances contained in the object are ignored -
* only the structure is required).
* @return true if the outputFormat may be collected immediately
* @throws Exception if the input format can't be set successfully
*/
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
super.setInputFormat(instanceInfo);
m_containsStringAtts = instanceInfo.checkForStringAttributes();
setOutputFormat(instanceInfo);
m_subSample = new Object[m_SampleSize];
m_currentInst = 0;
m_random = new Random(m_RandomSeed);
return true;
}
代码示例来源:origin: Waikato/weka-trunk
/**
* Sets the format of the input instances.
*
* @param instanceInfo an Instances object containing the input instance
* structure (any instances contained in the object are ignored -
* only the structure is required).
* @return true if the outputFormat may be collected immediately
* @throws Exception if the input format can't be set successfully
*/
@Override
public boolean setInputFormat(Instances instanceInfo) throws Exception {
super.setInputFormat(instanceInfo);
m_containsStringAtts = instanceInfo.checkForStringAttributes();
setOutputFormat(instanceInfo);
m_subSample = new Object[m_SampleSize];
m_currentInst = 0;
m_random = new Random(m_RandomSeed);
return true;
}
代码示例来源:origin: Waikato/weka-trunk
/**
* initializes the buffers for sparse instances to be read
*
* @see #m_ValueBuffer
* @see #m_IndicesBuffer
*/
protected void initBuffers() {
m_ValueBuffer = new double[m_Data.numAttributes()];
m_IndicesBuffer = new int[m_Data.numAttributes()];
m_stringAttIndices = new ArrayList<Integer>();
if (m_Data.checkForStringAttributes()) {
for (int i = 0; i < m_Data.numAttributes(); i++) {
if (m_Data.attribute(i).isString()) {
m_stringAttIndices.add(i);
}
}
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* initializes the buffers for sparse instances to be read
*
* @see #m_ValueBuffer
* @see #m_IndicesBuffer
*/
protected void initBuffers() {
m_ValueBuffer = new double[m_Data.numAttributes()];
m_IndicesBuffer = new int[m_Data.numAttributes()];
m_stringAttIndices = new ArrayList<Integer>();
if (m_Data.checkForStringAttributes()) {
for (int i = 0; i < m_Data.numAttributes(); i++) {
if (m_Data.attribute(i).isString()) {
m_stringAttIndices.add(i);
}
}
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@SuppressWarnings("unchecked")
public void setup(Instances inputFormat) throws Exception {
m_inputContainsStringAttributes = inputFormat.checkForStringAttributes();
m_inputFormat = inputFormat.stringFreeStructure();
if (!m_inputContainsStringAttributes) {
return;
}
m_numClasses =
!m_doNotOperateOnPerClassBasis && m_inputFormat.classIndex() >= 0 && m_inputFormat.classAttribute().isNominal() ?
m_inputFormat.numClasses() : 1;
m_dictsPerClass =
m_sortDictionary ? new TreeMap[m_numClasses]
: new LinkedHashMap[m_numClasses];
m_classIndex = m_inputFormat.classIndex();
for (int i = 0; i < m_numClasses; i++) {
m_dictsPerClass[i] =
m_sortDictionary ? new TreeMap<String, int[]>()
: new LinkedHashMap<String, int[]>();
}
determineSelectedRange(inputFormat);
}
代码示例来源:origin: Waikato/weka-trunk
@SuppressWarnings("unchecked")
public void setup(Instances inputFormat) throws Exception {
m_inputContainsStringAttributes = inputFormat.checkForStringAttributes();
m_inputFormat = inputFormat.stringFreeStructure();
if (!m_inputContainsStringAttributes) {
return;
}
m_numClasses =
!m_doNotOperateOnPerClassBasis && m_inputFormat.classIndex() >= 0 && m_inputFormat.classAttribute().isNominal() ?
m_inputFormat.numClasses() : 1;
m_dictsPerClass =
m_sortDictionary ? new TreeMap[m_numClasses]
: new LinkedHashMap[m_numClasses];
m_classIndex = m_inputFormat.classIndex();
for (int i = 0; i < m_numClasses; i++) {
m_dictsPerClass[i] =
m_sortDictionary ? new TreeMap<String, int[]>()
: new LinkedHashMap<String, int[]>();
}
determineSelectedRange(inputFormat);
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (miningSchemaI.checkForStringAttributes()) {
ArrayList<Attribute> attInfo = new ArrayList<Attribute>();
for (int i = 0; i < miningSchemaI.numAttributes(); i++) {
代码示例来源:origin: Waikato/weka-trunk
if (miningSchemaI.checkForStringAttributes()) {
ArrayList<Attribute> attInfo = new ArrayList<Attribute>();
for (int i = 0; i < miningSchemaI.numAttributes(); i++) {
代码示例来源:origin: nz.ac.waikato.cms.weka/distributedWekaBase
m_isUsingStringAttributes = modelHeader.checkForStringAttributes();
m_model = ScoringModel.createScorer(model);
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (data.checkForStringAttributes()) {
throw new Exception("Can't handle string attributes!");
代码示例来源:origin: Waikato/weka-trunk
if (data.checkForStringAttributes()) {
throw new Exception("Can't handle string attributes!");
代码示例来源:origin: Waikato/weka-trunk
if (m_mergedHeader.checkForStringAttributes()) {
m_stringAttsPresent = true;
m_headerPool = new ArrayList<Instances>();
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
m_streamingFilter.setInputFormat(incomingStructure);
m_stringAttsPresent =
m_streamingFilter.getOutputFormat().checkForStringAttributes();
} catch (Exception ex) {
throw new WekaException(ex);
代码示例来源:origin: Waikato/weka-trunk
m_streamingFilter.setInputFormat(incomingStructure);
m_stringAttsPresent =
m_streamingFilter.getOutputFormat().checkForStringAttributes();
} catch (Exception ex) {
throw new WekaException(ex);
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
Instance temp = data.getPrimaryPayload();
m_structure = new Instances(temp.dataset(), 0).stringFreeStructure();
m_hasStringAtts = temp.dataset().checkForStringAttributes();
代码示例来源:origin: Waikato/weka-trunk
Instance temp = data.getPrimaryPayload();
m_structure = new Instances(temp.dataset(), 0).stringFreeStructure();
m_hasStringAtts = temp.dataset().checkForStringAttributes();
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
Instances structureCopy = null;
Instances currentStructure = structure;
boolean containsStrings = toOutput.checkForStringAttributes();
if (containsStrings) {
structureCopy =
代码示例来源:origin: Waikato/weka-trunk
Instances structureCopy = null;
Instances currentStructure = structure;
boolean containsStrings = toOutput.checkForStringAttributes();
if (containsStrings) {
structureCopy =
内容来源于网络,如有侵权,请联系作者删除!