---
name: "mlpack_amf_RandomAcolInitialization"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_amf_RandomAcolInitialization"
---

# mlpack\_amf\_RandomAcolInitialization(3)

This class initializes the W matrix of the NMF algorithm by averaging p randomly chosen columns of V.

## NAME

mlpack::amf::RandomAcolInitialization\< p \> -

This class initializes the W matrix of the NMF algorithm by averaging p randomly chosen columns of V.

## SYNOPSIS

### Public Member Functions

**RandomAcolInitialization** ()\

### Static Public Member Functions

template\<typename MatType \> static void **Initialize** (const MatType &V, const size\_t r, arma::mat &W, arma::mat &H)\

## Detailed Description

### template\<int p = 5\>class mlpack::amf::RandomAcolInitialization\< p \>

This class initializes the W matrix of the NMF algorithm by averaging p randomly chosen columns of V.

In this case, p is a template parameter. H is then set randomly.

**Template Parameters:**

*The* number of random columns to average for each column of W.

Definition at line 42 of file random\_acol\_init.hpp.

## Constructor & Destructor Documentation

### template\<int p = 5\> mlpack::amf::RandomAcolInitialization\< p \>::RandomAcolInitialization ()` [inline]`

Definition at line 46 of file random\_acol\_init.hpp.

## Member Function Documentation

### template\<int p = 5\> template\<typename MatType \> static void mlpack::amf::RandomAcolInitialization\< p \>::Initialize (const MatType &V, const size\_tr, arma::mat &W, arma::mat &H)` [inline]`, ` [static]`

Definition at line 50 of file random\_acol\_init.hpp.

References mlpack::math::RandInt(), and mlpack::Log::Warn.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
