本文整理汇总了Python中Control.textMatrixGenerator方法的典型用法代码示例。如果您正苦于以下问题:Python Control.textMatrixGenerator方法的具体用法?Python Control.textMatrixGenerator怎么用?Python Control.textMatrixGenerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.textMatrixGenerator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: join
# 需要导入模块: import Control [as 别名]
# 或者: from Control import textMatrixGenerator [as 别名]
repImgP = join(path,"representationImages")
htmlPath = join(path,"objects")
html = Control.HTMLObjectsView(Reducer,path,createOriginalViewer(),createRepresentationViewer(repImgP,htmlPath,Reducer),createReconstructionViewer(Reducer))
html.generate()
del Reducer
del html
#Path for storing resutls from factorization into HTML form and factorization results
I = "/home/jecamargom/tmp/datasets/text1/"
r = 2
#Construction of term-document matrix
ignorechars = ''':,'''
stopwords = ["a","of","lab","abc","for","the","applications","machine","management","opinion","testing","relation","error","measurement","perceived","iv","paths","widths","intersection","in","unordered","binary","random","and","engineering"]
generator = Control.textMatrixGenerator(stopwords,ignorechars,I)
M = generator.build()
#Construction of names and paths arrays
Docs = generator.files
DocsP = [join(I,f) for f in Docs]
#Construction of features arrayy
F = generator.words
#Reduction
print "[DEBUG]"
print M.shape
#generateFactorization("QLSA",Control.QLSA,M,Docs,DocsP,F)
generateFactorization("QLSA2",Control.QLSA2,M*100,Docs,DocsP,F)
#generateFactorization("NMF",Control.NMF,M,Docs,DocsP,F)
#generateFactorization("VQ",Control.VQ,M,Docs,DocsP,F)
#generateFactorization("PCA",Control.PCA,M,Docs,DocsP,F)