Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
A collection of multi-instance learning classifiers. Includes the Citation KNN method, several variants of the diverse density method, support vector machines for multi-instance learning, simple wrappers for applying standard propositional learners to multi-instance data, decision tree and rule learners, and some other methods.
/*
* 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 3 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, see .
*/
/*
* SimpleMI.java
* Copyright (C) 2005 University of Waikato, Hamilton, New Zealand
*/
package weka.classifiers.mi;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Vector;
import weka.classifiers.SingleClassifierEnhancer;
import weka.core.Attribute;
import weka.core.Capabilities;
import weka.core.Capabilities.Capability;
import weka.core.DenseInstance;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.MultiInstanceCapabilitiesHandler;
import weka.core.Option;
import weka.core.OptionHandler;
import weka.core.RevisionUtils;
import weka.core.SelectedTag;
import weka.core.Tag;
import weka.core.Utils;
/**
* Reduces MI data into mono-instance data.
*
*
*
* Valid options are:
*
*
*
* -M [1|2|3]
* The method used in transformation:
* 1.arithmatic average; 2.geometric centor;
* 3.using minimax combined features of a bag (default: 1)
*
* Method 3:
* Define s to be the vector of the coordinate-wise maxima
* and minima of X, ie.,
* s(X)=(minx1, ..., minxm, maxx1, ...,maxxm), transform
* the exemplars into mono-instance which contains attributes
* s(X)
*
*
*
* -D
* If set, classifier is run in debug mode and
* may output additional info to the console
*
*
*
* -W
* Full name of base classifier.
* (default: weka.classifiers.rules.ZeroR)
*
*
*
* Options specific to classifier weka.classifiers.rules.ZeroR:
*
*
*
* -D
* If set, classifier is run in debug mode and
* may output additional info to the console
*
*
*
*
* @author Eibe Frank ([email protected])
* @author Xin Xu ([email protected])
* @author Lin Dong ([email protected])
* @version $Revision: 10369 $
*/
public class SimpleMI extends SingleClassifierEnhancer implements
OptionHandler, MultiInstanceCapabilitiesHandler {
/** for serialization */
static final long serialVersionUID = 9137795893666592662L;
/** arithmetic average */
public static final int TRANSFORMMETHOD_ARITHMETIC = 1;
/** geometric average */
public static final int TRANSFORMMETHOD_GEOMETRIC = 2;
/** using minimax combined features of a bag */
public static final int TRANSFORMMETHOD_MINIMAX = 3;
/** the transformation methods */
public static final Tag[] TAGS_TRANSFORMMETHOD = {
new Tag(TRANSFORMMETHOD_ARITHMETIC, "arithmetic average"),
new Tag(TRANSFORMMETHOD_GEOMETRIC, "geometric average"),
new Tag(TRANSFORMMETHOD_MINIMAX, "using minimax combined features of a bag") };
/** the method used in transformation */
protected int m_TransformMethod = TRANSFORMMETHOD_ARITHMETIC;
/**
* Returns a string describing this filter
*
* @return a description of the filter suitable for displaying in the
* explorer/experimenter gui
*/
public String globalInfo() {
return "Reduces MI data into mono-instance data.";
}
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration