<commit_before>package de.lmu.ifi.dbs.wrapper;

import de.lmu.ifi.dbs.algorithm.Algorithm;
import de.lmu.ifi.dbs.algorithm.DBSCAN;
import de.lmu.ifi.dbs.algorithm.result.Result;
import de.lmu.ifi.dbs.data.DoubleVector;
import de.lmu.ifi.dbs.data.FeatureVector;
import de.lmu.ifi.dbs.database.Database;
import de.lmu.ifi.dbs.database.RTreeDatabase;
import de.lmu.ifi.dbs.database.SpatialIndexDatabase;
import de.lmu.ifi.dbs.distance.EuklideanDistanceFunction;
import de.lmu.ifi.dbs.parser.Parser;
import de.lmu.ifi.dbs.parser.StandardLabelParser;
import de.lmu.ifi.dbs.utilities.QueryResult;
import de.lmu.ifi.dbs.utilities.UnableToComplyException;
import de.lmu.ifi.dbs.utilities.Util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * 
 */
public class Test
{
    public static void main(String[] args)
    {
        try
        {
            // testCorrDist();
            testRTree();
        }
        catch(FileNotFoundException e)
        {
            e.printStackTrace();
        }
    }

    private static void testRTree() throws FileNotFoundException
    {
        try
        {
            Date start = new Date();
            // File file1 = new File("test.txt");
            // File file1 = new File("10_T_2.ascii");
            File file1 = new File("timeseries.txt");
            InputStream in1 = new FileInputStream(file1);
            Parser parser1 = new StandardLabelParser();
            String[] param1 = { "-database", "de.lmu.ifi.dbs.database.RTreeDatabase"
            // ,"-" + RTreeDatabase.FILE_NAME_P, "elki.idx"
                    // ,"-" + RTreeDatabase.FLAT_DIRECTORY_F
                    , "-" + SpatialIndexDatabase.BULK_LOAD_F, "-" + RTreeDatabase.CACHE_SIZE_P, "50000000", "-" + RTreeDatabase.PAGE_SIZE_P, "16000" };

            parser1.setParameters(param1);
            Database<FeatureVector> db1 = parser1.parse(in1);
            System.out.println(db1);

            long ms = new Date().getTime() - start.getTime();
            System.out.println("Total " + Util.format(ms / 1000.0) + " s");

            // File file2 = new File("test.txt");
            // File file2 = new File("10_T_2.ascii");
            File file2 = new File("timeseries.txt");
            InputStream in2 = new FileInputStream(file2);
            Parser parser2 = new StandardLabelParser();
            String[] param2 = { "-database", "de.lmu.ifi.dbs.database.RTreeDatabase"
            // ,"-" + RTreeDatabase.FILE_NAME_P, "elki.idx"
                    // ,"-" + RTreeDatabase.FLAT_DIRECTORY_F
                    // ,"-" + SpatialIndexDatabase.BULK_LOAD_F
                    , "-" + RTreeDatabase.CACHE_SIZE_P, "50000000", "-" + RTreeDatabase.PAGE_SIZE_P, "16000" };

            start = new Date();
            parser2.setParameters(param2);
            Database<FeatureVector> db2 = parser2.parse(in2);
            System.out.println(db2);
            ms = new Date().getTime() - start.getTime();
            System.out.println("Total " + Util.format(ms / 1000.0) + " s");

            EuklideanDistanceFunction distFunction = new EuklideanDistanceFunction();
            List<QueryResult> r1 = db1.kNNQuery(300, 10, distFunction);
            System.out.println("r1 " + r1);

            List<QueryResult> r2 = db2.kNNQuery(300, 10, distFunction);
            System.out.println("r2 " + r2);

            // for (int i = 0; i < 450; i++) {
            // MetricalObject o = db1.get(new Integer(Integer.MIN_VALUE + i));
            // db1.delete(o);
            // System.out.println(db1);
            // }
        }
        catch(IOException e)
        {
            e.printStackTrace(); // To change body of catch statement use
                                    // File | Settings | File Templates.
        }

    }

    private static void testCorrDist() throws FileNotFoundException, UnableToComplyException
    {
        File file = new File("test.txt");
        // File file = new File("10_T_2.ascii");
        InputStream in = new FileInputStream(file);
        Parser parser = new StandardLabelParser();
        String[] param = { "-database", "de.lmu.ifi.dbs.database.SequentialDatabase", "-epsilon", "2x1000", "-minpts", "10", "-distancefunction", "de.lmu.ifi.dbs.distance.CorrelationDistanceFunction", "-verbose" };
        param = parser.setParameters(param);
        Database db = parser.parse(in);

        System.out.println(Arrays.asList(param));
        Algorithm dbscan = new DBSCAN();
        dbscan.setParameters(param);
        dbscan.run(db);
        Result result = dbscan.getResult();
        result.output(null,null);
    }

}<commit_msg>no message<commit_after>package de.lmu.ifi.dbs.wrapper;

