def __init__(self,
	             X,
	             y,
	             feature_vocabulary,
	             category_names,
	             unigram_frequency_path=None):
		'''
		Parameters
		----------
		X: sparse matrix integer, giving term-document-matrix counts
		y: list, integer categories
		feature_vocabulary: dict (feat_name -> idx)
		category_names: list of category names (len of y)
		unigram_frequency_path: str (see TermDocMatrix)
		'''

		if X.shape != (len(y), len(feature_vocabulary)):
			raise DimensionMismatchException('The shape of X is expected to be ' +
			                                 str((len(y), len(feature_vocabulary))) +
			                                 'but was actually: ' + str(X.shape))
		self.X = X
		self.y = y
		self.feature_vocabulary = feature_vocabulary
		self.category_names = category_names
		self.unigram_frequency_path = unigram_frequency_path
def __init__ ( self , X , y , feature_vocabulary , category_names , unigram_frequency_path = None ) : if X . shape != ( len ( y ) , len ( feature_vocabulary ) ) : raise DimensionMismatchException ( 'The shape of X is expected to be ' + str ( ( len ( y ) , len ( feature_vocabulary ) ) ) + 'but was actually: ' + str ( X . shape ) ) self . X = X self . y = y self . feature_vocabulary = feature_vocabulary self . category_names = category_names self . unigram_frequency_path = unigram_frequency_path
Parameters
		----------
		X: sparse matrix integer, giving term-document-matrix counts
		y: list, integer categories
		feature_vocabulary: dict (feat_name -> idx)
		category_names: list of category names (len of y)
		unigram_frequency_path: str (see TermDocMatrix)