Examples of relativeFrequency()


Examples of com.jgaap.util.EventMap.relativeFrequency()

    for(Document known : knowns){
      count++;
      EventMap eventMap = new EventMap(known);
      System.out.println("--- Known Event Set #" + count + " ---");
            for(Event event : eventMap.uniqueEvents()){
              System.out.println("'"+event.getEvent().replaceAll("'", "\\'")+"','"+eventMap.relativeFrequency(event)+"',");
            }
    }
  }
 
    @Override
View Full Code Here

Examples of com.jgaap.util.EventMap.relativeFrequency()

    @Override
    public List<Pair<String, Double>> analyze(Document unknown) {
        EventMap eventMap = new EventMap(unknown);
        System.out.println("--- Unknown Event Set ---");
        for(Event event : eventMap.uniqueEvents()){
          System.out.println("'"+event.getEvent().replaceAll("'", "\\'")+"','"+eventMap.relativeFrequency(event)+"',");
        }

        List<Pair<String,Double>> results = new ArrayList<Pair<String,Double>>();
        results.add(new Pair<String, Double>("No analysis performed.\n", 0.0));
        return results;
View Full Code Here

Examples of com.jgaap.util.EventMap.relativeFrequency()

    for(Event x : events){
      int j =0;
      for(Event y : events){
        double tmp = 0;
        for(EventMap histogram : histograms){
          tmp += (histogram.relativeFrequency(x)-mu.relativeFrequency(x))*(histogram.relativeFrequency(y)-mu.relativeFrequency(y));
        }
        s[i][j] = tmp/(events.size()-1);
        if(i == j) {
          s[i][j] += 0.00001;
        }
View Full Code Here

Examples of com.jgaap.util.EventMap.relativeFrequency()

    for(Event x : events){
      int j =0;
      for(Event y : events){
        double tmp = 0;
        for(EventMap histogram : histograms){
          tmp += (histogram.relativeFrequency(x)-mu.relativeFrequency(x))*(histogram.relativeFrequency(y)-mu.relativeFrequency(y));
        }
        s[i][j] = tmp/(events.size()-1);
        if(i == j) {
          s[i][j] += 0.00001;
        }
View Full Code Here

Examples of com.jgaap.util.EventMap.relativeFrequency()

    EventMap histogram = new EventMap(unknown);
    for(Entry<Document, EventMap> entry : knownHistograms.entrySet()){
      double[][] tmp = new double[events.size()][1];
      int i = 0;
      for(Event event : events){
        tmp[i][0] = histogram.relativeFrequency(event)-entry.getValue().relativeFrequency(event);
        i++;
      }
      Matrix<Float64> difference = Float64Matrix.valueOf(tmp);
      Matrix<Float64> radicand = difference.transpose().times(inverseCovarianceMatrix).times(difference);
      double result = radicand.get(0, 0).sqrt().doubleValue();
View Full Code Here

Examples of com.jgaap.util.EventMap.relativeFrequency()

        for (Event event : events) {
          Double knownFrequency = entry.getValue().relativeFrequency(event);
          if (knownFrequency == null) {
            knownFrequency = 0.0;
          }
          delta += Math.abs((unknownEventMap.relativeFrequency(event) - knownFrequency) / eventStddev.get(event));
        }
        results.add(new Pair<String, Double>(entry.getKey(), delta,2));
      }
    } else {
      for (Entry<String, Collection<EventMap>> entry : knownHistograms.asMap().entrySet()) {
View Full Code Here

Examples of com.jgaap.util.EventMap.relativeFrequency()

    } else {
      for (Entry<String, Collection<EventMap>> entry : knownHistograms.asMap().entrySet()) {
        for (EventMap histogram : entry.getValue()) {
          double delta = 0.0;
          for (Event event : events) {
            delta += Math.abs((unknownEventMap.relativeFrequency(event) - histogram.relativeFrequency(event)) / eventStddev.get(event));
          }
          results.add(new Pair<String, Double>(entry.getKey(), delta,2));
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.