---
name: "mlpack_local_coordinate_coding"
section: "1"
platform: "linux"
package: "mlpack-bin"
version: "4.6.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_local_coordinate_coding"
---

# mlpack\_local\_coordinate\_coding(1)

local coordinate coding

## NAME

**mlpack\_local\_coordinate\_coding** - local coordinate coding

## SYNOPSIS

```
 mlpack_local_coordinate_coding [-k int] [-i unknown] [-m unknown] [-l double] [-n int] [-N bool] [-s int] [-T unknown] [-o double] [-t unknown] [-V bool] [-c unknown] [-d unknown] [-M unknown] [-h -v]
```

## DESCRIPTION

An implementation of Local Coordinate Coding (LCC), which codes data that approximately lives on a manifold using a variation of l1-norm regularized sparse coding. Given a dense data matrix X with n points and d dimensions, LCC seeks to find a dense dictionary matrix D with k atoms in d dimensions, and a coding matrix Z with n points in k dimensions. Because of the regularization method used, the atoms in D should lie close to the manifold on which the data points lie.

The original data matrix X can then be reconstructed as D \* Z. Therefore, this program finds a representation of each point in X as a sparse linear combination of atoms in the dictionary D.

The coding is found with an algorithm which alternates between a dictionary step, which updates the dictionary D, and a coding step, which updates the coding matrix Z.

To run this program, the input matrix X must be specified (with **-i**), along with the number of atoms in the dictionary (**-k**). An initial dictionary may also be specified with the '**--initial\_dictionary\_file** (**-i**)' parameter. The l1-norm regularization parameter is specified with the '**--lambda** (**-l**)' parameter.

For example, to run LCC on the dataset 'data.csv' using 200 atoms and an l1-regularization parameter of 0.1, saving the dictionary '**--dictionary\_file** (**-d**)' and the codes into '**--codes\_file** (**-c**)', use

$ **mlpack\_local\_coordinate\_coding** **--training\_file** data.csv **--atoms** 200 **--lambda** 0.1 **--dictionary\_file** dict.csv **--codes\_file** codes.csv

The maximum number of iterations may be specified with the '**--max\_iterations** (**-n**)' parameter. Optionally, the input data matrix X can be normalized before coding with the '**--normalize** (**-N**)' parameter.

An LCC model may be saved using the '**--output\_model\_file** (**-M**)' output parameter. Then, to encode new points from the dataset 'points.csv' with the previously saved model 'lcc\_model.bin', saving the new codes to ’new\_codes.csv', the following command can be used:

$ **mlpack\_local\_coordinate\_coding** **--input\_model\_file** lcc\_model.bin **--test\_file** points.csv **--codes\_file** new\_codes.csv

## OPTIONAL INPUT OPTIONS

- **--atoms (-k) \[*int*\]**

  Number of atoms in the dictionary. Default value 0.

- **--help (-h) \[*bool*\]**

  Default help info.

- **--info \[string\]**

  Print help on a specific option. Default value ''.

- **--initial\_dictionary\_file (-i) \[*unknown*\]**

  Optional initial dictionary.

- **--input\_model\_file (-m) \[*unknown*\]**

  Input LCC model.

- **--lambda (-l) \[*double*\]**

  Weighted l1-norm regularization parameter.  Default value 0.

- **--max\_iterations (-n) \[*int*\]**

  Maximum number of iterations for LCC (0 indicates no limit). Default value 0.

- **--normalize (-N) \[*bool*\]**

  If set, the input data matrix will be normalized before coding.

- **--seed (-s) \[*int*\]**

  Random seed. If 0, 'std::time(NULL)' is used.  Default value 0.

- **--test\_file (-T) \[*unknown*\]**

  Test points to encode.

- **--tolerance (-o) \[*double*\]**

  Tolerance for objective function. Default value 0.01.

- **--training\_file (-t) \[*unknown*\]**

  Matrix of training data (X).

- **--verbose (-v) \[*bool*\]**

  Display informational messages and the full list of parameters and timers at the end of execution.

- **--version (-V) \[*bool*\]**

  Display the version of mlpack.

## OPTIONAL OUTPUT OPTIONS

- **--codes\_file (-c) \[*unknown*\]**

  Output codes matrix.

- **--dictionary\_file (-d) \[*unknown*\]**

  Output dictionary matrix.

- **--output\_model\_file (-M) \[*unknown*\]**

  Output for trained LCC model.

## ADDITIONAL INFORMATION

For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.
