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
0
votes
0 answers

Unable to change labels when I plot NMF rank survey in R

I am implementing an R analysis to a data-set that I have. This is the plot Basically I would like to change Data labels. I managed to change the title but the common scripts to change label do not work. Basically my idea was : #---Requested Edit…
Spartan 117
  • 119
  • 1
  • 14
0
votes
1 answer

Assign Topic from NNMF Topic Modelling

I have a list of text comments that are fed into a non-negative matrix factorization topic modelling program. import pandas as pd import numpy as np # load the data import csv with open('C:\\...\\comments.csv', newline='') as f: reader =…
coolhand
  • 1,876
  • 5
  • 25
  • 46
0
votes
1 answer

optimize matrix multiplication in for loop RcppArmadillo

The aim is to implement a fast version of the orthogonal projective non-negative matrix factorization (opnmf) in R. I am translating the matlab code available here. I implemented a vanilla R version but it is much slower (about 5.5x slower) than the…
Krrr
  • 452
  • 1
  • 3
  • 15
0
votes
1 answer

Is there any way to reshape more than one image together in python for NMF?

I´m new with Nmf with python . I´m trying to create a list of images to then get the components. Here is the code: from skimage import color from skimage import io import matplotlib.pyplot as…
DAVID LOBO
  • 11
  • 1
0
votes
1 answer

How to undo a log transformation to remove negative values

Ive been given a dataset thats already transformed by a previous user. When i try and create/plot an NMF using this code: multiRankNMF <- nmf(dataset, seq(seq1,seq2), method=usedmethod, nrun=noofrun, seed=initseed,…
0
votes
1 answer

How to perform cross validation on NMF Python

I am trying to perform cross-validation on NMF to find the best parameters to use. I tried using the sklearn cross-validation but get an error that states the NMF does not have a scoring method. Could anyone here help me with that? Thank you all
ranaz
  • 97
  • 1
  • 10
0
votes
0 answers

creating a predictive model based on 3 columns

I have a dataset that has 3 columns. Customer, Shop, and # of times that a customer has shopped in a particular shop. Here's a subset of my data: 3 291 1 3 311 1 3 242 1 3 272 1 3 351 1 3 487 1 6 121 1 6 134 1 6 615 1 6 154…
potatopainting
  • 103
  • 1
  • 9
0
votes
2 answers

visualization for output of topic modelling

For topic modelling I use the method called nmf(Non-negative matrix factorisation). Now, I want to visualise it.So, can someone tell me visualisation techniques for topic modelling.
0
votes
1 answer

Customized KIM feauture selection function

The function extractFeatures from NMF package can select features using the following method only if the features fulfill both following criteria are retained: score greater than \hat{\mu} + 3 \hat{\sigma}, where \hat{\mu} and \hat{\sigma} are the…
Seymoo
  • 177
  • 2
  • 15
0
votes
0 answers

How to deal with compositional data by using NMF (scikit-learn)

I have a compositional data matrix V, whose i-th row is the element ratio of the i-th sample. Finding a matrix decomposition as follows: How can i solve this question use Non-negative matrix factorization (NMF or NNMF)?
0
votes
0 answers

Convert column of lists into one column of values in Pyspark

I have run an ALS model, and am working with the output recommendations. They are currently in this format: |user_id|item_ids| ratings | | 72 | [5,2,3]| [1.2,3.6,4.1]| | 16 | [1,9,5]| [4.4,2.0,3.9]| Each row contains a list in the…
Naim
  • 31
  • 7
0
votes
0 answers

When I use a sklearn parallel module "from cdnmf_fast import _update_cdnmf_fast", its parallelization is not working

(This is my first time of asking a question, if you think the tags or description have something wrong, please tell me, thank you!) I'm doing a work on Matrix Factorization and use the module sklearn.decomposition.nmf the module uses another…
0
votes
1 answer

How to pass a R function as argument using rpy2 in a Python code

I am trying to make a Python interface for the brilliant NMF package - https://cran.r-project.org/web/packages/NMF/NMF.pdf (as it is much more flexible than the Python options). So far so good. I come up with something like this: # Python rpy2 __NMF…
Fernando Ferreira
  • 798
  • 1
  • 11
  • 26
0
votes
0 answers

Is it possible in Stan or PyMC3 to combine 2 multinomial distributions

I have 2 different multinomial distributions that I want to multiply together to get a matrix. This matrix matches my observed data. Is there a way to decompose this data using either PyMC3 or Stan? Are there any good examples? It seems like…
Chris
  • 676
  • 5
  • 20
0
votes
3 answers

How to view the source code of a NMF algorithm in R?

I am pretty new using R, I have to program a new NMF algorithm to be used as the parameter method when the function nmf() is called. As a way to start I would like to view the source code of the built-in algorithms as brunet, KL, lee, but I am…
Martha
  • 3
  • 2