def __init__(self, data, trainingData): """ Initialize this term frequency analysis using some training document to perform smoothing @param data The results retrieved from the search interface, which contains a set of documents @param trainingData The training data to use for smoothing """ TermFrequencyAnalysis.__init__(self, data) self.trainingDocumentAnalysis = TermFrequencyAnalysis(trainingData)
def __init__(self, data, trainingData, tuningParameter = 10): """ Initialize this term frequency analysis using some training document to perform smoothing @param data The results retrieved from the search interface, which contains a set of documents @param trainingData The data to use for smoothing @param tuningParameter Parameter to use for the amount of reliance on the training set which represents the number of 'pseudo-counts' to give to a word that never occurs in the given document """ TermFrequencyAnalysis.__init__(self, data) self.trainingDocumentAnalysis = TermFrequencyAnalysis(trainingData) self.tuningParameter = tuningParameter