Questions tagged [nmf]

Non-negative matrix factorization (NMF or NNMF), also non-negative matrix approximation is a group of algorithms in multivariate analysis and linear algebra where a matrix V is factorized into (usually) two matrices W and H, with the property that all three matrices have no negative elements.

is a technique to approximate a matrix like V = WH. Here dimension of V,W,H can be respectively m*n, m*p, p*n where p << n usually. Now W can be thought as a weight matrix for hidden variables. As p can be very small this can also be viewed as a dimensionality reduction technique like .

is widely applicable in most real world cases where V can't have negative values like , , recommender system etc. General applications of include:

For this tag users should provide mathematical clarity as it is an advanced topic along with information about application to specific case.

Useful links:

77 questions
1
vote
1 answer

How can I calculate the coherence score in the sklearn implementation of NMF?

I'm trying to build a utility where a dataset will be processed by the NMF model every couple of days. For this in the first run, I'm providing with a starting value for the number of topics. How can I calculate the coherence score for this entire…
Pv66
  • 136
  • 1
  • 9
1
vote
2 answers

How do I extract x co-ordinate of a point using Python

I'm trying to build an NMF model for topic extraction. For re-training of the model, I've to pass a parameter to the nmf function, for which I need to pass the x co-ordinate from a given point that the algorithm returns, here is the code for…
Pv66
  • 136
  • 1
  • 9
1
vote
1 answer

python Implementation of Proximal alternating linearized minimization algorithm

The updates of the gradients are somehow wrong. I have implemented the below given algorithm. I have done something wrong ''' Implementation of PALM- proximal alternating linearisation method ''' def palm(X,m,niter,lamda): X = X.T l =…
sveer
  • 427
  • 3
  • 16
1
vote
1 answer

Why random_state parameter is used in NMF and LDA algorithm ? What are the benefits of using random topics generated every time?

For Topic Modelling , Why random_state parameter is used in NMF and LDA algorithm ? What are the benefits of using random topics generated every time ?
lil-wolf
  • 372
  • 2
  • 15
1
vote
2 answers

How to remove None from the result of a function?

I'm sorry, but I still can not solve this None problem. I am using an NMF algorithm to have the themes of a corpus and then I try to retrieve the documents attached to each topic. But None prevents me! When I try to retrieve the documents, I have an…
marin
  • 923
  • 2
  • 18
  • 26
1
vote
1 answer

How to get frequencies of topics of NMF in sklearn

I am now using NMF to generate topics. My code is shown below. However, I do not know how to get the frequency of each topic. Does anyone that can help me? Thank you! def fit_tfidf(documents): tfidf = TfidfVectorizer(input = 'content',…
Yipin
  • 61
  • 1
  • 5
1
vote
1 answer

custom matrix in NMF in scikit-learn

I've to do NMF with sklearn, I've used the instructions here: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html I want to add my initialized matrix H, there is option to do init='custom' but I don't know how to give him…
kalonymus
  • 27
  • 5
1
vote
3 answers

Non-Negative Matrix Factorization - IndexError: index 4 is out of bounds for axis 1 with size 4

Here is a piece of the dataset I will be using: u'tff prep normalized clean water permability ncwp result outside operating range', u'technician inadvertently omitted documenting initial room \u201c cleaned sanitized field form', u'sunflower seed…
madsthaks
  • 2,091
  • 6
  • 25
  • 46
1
vote
0 answers

Need to perform topic modelling and output the results to a csv sheet

I have the following code for topic modeling and I need to take in text data from a CSV file and groups them into 2 topics named Topic 0 and Topic 1: Input: Website name, Text Output: Website name, Text, Topic from sklearn.feature_extraction.text…
Rey810
  • 11
  • 2
1
vote
1 answer

How to make Doc2Vec document vectors all positive?

I'm trying to use nonnegative matrix factorization on the output of Doc2Vec. However there is a constraint that there can be no negative input. How do I make it positive without doing something like absolute value that will construe the results? If…
Akbapu
  • 779
  • 2
  • 6
  • 14
1
vote
0 answers

Reordering dendrogram in a heatmap using library(NMF) in R

I have a dataframe like so: set.seed(123) test_df<-data.frame(Sample=c(LETTERS),var1=rnorm(26),var2=rnorm(26),color=rep(sample(c("High","low"),26,replace=TRUE))) I can generate a dendrogram from it using…
thisisrg
  • 596
  • 3
  • 12
1
vote
2 answers

MATLAB nnmf() - large term-document matrix - memory and speed issue

I have a large term-document matrix and want to use the non-negative matrix factorization function matlab offers. The problem is that after the 1st iteration the memory usage rises rapidly and reaches the top (my system has 6GB), and on the other…
tgogos
  • 23,218
  • 20
  • 96
  • 128
0
votes
0 answers

Is there any acceptable range for NMF reconstruction error?

I run NMF with model configuration and iterative optimization. I got a reconstruction error of 0.36 (36% error) to the original data. My question is how well is the reconstruction? Is there any "acceptable" range for relative error (or any error…
Toiba
  • 11
  • 2
0
votes
0 answers

Surprise NMF object is not callable

I am building a recommender system using the Sushi Preference Dataset and the NMF (Non-negative Matrix Factorization) model. I am implementing the same using the Surprise library. I want to use Randomized Search CV for hyperparameter tuning.…
0
votes
0 answers

Is it possible to run non-negative matrix factorization (NMF) on independent variables with the dependent variable as a weighting factor in R?

Is possible to run NMF on independent variables while considering the dependent variable as a weighting factor. I want to use the dependent variable as a weighting factor. I have tried the following and get 10 components. But I am not sure whether…
Toiba
  • 11
  • 2