// Path: sequence-miner/src/main/java/sequencemining/sequence/Sequence.java
// public class Sequence extends AbstractSequence implements Serializable {
// 	private static final long serialVersionUID = -2766830126344921771L;
// 
// 	/**
// 	 * Constructor
// 	 */
// 	public Sequence() {
// 		this.items = new ArrayList<>();
// 	}
// 
// 	/**
// 	 * Shallow Copy Constructor
// 	 *
// 	 * @param seq
// 	 *            sequence to shallow copy
// 	 */
// 	public Sequence(final Sequence seq) {
// 		this.items = seq.items;
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            a list of items that should be added to the new sequence
// 	 */
// 	public Sequence(final List<Integer> items) {
// 		this.items = new ArrayList<>(items);
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            an array of items that should be added to the new sequence
// 	 */
// 	public Sequence(final Integer... items) {
// 		this.items = new ArrayList<>(Arrays.asList(items));
// 	}
// 
// 	/**
// 	 * Join Constructor
// 	 *
// 	 * @param seqs
// 	 *            two sequences that should be joined
// 	 */
// 	public Sequence(final Sequence seq1, final Sequence seq2) {
// 		this.items = new ArrayList<>(seq1.items);
// 		this.items.addAll(seq2.items);
// 	}
// 
// }


import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.SortedMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import com.google.common.base.Functions;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Ordering;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.AlgoBIDEPlus;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.AlgoPrefixSpan;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.SequentialPattern;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.SequentialPatterns;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.AlgoSPADE;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.AlgoSPAM_AGP;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.candidatePatternsGeneration.CandidateGenerator;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.candidatePatternsGeneration.CandidateGenerator_Qualitative;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.dataStructures.creators.AbstractionCreator;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.dataStructures.creators.AbstractionCreator_Qualitative;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.idLists.creators.IdListCreator_FatBitmap;
import ca.pfv.spmf.input.sequence_database_list_integers.SequenceDatabase;
import ca.pfv.spmf.patterns.itemset_list_integers_without_support.Itemset;
import sequencemining.sequence.Sequence;
package sequencemining.eval;





public class FrequentSequenceMining {

	public static void main(final String[] args) throws IOException {

		// Datasets and parameters
		final String[] datasets = { "alice_punc", "GAZELLE1", "jmlr", "SIGN", "auslan2", "pioneer", "aslbu", "skating",
				"aslgt", "context" };
		final double[] minSupps = new double[] { 0.02, 0.004, 0.15, 0.45, 0.0001, 0.1, 0.04, 0.43, 0.25, 0.49 };

		for (int i = 0; i < datasets.length; i++) {
			final String dbPath = "/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/Datasets/Paper/" + datasets[i]
					+ ".dat";
			final String saveFile = "/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/BIDE/" + datasets[i] + ".txt";
			mineClosedFrequentSequencesBIDE(dbPath, saveFile, minSupps[i]);
		}
	}

	/** Run PrefixSpan algorithm */
// Path: sequence-miner/src/main/java/sequencemining/sequence/Sequence.java
// public class Sequence extends AbstractSequence implements Serializable {
// 	private static final long serialVersionUID = -2766830126344921771L;
// 
// 	/**
// 	 * Constructor
// 	 */
// 	public Sequence() {
// 		this.items = new ArrayList<>();
// 	}
// 
// 	/**
// 	 * Shallow Copy Constructor
// 	 *
// 	 * @param seq
// 	 *            sequence to shallow copy
// 	 */
// 	public Sequence(final Sequence seq) {
// 		this.items = seq.items;
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            a list of items that should be added to the new sequence
// 	 */
// 	public Sequence(final List<Integer> items) {
// 		this.items = new ArrayList<>(items);
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            an array of items that should be added to the new sequence
// 	 */
// 	public Sequence(final Integer... items) {
// 		this.items = new ArrayList<>(Arrays.asList(items));
// 	}
// 
// 	/**
// 	 * Join Constructor
// 	 *
// 	 * @param seqs
// 	 *            two sequences that should be joined
// 	 */
// 	public Sequence(final Sequence seq1, final Sequence seq2) {
// 		this.items = new ArrayList<>(seq1.items);
// 		this.items.addAll(seq2.items);
// 	}
// 
// }


// Path: sequence-miner/src/main/java/sequencemining/eval/FrequentSequenceMining.java
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.SortedMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import com.google.common.base.Functions;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Ordering;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.AlgoBIDEPlus;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.AlgoPrefixSpan;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.SequentialPattern;
import ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan.SequentialPatterns;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.AlgoSPADE;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.AlgoSPAM_AGP;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.candidatePatternsGeneration.CandidateGenerator;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.candidatePatternsGeneration.CandidateGenerator_Qualitative;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.dataStructures.creators.AbstractionCreator;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.dataStructures.creators.AbstractionCreator_Qualitative;
import ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.idLists.creators.IdListCreator_FatBitmap;
import ca.pfv.spmf.input.sequence_database_list_integers.SequenceDatabase;
import ca.pfv.spmf.patterns.itemset_list_integers_without_support.Itemset;
import sequencemining.sequence.Sequence;

package sequencemining.eval;





public class FrequentSequenceMining {

	public static void main(final String[] args) throws IOException {

		// Datasets and parameters
		final String[] datasets = { "alice_punc", "GAZELLE1", "jmlr", "SIGN", "auslan2", "pioneer", "aslbu", "skating",
				"aslgt", "context" };
		final double[] minSupps = new double[] { 0.02, 0.004, 0.15, 0.45, 0.0001, 0.1, 0.04, 0.43, 0.25, 0.49 };

		for (int i = 0; i < datasets.length; i++) {
			final String dbPath = "/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/Datasets/Paper/" + datasets[i]
					+ ".dat";
			final String saveFile = "/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/BIDE/" + datasets[i] + ".txt";
			mineClosedFrequentSequencesBIDE(dbPath, saveFile, minSupps[i]);
		}
	}

	/** Run PrefixSpan algorithm */
	public static SortedMap<Sequence, Integer> mineFrequentSequencesPrefixSpan(final String dataset,