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

normalise1d

normalise1d


Description

Normalises a 1 dimensional vector towards unit p norm. By default, p = 2 is used. For a given vector, eg: c(1,2,3), norm value is calculated as 'x / |x|' where '|x|' is calculated as the square root of sum of square of values in the given vector.

Usage

normalise1d(vec, pnorm = 2L)

Arguments

vec

vector containing integers or numeric values.

pnorm

integer, default: 2

Value

a vector containing normalised values

Examples

val <- c(1,10,5,3,8)
norm_val <- normalise1d(val)

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.