uk.ac.gla.dcs.renaissance.iqir
Class WeightingScheme

java.lang.Object
  extended by uk.ac.gla.dcs.renaissance.iqir.WeightingScheme

public class WeightingScheme
extends Object

A weighting scheme for information unit vectors

Author:
B. Piwowarski

Nested Class Summary
static class WeightingScheme.Scheme
           
static class WeightingScheme.SimpleTermStatistics
           
static interface WeightingScheme.TermStatistics
          Interface for term statistics
 
Field Summary
 boolean normalise
           
 WeightingScheme.Scheme scheme
           
 
Constructor Summary
WeightingScheme()
           
 
Method Summary
 void init(IndexConfiguration index)
           
 void init(int nbDocuments, int totalLength, List<Integer> documentFrequencies, long[] tfFrequencies)
          Initialise the object
 void setTermStatistics(WeightingScheme.TermStatistics termStatistics)
          Set term statistics in case of
 double weightAndNormaliseTFVector(bpiwowar.maths.matrix.DoubleMatrix1D v, double docLength, it.unimi.dsi.fastutil.ints.IntSet restriction)
          Process a term frequency vectors into the adequate representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

normalise

public boolean normalise

scheme

public WeightingScheme.Scheme scheme
Constructor Detail

WeightingScheme

public WeightingScheme()
Method Detail

init

public void init(IndexConfiguration index)
          throws IOException
Throws:
IOException

init

public void init(int nbDocuments,
                 int totalLength,
                 List<Integer> documentFrequencies,
                 long[] tfFrequencies)
          throws IOException
Initialise the object

Parameters:
nbDocuments -
totalLength -
documentFrequencies - Document term frequency (#documents where the term occurs)
tfFrequencies -
Throws:
IOException

setTermStatistics

public void setTermStatistics(WeightingScheme.TermStatistics termStatistics)
Set term statistics in case of

Parameters:
termStatistics -

weightAndNormaliseTFVector

public double weightAndNormaliseTFVector(bpiwowar.maths.matrix.DoubleMatrix1D v,
                                         double docLength,
                                         it.unimi.dsi.fastutil.ints.IntSet restriction)
                                  throws IOException,
                                         com.sleepycat.je.DatabaseException
Process a term frequency vectors into the adequate representation

Parameters:
nbDocuments - The number of documents
frequencies - Term document frequencies
v - A vector of term frequencies
restriction - If not null, Remove any component which is not within this set
Throws:
com.sleepycat.je.DatabaseException
IOException


Copyright © 2011. All Rights Reserved.