Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

normalise2d

normalise2d


Description

Normalises a matrix towards unit p norm row wise or column wise. By default, p = 2 is used. To normalise row wise, use axis=0. To normalise column wise, use axis=1. as the square root of sum of square of values in the given vector.

Usage

normalise2d(mat, pnorm = 2L, axis = 0L)

Arguments

mat

numeric matrix

pnorm

integer value, default value=2

axis

integer (0 or 1), row wise = 0, column wise = 1

Value

normalised numeric matrix

Examples

mat <- matrix(runif(12), 3, 4)

## normalise matrix row wise
r <- normalise2d(mat, axis=0)

## normalise matrix column wise
r <- normalise2d(mat, axis=1)

superml

Build Machine Learning Models Like Using Python's Scikit-Learn Library in R

v0.5.3
GPL-3 | file LICENSE
Authors
Manish Saraswat [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.