public class InternetAds {
public static void main(String[] args) throws IOException {
// read in the data.
ArrayList<ClassificationInstance> allData = (new InternetAdReader(
new Alphabet(), new Alphabet())).readFile(args[0]);
StaticUtils.shuffle(allData, 0);
// randomly split data into training and testing part
ArrayList<ClassificationInstance>[] tmp = StaticUtils.split(allData,
200);
ArrayList<ClassificationInstance> train = tmp[0];
ArrayList<ClassificationInstance> test = tmp[1];
Alphabet xA = allData.get(0).xAlphabet;
Alphabet yA = allData.get(0).yAlphabet;
System.out.println("num Features = " + allData.get(0).xAlphabet.size());
LinearClassifier h;
h = trainAdaBoost(50, train, xA, yA);
System.out.println("Boost Train Accuracy = "
+ StaticUtils.computeAccuracy(h, train));