scikit-learn:通过Non-negative matrix factorization (NMF or NNMF)实现LSA(隐含语义分析)


之前写过两篇文章,分别是

1)矩阵分解的综述:scikit-learn:2.5.矩阵因子分解问题

2)关于TruncatedSVD的简单介绍:scikit-learn:通过TruncatedSVD实现LSA(隐含语义分析)

今天发现NMF也是一个很好很实用的模型,就简单介绍一下,它也属于scikit-learn:2.5.矩阵因子分解问题的一部分。


NMF是另一种压缩方法,前提是假设数据矩阵是非负的。在数据矩阵不包含负值的情况下, NMF可以代替PCA及他的变形(NMF can be plugged in instead of PCA or its variants, in the cases where the data matrix does not contain negative values.)。他通过把X分解成W和H,并优化下式:


This norm is an obvious extension of the Euclidean norm to matrices. (Other optimization objectives have been suggested in the NMF literature, in particular Kullback-Leibler divergence, but these are not currently implemented.)


和PCA不同的是,NNMF通过增量式(通过叠加每一个子成分而不做相减操作)的方式表示一个向量,这种增量式模型能有效表示图像和文本。


NNMF实现了非负双奇异值分解( Nonnegative Double Singular Value Decomposition,NNDSVD)。NNDSVD基于两个SVD过程,一个SVD过程用来近似数据矩阵,另一个SVD过程利用单位秩矩阵的代数性质来近似第一步产生的SVD因子的正值部分。NNDSVD的基本实现能很好地用于稀疏矩阵分解。

对于非稀疏矩阵,可以使用变形NNDSVDa (in which all zeros are set equal to the mean of all elements of the data)和NNDSVDar (in which the zeros are set to random perturbations less than the mean of the data divided by 100)


这个例子很不错哦:

http://scikit-learn.org/stable/auto_examples/applications/topics_extraction_with_nmf.html#example-applications-topics-extraction-with-nmf-py







  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值