public class MemoryEfficientNB extends Classifier
Modifier and Type | Field and Description |
---|---|
double[] |
classCounts |
double |
fidCount |
Vector<Hashtable<Integer,Double>> |
fidCounts |
FeatureMap |
map |
double |
sampleSize |
static double |
smooth |
double[] |
weights |
double[] |
wordCounts |
classesN, methodName
Constructor and Description |
---|
MemoryEfficientNB(DocumentCollection docs,
FeatureMap _map,
int _classesN) |
MemoryEfficientNB(FeatureMap _map,
int _classesN) |
MemoryEfficientNB(String file) |
Modifier and Type | Method and Description |
---|---|
void |
allocateSpace(FeatureMap _map,
int _classesN) |
int |
classify(Document doc,
double thres) |
double |
getAcc(DocumentCollection test) |
String |
getExtendedFeatures(Document d) |
double |
getFidProb(int fid,
int classId) |
double[] |
getPredictionConfidence(Document doc) |
double |
getPrior(int classId) |
Hashtable<String,Integer> |
getTopPmiWords(int maxWordsPerClass,
double confThres,
int minAppThres) |
CharacteristicWords |
getTopPmiWords(int classId,
int maxWordsPerClass,
double confThres,
int minAppThres) |
void |
onlineLearning(Document doc) |
void |
save(String file) |
static boolean |
toBeKept(Vector<String> tokens,
Hashtable<String,Integer> coolWords,
double minRatio,
int minLen) |
void |
weightedOnlineLearning(int[] activeFeatures,
double weight,
int classID) |
public static final double smooth
public double sampleSize
public double[] weights
public double[] wordCounts
public double fidCount
public double[] classCounts
public FeatureMap map
public MemoryEfficientNB(String file)
public MemoryEfficientNB(FeatureMap _map, int _classesN)
public MemoryEfficientNB(DocumentCollection docs, FeatureMap _map, int _classesN)
public void save(String file)
public void onlineLearning(Document doc)
public void weightedOnlineLearning(int[] activeFeatures, double weight, int classID)
public int classify(Document doc, double thres)
classify
in class Classifier
public double[] getPredictionConfidence(Document doc)
getPredictionConfidence
in class Classifier
public void allocateSpace(FeatureMap _map, int _classesN)
public double getFidProb(int fid, int classId)
public double getPrior(int classId)
public double getAcc(DocumentCollection test)
public Hashtable<String,Integer> getTopPmiWords(int maxWordsPerClass, double confThres, int minAppThres)
public CharacteristicWords getTopPmiWords(int classId, int maxWordsPerClass, double confThres, int minAppThres)
public static boolean toBeKept(Vector<String> tokens, Hashtable<String,Integer> coolWords, double minRatio, int minLen)
public String getExtendedFeatures(Document d)
getExtendedFeatures
in class Classifier
Copyright © 2017. All rights reserved.