What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-01 07:20:09
scaling individual samples to have unit norm
# scaling individual samples to have unit norm X = [[ 1., -1., 2.], [ 2., 0., 0.], [ 0., 1., -1.]] X_normalized = preprocessing.normalize(X, norm='l2') X_normalized array([[ 0.40..., -0.40..., 0.81...], [ 1. ..., 0. ..., 0. ..... Add solution