本文整理汇总了Java中weka.classifiers.functions.SMOreg类的典型用法代码示例。如果您正苦于以下问题:Java SMOreg类的具体用法?Java SMOreg怎么用?Java SMOreg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMOreg类属于weka.classifiers.functions包,在下文中一共展示了SMOreg类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setupCV
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
public static ParameterSpace setupCV()
{
// configure training data reader dimension
Map<String, Object> dimReaderTrain = new HashMap<String, Object>();
dimReaderTrain.put(Constants.DIM_READER_TRAIN, STSReader.class);
dimReaderTrain.put(Constants.DIM_READER_TRAIN_PARAMS,
Arrays.asList(new Object[] {
STSReader.PARAM_INPUT_FILES, inputFilesTrain,
STSReader.PARAM_GOLD_FILES, goldFilesTrain
}));
@SuppressWarnings("unchecked")
Dimension<List<String>> dimClassificationArgs = Dimension.create(
Constants.DIM_CLASSIFICATION_ARGS,
Arrays.asList(new String[] {
// which classifiers should be tested
SMOreg.class.getName()
}));
@SuppressWarnings("unchecked")
Dimension<List<String>> dimFeatureSets = Dimension.create(
Constants.DIM_FEATURE_SET,
Arrays.asList(new String[] {
// which feature extractors should be used
NrOfTokensFeatureExtractor.class.getName(),
GreedyStringTilingFeatureExtractor.class.getName()
}));
@SuppressWarnings("unchecked")
ParameterSpace pSpace = new ParameterSpace(
Dimension.createBundle("readerTrain",dimReaderTrain),
Dimension.create(Constants.DIM_MULTI_LABEL, false),
Dimension.create(Constants.DIM_IS_REGRESSION, true),
Dimension.create(Constants.DIM_DATA_WRITER, WekaDataWriter.class.getName()),
dimFeatureSets,
dimClassificationArgs
);
return pSpace;
}
开发者ID:zesch,项目名称:semeval,代码行数:40,代码来源:RunExperimentDKproTC.java
示例2: setup
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
public static ParameterSpace setup()
{
// configure training data reader dimension
Map<String, Object> dimReaderTrain = new HashMap<String, Object>();
dimReaderTrain.put(Constants.DIM_READER_TRAIN, STSReader.class);
dimReaderTrain.put(Constants.DIM_READER_TRAIN_PARAMS,
Arrays.asList(new Object[] {
STSReader.PARAM_INPUT_FILES, inputFiles,
STSReader.PARAM_GOLD_FILES, goldFiles
}));
@SuppressWarnings("unchecked")
Dimension<List<String>> dimClassificationArgs = Dimension.create(
Constants.DIM_CLASSIFICATION_ARGS,
Arrays.asList(new String[] {
// which classifiers should be tested
SMOreg.class.getName()
}));
@SuppressWarnings("unchecked")
Dimension<List<String>> dimFeatureSets = Dimension.create(
Constants.DIM_FEATURE_SET,
Arrays.asList(new String[] {
// which feature extractors should be used
NrOfTokensFeatureExtractor.class.getName(),
GreedyStringTilingFeatureExtractor.class.getName()
}));
@SuppressWarnings("unchecked")
ParameterSpace pSpace = new ParameterSpace(
Dimension.createBundle("readerTrain",dimReaderTrain),
Dimension.create(Constants.DIM_MULTI_LABEL, false),
Dimension.create(Constants.DIM_IS_REGRESSION, true),
Dimension.create(Constants.DIM_DATA_WRITER, WekaDataWriter.class.getName()),
dimFeatureSets,
dimClassificationArgs
);
return pSpace;
}
开发者ID:zesch,项目名称:semeval,代码行数:40,代码来源:RunExperimentDKproTC.java
示例3: toString
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
/**
* Prints out the classifier.
*
* @return a description of the classifier as a string
*/
@Override
public String toString() {
StringBuffer text = new StringBuffer();
text.append("SMOreg\n\n");
if (m_weights != null) {
text.append("weights (not support vectors):\n");
// it's a linear machine
for (int i = 0; i < m_data.numAttributes(); i++) {
if (i != m_classIndex) {
text.append((m_weights[i] >= 0 ? " + " : " - ")
+ Utils.doubleToString(Math.abs(m_weights[i]), 12, 4) + " * ");
if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_STANDARDIZE) {
text.append("(standardized) ");
} else if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_NORMALIZE) {
text.append("(normalized) ");
}
text.append(m_data.attribute(i).name() + "\n");
}
}
} else {
// non linear, print out all supportvectors
text.append("Support vectors:\n");
for (int i = 0; i < m_nInstances; i++) {
if (m_alpha[i] > 0) {
text.append("+" + m_alpha[i] + " * k[" + i + "]\n");
}
if (m_alphaStar[i] > 0) {
text.append("-" + m_alphaStar[i] + " * k[" + i + "]\n");
}
}
}
text.append((m_b <= 0 ? " + " : " - ")
+ Utils.doubleToString(Math.abs(m_b), 12, 4) + "\n\n");
text.append("\n\nNumber of kernel evaluations: " + m_nEvals);
if (m_nCacheHits >= 0 && m_nEvals > 0) {
double hitRatio = 1 - m_nEvals * 1.0 / (m_nCacheHits + m_nEvals);
text.append(" (" + Utils.doubleToString(hitRatio * 100, 7, 3).trim()
+ "% cached)");
}
return text.toString();
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:50,代码来源:RegOptimizer.java
示例4: toString
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
/**
* Prints out the classifier.
*
* @return a description of the classifier as a string
*/
public String toString() {
StringBuffer text = new StringBuffer();
text.append("SMOreg\n\n");
if (m_weights != null) {
text.append("weights (not support vectors):\n");
// it's a linear machine
for (int i = 0; i < m_data.numAttributes(); i++) {
if (i != m_classIndex) {
text.append((m_weights[i] >= 0 ? " + " : " - ") + Utils.doubleToString(Math.abs(m_weights[i]), 12, 4) + " * ");
if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_STANDARDIZE) {
text.append("(standardized) ");
} else if (m_SVM.getFilterType().getSelectedTag().getID() == SMOreg.FILTER_NORMALIZE) {
text.append("(normalized) ");
}
text.append(m_data.attribute(i).name() + "\n");
}
}
} else {
// non linear, print out all supportvectors
text.append("Support vectors:\n");
for (int i = 0; i < m_nInstances; i++) {
if (m_alpha[i] > 0) {
text.append("+" + m_alpha[i] + " * k[" + i + "]\n");
}
if (m_alphaStar[i] > 0) {
text.append("-" + m_alphaStar[i] + " * k[" + i + "]\n");
}
}
}
text.append((m_b<=0?" + ":" - ") + Utils.doubleToString(Math.abs(m_b), 12, 4) + "\n\n");
text.append("\n\nNumber of kernel evaluations: " + m_nEvals);
if (m_nCacheHits >= 0 && m_nEvals > 0) {
double hitRatio = 1 - m_nEvals * 1.0 / (m_nCacheHits + m_nEvals);
text.append(" (" + Utils.doubleToString(hitRatio * 100, 7, 3).trim() + "% cached)");
}
return text.toString();
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:46,代码来源:RegOptimizer.java
示例5: setup
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
public static ParameterSpace setup()
{
// configure training data reader dimension
Map<String, Object> dimReaders = new HashMap<String, Object>();
dimReaders.put(Constants.DIM_READER_TRAIN, STSReader.class);
dimReaders.put(Constants.DIM_READER_TRAIN_PARAMS,
Arrays.asList(new Object[] {
STSReader.PARAM_INPUT_FILES, inputFilesTrain,
STSReader.PARAM_GOLD_FILES, goldFilesTrain
}));
dimReaders.put(Constants.DIM_READER_TEST, STSReader.class);
dimReaders.put(Constants.DIM_READER_TEST_PARAMS,
Arrays.asList(new Object[] {
STSReader.PARAM_INPUT_FILES, inputFilesTest,
STSReader.PARAM_GOLD_FILES, goldFilesTest
}));
@SuppressWarnings("unchecked")
Dimension<List<String>> dimClassificationArgs = Dimension.create(
Constants.DIM_CLASSIFICATION_ARGS,
Arrays.asList(new String[] {
// which classifiers should be tested
SMOreg.class.getName()
}));
@SuppressWarnings("unchecked")
Dimension<List<String>> dimFeatureSets = Dimension.create(
Constants.DIM_FEATURE_SET,
Arrays.asList(new String[] {
// which feature extractors should be used
NrOfTokensFeatureExtractor.class.getName(),
GreedyStringTilingFeatureExtractor.class.getName()
}));
@SuppressWarnings("unchecked")
ParameterSpace pSpace = new ParameterSpace(
Dimension.createBundle("readerTrain",dimReaders),
Dimension.create(Constants.DIM_MULTI_LABEL, false),
Dimension.create(Constants.DIM_IS_REGRESSION, true),
Dimension.create(Constants.DIM_DATA_WRITER, WekaDataWriter.class.getName()),
dimFeatureSets,
dimClassificationArgs
);
return pSpace;
}
开发者ID:zesch,项目名称:semeval,代码行数:46,代码来源:RunExperimentDKproTC.java
示例6: setSMOReg
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
/**
* sets the parent SVM
*
* @param value the parent SVM
*/
public void setSMOReg(SMOreg value) {
m_SVM = value;
}
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:9,代码来源:RegOptimizer.java
示例7: setSMOReg
import weka.classifiers.functions.SMOreg; //导入依赖的package包/类
/**
* sets the parent SVM
*
* @param value the parent SVM
*/
public void setSMOReg(SMOreg value) {
m_SVM = value;
}
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:9,代码来源:RegOptimizer.java
注:本文中的weka.classifiers.functions.SMOreg类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论