import de.lmu.ifi.dbs.algorithm.Algorithm;
import de.lmu.ifi.dbs.algorithm.DBSCAN;
import de.lmu.ifi.dbs.algorithm.result.Result;
import de.lmu.ifi.dbs.data.FeatureVector;
import de.lmu.ifi.dbs.database.Database;
import de.lmu.ifi.dbs.database.RTreeDatabase;
import de.lmu.ifi.dbs.database.SpatialIndexDatabase;
import de.lmu.ifi.dbs.distance.EuklideanDistanceFunction;
import de.lmu.ifi.dbs.parser.Parser;
import de.lmu.ifi.dbs.parser.StandardLabelParser;
import de.lmu.ifi.dbs.utilities.QueryResult;
import de.lmu.ifi.dbs.utilities.UnableToComplyException;
import de.lmu.ifi.dbs.utilities.Util;

import java.io.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * 
 */
public class Test {
  public static void main(String[] args) {
    try {
      // testCorrDist();
      testRTree();
    }
    catch (FileNotFoundException e) {
      e.printStackTrace();
    }
  }

  private static void testRTree() throws FileNotFoundException {
    try {
      Date start = new Date();
      // File file1 = new File("test.txt");
      // File file1 = new File("10_T_2.ascii");
      File file1 = new File("timeseries.txt");
      InputStream in1 = new FileInputStream(file1);
      Parser parser1 = new StandardLabelParser();
      String[] param1 = {"-database", "de.lmu.ifi.dbs.database.RTreeDatabase"
        // ,"-" + RTreeDatabase.FILE_NAME_P, "elki.idx"
        // ,"-" + RTreeDatabase.FLAT_DIRECTORY_F
        , "-" + SpatialIndexDatabase.BULK_LOAD_F, "-" + RTreeDatabase.CACHE_SIZE_P, "50000000", "-" + RTreeDatabase.PAGE_SIZE_P, "16000"};

      parser1.setParameters(param1);
      Database<FeatureVector> db1 = parser1.parse(in1);
      System.out.println(db1);

      long ms = new Date().getTime() - start.getTime();
      System.out.println("Total " + Util.format(ms / 1000.0) + " s");

      // File file2 = new File("test.txt");
      // File file2 = new File("10_T_2.ascii");
      File file2 = new File("timeseries.txt");
      InputStream in2 = new FileInputStream(file2);
      Parser parser2 = new StandardLabelParser();
      String[] param2 = {"-database", "de.lmu.ifi.dbs.database.RTreeDatabase"
        // ,"-" + RTreeDatabase.FILE_NAME_P, "elki.idx"
        // ,"-" + RTreeDatabase.FLAT_DIRECTORY_F
        // ,"-" + SpatialIndexDatabase.BULK_LOAD_F
        , "-" + RTreeDatabase.CACHE_SIZE_P, "50000000", "-" + RTreeDatabase.PAGE_SIZE_P, "16000"};

      start = new Date();
      parser2.setParameters(param2);
      Database<FeatureVector> db2 = parser2.parse(in2);
      System.out.println(db2);
      ms = new Date().getTime() - start.getTime();
      System.out.println("Total " + Util.format(ms / 1000.0) + " s");

      EuklideanDistanceFunction distFunction = new EuklideanDistanceFunction();
      List<QueryResult> r1 = db1.kNNQuery(300, 10, distFunction);
      System.out.println("r1 " + r1);

      List<QueryResult> r2 = db2.kNNQuery(300, 10, distFunction);
      System.out.println("r2 " + r2);

      // for (int i = 0; i < 450; i++) {
      // MetricalObject o = db1.get(new Integer(Integer.MIN_VALUE + i));
      // db1.delete(o);
      // System.out.println(db1);
      // }
    }
    catch (IOException e) {
      e.printStackTrace(); // To change body of catch statement use
      // File | Settings | File Templates.
    }

  }

  private static void testCorrDist() throws FileNotFoundException, UnableToComplyException {
    File file = new File("test.txt");
    // File file = new File("10_T_2.ascii");
    InputStream in = new FileInputStream(file);
    Parser parser = new StandardLabelParser();
    String[] param = {"-database", "de.lmu.ifi.dbs.database.SequentialDatabase", "-epsilon", "2x1000", "-minpts", "10", "-distancefunction", "de.lmu.ifi.dbs.distance.CorrelationDistanceFunction", "-verbose"};
    param = parser.setParameters(param);
    Database db = parser.parse(in);

    System.out.println(Arrays.asList(param));
    Algorithm dbscan = new DBSCAN();
    dbscan.setParameters(param);
    dbscan.run(db);
    Result result = dbscan.getResult();
    result.output(null, null);
  }

}
{'fraction_non_alphanumeric': 0.1433550708342703, 'fraction_numerical': 0.023161682032831123, 'mean_word_length': 2.595392077607114, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3382128', 'n_tokens_mistral': 2986, 'n_tokens_neox': 2823, 'n_words': 516}