当前位置: 首页>>代码示例>>Python>>正文


Python Control.textMatrixGenerator方法代码示例

本文整理汇总了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)
开发者ID:saaperezru,项目名称:Quantum,代码行数:33,代码来源:Text.py


注:本文中的Control.textMatrixGenerator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。