Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Blog
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference
  • Extreme Optimization
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Nuget packages
    • Configuration
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Data Access Library User's Guide
    • Reference
  • Vector and Matrix Library User's Guide
    • Basic Concepts
    • Vectors
    • Matrices
    • Structured Matrix Types
    • Matrix Decompositions
    • Sparse Vectors and Matrices
    • Complex Linear Algebra
    • Single-Precision Linear Algebra
    • Distributed and GPU Computing
  • Matrix Decompositions
    • The LU Decomposition
    • The QR Decomposition
    • The Cholesky Decomposition
    • The Symmetric Indefinite Decomposition
    • The Eigenvalue Decomposition
    • The Generalized Eigenvalue Decomposition
    • The Singular Value Decomposition
    • The Generalized Singular Value Decomposition
    • Non-Negative Matrix Factorization
    • Solving Linear Systems
  • Non-Negative Matrix Factorization

Non-Negative Matrix Factorization (NMF)

Extreme Optimization Numerical Libraries for .NET Professional

The Non-Negative Matrix Factorization (NMF) is a decomposition of a matrix into a product of two matrices

X = WH,

where all entries in W and H are positive or zero. When the inner dimension of the product (the number of columns of W) is less than the rank of X, then the product is only an approximation, and the factorization is sometimes referred to as the Approximative Non-Negative Matrix Factorization.

The non-negative matrix factorization is represented by the NonNegativeMatrixFactorizationT class.

Working with Non-negative Matrix Factorizations

The NonNegativeMatrixFactorizationT class represents the non-negative matrix factorization of a matrix. It has only one constructor which takes two arguments. The first is a MatrixT that represents the matrix that is to be factored. The second argument is an integer that specifies the inner dimension of the matrix product. If this value is less than both the number of rows and columns of the original matrix, then the factorization is approximate.

The Decompose method performs the actual decomposition using an alternating least squares algorithm. For large matrices, this method may take a long time to complete. This method is called by other methods as needed. You will rarely need to call it explicitly.

After the decomposition is computed, the LeftFactor and RightFactor properties return matrices that represent the non-negative factors.

C#
VB
C++
F#
Copy
var A = Matrix.CreateRandom(6, 4);
var nnmf = new NonNegativeMatrixFactorization<double>(A, 3);
nnmf.Decompose();
var left = nnmf.LeftFactor;
var right = nnmf.RightFactor;
Dim A = Matrix.CreateRandom(6, 4)
Dim nnmf = New NonNegativeMatrixFactorization(Of Double)(A, 3)
nnmf.Decompose()
Dim left = nnmf.LeftFactor
Dim right = nnmf.RightFactor
'

No code example is currently available or this language may not be supported.

let A = Matrix.CreateRandom(6, 4)
let nnmf = new NonNegativeMatrixFactorization<double>(A, 3)
nnmf.Decompose()
let left = nnmf.LeftFactor
let right = nnmf.RightFactor

Unlike other matrix decompositions, the non-negative matrix factorization does not help with solving systems of equations or related operations. Although methods like Solve are defined, they simply delegate the work to the corresponding method on the base matrix.

Copyright (c) 2004-2021 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2021, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.