|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.uottawa.balie.WekaLearner
public class WekaLearner
Methods to create, train and test a classification algorithm.
| Constructor Summary | |
|---|---|
WekaLearner(weka.core.FastVector attrsMerged,
java.lang.String[] attrlblMerged,
java.lang.String[] classList,
weka.core.Instances trainMerged)
|
|
WekaLearner(WekaAttribute[] pi_Attributes,
java.lang.String[] pi_ClassAttributes)
Creates a new classification algorithm. |
|
| Method Summary | |
|---|---|
void |
AddTestInstance(java.lang.Object[] pi_Instance,
java.lang.String pi_Class)
Adds an instance in the test set. |
void |
AddTrainInstance(java.lang.Object[] pi_Instance,
java.lang.String pi_Class)
Adds an instance in the train set. |
void |
AddUnlabeledTrainInstance(java.lang.Object[] pi_Instance)
|
double |
Classify(java.lang.Object[] pi_Instance)
Classify an unseen instance using the learned classifier. |
double |
Cluster(java.lang.Object[] pi_Instance)
Cluster an unseen instance using the learned clusterizer. |
double[][] |
ConfusionMatrix()
Gets the confusion matrix that plots precision and recall for each class. |
void |
CreateModel(weka.classifiers.Classifier pi_Classifier)
Creates the classification model by learning from the training set. |
void |
CreateModel(weka.clusterers.Clusterer pi_Clusterer)
Creates the cluster model by learning from the training set. |
weka.core.Instance |
CreateUnlabeledInstance(java.lang.Object[] pi_Instance)
|
weka.classifiers.Evaluation |
EstimateConfidence()
Approximate training set error. |
weka.core.FastVector |
GetAttribute()
|
java.lang.String[] |
GetAttributeList()
Gets the list of attributes. |
java.lang.String[] |
GetClassList()
Gets the list of classes. |
weka.core.Instances |
GetClusterCentroid()
|
double[] |
GetDistribution(java.lang.Object[] pi_Instance)
Classify an unseen instance using the learned classifier. |
weka.core.Instances |
GetTestingSet()
Get the training instances |
weka.core.Instances |
GetTrainingSet()
Get the training instances |
int |
GetTrainingSetSize()
Get the number of training instances |
double |
Likelihood(java.lang.Object[] pi_Instance,
int pi_PositiveClassIndex)
Classify an unseen instance using the learned classifier. |
static void |
main(java.lang.String[] args)
Test routine |
void |
SetDoubleOnly(boolean pi_Flag)
|
void |
Shrink()
Reduces the size of a classifier by deleting the corpora. |
java.lang.String |
TestModel()
Test the learned model. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WekaLearner(WekaAttribute[] pi_Attributes,
java.lang.String[] pi_ClassAttributes)
pi_Attributes - Array of attributespi_ClassAttributes - Class attribute
public WekaLearner(weka.core.FastVector attrsMerged,
java.lang.String[] attrlblMerged,
java.lang.String[] classList,
weka.core.Instances trainMerged)
| Method Detail |
|---|
public void AddTrainInstance(java.lang.Object[] pi_Instance,
java.lang.String pi_Class)
pi_Instance - The instance, an array of objects (can mix numeric and nominal attributes - see WekaAttribute)pi_Class - The class of this instanceWekaAttributepublic void AddUnlabeledTrainInstance(java.lang.Object[] pi_Instance)
public void AddTestInstance(java.lang.Object[] pi_Instance,
java.lang.String pi_Class)
pi_Instance - The instance, an array of objects (can mix numeric and nominal attributes - see WekaAttribute)pi_Class - The class of this instanceWekaAttributepublic void SetDoubleOnly(boolean pi_Flag)
public weka.core.Instance CreateUnlabeledInstance(java.lang.Object[] pi_Instance)
public void CreateModel(weka.classifiers.Classifier pi_Classifier)
pi_Classifier - The classification algorithm (from the Weka library, ex.: NaiveBayes, J48, ...)public void CreateModel(weka.clusterers.Clusterer pi_Clusterer)
pi_Clusterer - The clusterization algorithm (from the Weka library, ex.: k-Mean, ...)public weka.classifiers.Evaluation EstimateConfidence()
public java.lang.String TestModel()
public double[][] ConfusionMatrix()
public double Classify(java.lang.Object[] pi_Instance)
pi_Instance - The instance, an array of objects (can mix numeric and nominal attributes - see WekaAttribute)
WekaAttributepublic double Cluster(java.lang.Object[] pi_Instance)
pi_Instance - The instance, an array of objects (can mix numeric and nominal attributes - see WekaAttribute)
WekaAttributepublic double[] GetDistribution(java.lang.Object[] pi_Instance)
pi_Instance - The instance, an array of objects (can mix numeric and nominal attributes - see WekaAttribute)
WekaAttribute
public double Likelihood(java.lang.Object[] pi_Instance,
int pi_PositiveClassIndex)
pi_Instance - The instance, an array of objects (can mix numeric and nominal attributes - see WekaAttribute)pi_PositiveClassIndex - The index of a class
WekaAttributepublic java.lang.String[] GetAttributeList()
public weka.core.FastVector GetAttribute()
public java.lang.String[] GetClassList()
public weka.core.Instances GetTrainingSet()
public weka.core.Instances GetTestingSet()
public int GetTrainingSetSize()
public weka.core.Instances GetClusterCentroid()
public void Shrink()
public static void main(java.lang.String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||