from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3,4,5], [5,4,3,2,1], [1,3,5,2,4,], [2,4,1,3,5]] print("before transform:",X) normalizer=Normalizer(norm='l2') print("after transform:",normalizer.transform(X)) # 调用 test_Normalizer test_Normalizer()