Hello All,
Hope you all have a great Friday. My name is Mark and I am new member of the forum. I am just learning to use Weka and I have a question that I would like to seek your help if you may have known the answer. I am planning to use weka for my Java school project, and I believe that I am using weka-3.7.7 jar file in my project. That's all worked well and I am able to view the output when I am using the apriori package fro my association rule. However, I got stuck when I try to print out each data item from the apriori.getAllTheRules() using FastVector such as FastVector = apriori.getAllTheRules(). I got stuck because the FastVector was deprecated , and I read some comments on google and it said that I could replace it with something called list array without further example or explanation how to pursue it.
But since I am new to Weka and I could not find additional articles on the web mentioning about how to use the list array for apriori.getAllTheRules(). So if you happen to know some articles or programs tutorial mentioning about how to use the list array for that purpose, please refer me to those resources. I am very appreciate for all of your help in advance.
attach is my sample java program using apriori rule
==================================================================
}
===================================================================
Best regards,
Mark
Hope you all have a great Friday. My name is Mark and I am new member of the forum. I am just learning to use Weka and I have a question that I would like to seek your help if you may have known the answer. I am planning to use weka for my Java school project, and I believe that I am using weka-3.7.7 jar file in my project. That's all worked well and I am able to view the output when I am using the apriori package fro my association rule. However, I got stuck when I try to print out each data item from the apriori.getAllTheRules() using FastVector such as FastVector = apriori.getAllTheRules(). I got stuck because the FastVector was deprecated , and I read some comments on google and it said that I could replace it with something called list array without further example or explanation how to pursue it.
But since I am new to Weka and I could not find additional articles on the web mentioning about how to use the list array for apriori.getAllTheRules(). So if you happen to know some articles or programs tutorial mentioning about how to use the list array for that purpose, please refer me to those resources. I am very appreciate for all of your help in advance.
attach is my sample java program using apriori rule
==================================================================
package org.minh;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import weka.associations.Apriori;
import weka.core.Instances;
public class Main
{
public static void main(String[] args)
{
Instances data = null;
try {
BufferedReader reader = new BufferedReader( new
FileReader( "c:\\weka\\CRMArff.arff" ) );
data = new Instances(reader);
reader.close();
data.setClassIndex(data.numAttributes() - 1);
}
catch ( IOException e ) {
e.printStackTrace();
}
double deltaValue = 0.05;
double lowerBoundMinSupportValue = 0.05;
double minMetricValue = 0.5;
int numRulesValue = 100;
double upperBoundMinSupportValue = 1.0;
String resultapriori;
Apriori apriori = new Apriori();
apriori.setDelta(deltaValue);
apriori.setLowerBoundMinSupport(lowerBoundMinSupportValue);
apriori.setNumRules(numRulesValue);
apriori.setUpperBoundMinSupport(upperBoundMinSupportValue);
apriori.setMinMetric(minMetricValue);
try
{
apriori.buildAssociations( data );
}
catch ( Exception e ) {
e.printStackTrace();
}
resultapriori = apriori.toString();
System.out.println(resultapriori);
}
}
===================================================================
Best regards,
Mark