marf.Stats.StatisticalEstimators.Smoothing
Class GoodTuring

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Stats.StatisticalEstimators.StatisticalEstimator
          extended by marf.Stats.StatisticalEstimators.Smoothing.Smoothing
              extended by marf.Stats.StatisticalEstimators.Smoothing.GoodTuring
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IStatisticalEstimator, ISmoothing, IStorageManager

public class GoodTuring
extends Smoothing

Good-Turing Smoothing Estimator. TODO: complete.

$Id: GoodTuring.java,v 1.21 2007/12/18 21:57:15 mokhov Exp $

Since:
0.3.0.2
Version:
$Revision: 1.21 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
static int DEFAULT_GOOD_TURING_THRESHOLD
          The default threshold value of 5.
private  int iThreshold
          Good-Turing threshold value.
private static long serialVersionUID
          For serialization versioning.
 
Fields inherited from class marf.Stats.StatisticalEstimators.StatisticalEstimator
oProbabilityTable, oStreamTokenizer
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Stats.StatisticalEstimators.Smoothing.ISmoothing
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Stats.StatisticalEstimators.IStatisticalEstimator
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
GoodTuring()
          Constructs the default estimator with the default value of threshold of 5.
GoodTuring(int piThreshold)
          Constructs the estimator with the specified threshold.
 
Method Summary
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 double p(Ngram poNgram)
          Not implemented.
 boolean smooth()
          Implements Good-Turing smoothing algorithm for uni-, bi-, and tri-grams.
 
Methods inherited from class marf.Stats.StatisticalEstimators.Smoothing.Smoothing
train
 
Methods inherited from class marf.Stats.StatisticalEstimators.StatisticalEstimator
backSynchronizeObject, dumpCSV, dumpXML, getFilename, getLanguage, getProbabilityTable, getStreamTokenizer, p, resetFilename, restoreCSV, restoreXML, setLanguage, setStreamTokenizer
 
Methods inherited from class marf.Storage.StorageManager
clone, dump, dumpBinary, dumpGzipBinary, dumpHTML, dumpSQL, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getObjectToSerialize, hashCode, restore, restoreBinary, restoreGzipBinary, restoreHTML, restoreSQL, setDumpMode, setFilename, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_GOOD_TURING_THRESHOLD

public static final int DEFAULT_GOOD_TURING_THRESHOLD
The default threshold value of 5.

Since:
0.3.0.5
See Also:
Constant Field Values

iThreshold

private int iThreshold
Good-Turing threshold value.


serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values
Constructor Detail

GoodTuring

public GoodTuring()
Constructs the default estimator with the default value of threshold of 5.


GoodTuring

public GoodTuring(int piThreshold)
Constructs the estimator with the specified threshold.

Parameters:
piThreshold - the desired threshold value
Method Detail

smooth

public boolean smooth()
Implements Good-Turing smoothing algorithm for uni-, bi-, and tri-grams.

Returns:
true if any smoothing took place and underlying data was altered
See Also:
ISmoothing.smooth()

p

public double p(Ngram poNgram)
Not implemented.

Parameters:
poNgram -
Returns:
0.0

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Returns:
revision string


SourceForge Logo