Changeset 36863 for gs3-extensions


Ignore:
Timestamp:
2022-10-23T00:00:08+13:00 (18 months ago)
Author:
davidb
Message:

Further improvements to performing AV recommendation

Location:
gs3-extensions/mars-src/trunk/src/java/org/greenstone/gsdl3/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/mars-src/trunk/src/java/org/greenstone/gsdl3/util/WekaDBWrapper.java

    r36859 r36863  
    4141public class WekaDBWrapper
    4242{
     43    public final static double AV_SEGMENT_LENGTH_SECS = 6.0;
     44   
    4345    /** the query result, filled in by runQuery */
    4446    protected Vector query_result_;
     
    190192
    191193        String matching_doc_id = m.group(1);
    192         int matching_segment_offset = Integer.parseInt(m.group(2));
    193 
     194        int end_of_matching_segment_offset = Integer.parseInt(m.group(2));
     195        int matching_segment_offset = end_of_matching_segment_offset - (int)AV_SEGMENT_LENGTH_SECS;
     196       
    194197        if (matching_doc_id.equals(doc_id)) {
    195198            continue;
  • gs3-extensions/mars-src/trunk/src/java/org/greenstone/gsdl3/util/WekaFindInstanceKNN.java

    r36859 r36863  
    9494    {
    9595    System.err.println("**** wekaFindInstnaceKNN::kNearestNeighbours() called with:");
    96     System.err.print(  "**** doc_id_segment = " + doc_id_segment);
    97     System.err.print(  " arousal_val = "   + arousal_val);
    98     System.err.print(  " valence_val = "   + valence_val);
    99     System.err.println(" k_nearest_num = " + k_nearest_num);
     96    System.err.print(  "  doc_id_segment = " + doc_id_segment);
     97    System.err.print(  "  arousal_val = "   + arousal_val);
     98    System.err.print(  "  valence_val = "   + valence_val);
     99    System.err.println("  k_nearest_num = " + k_nearest_num);
    100100   
    101101    Instance sample_instance = new DenseInstance(3);
     
    117117    try {
    118118        nearest_instances = knn_.kNearestNeighbours(sample_instance, k_nearest_num);
    119         System.err.println("**** nearest_instances len = " + nearest_instances.numInstances());
     119        System.err.println("**** Expanded to include instances that are equidistant, nearest_instances len = " + nearest_instances.numInstances());
    120120
    121121        //printNearestKNN(sample_instance,nearest_instances, k_nearest_num);
Note: See TracChangeset for help on using the changeset viewer.