fork download
  1. # Normalize the data attributes for the Iris dataset.
  2. from sklearn.datasets import load_iris
  3. from sklearn import preprocessing
  4. # load the iris dataset
  5. iris = load_iris()
  6. print(iris.data.shape)
  7.  
  8. # separate the data from the target attributes
  9.  
  10. X = iris.data
  11. y = iris.target
  12. # normalize the data attributes
  13. normalized_X = preprocessing.normalize(X)
Success #stdin #stdout 0.45s 59568KB
stdin
mushroom
stdout
(150, 4)