Generation

generate functionWed, 15 Mar 2023

Write code that brings all the values of sl and sw variables to the same scale using the StandardScaler library from the sklearn.preprocessing library: sl = data['sepal_length'] sw = data['sepal_width']

from sklearn.preprocessing import StandardScaler st_scaler = StandardScaler() sl = np.array(sl).reshape(-1, 1) sw = np.array(sw).reshape(-1, 1) sl = st_scaler.fit_transform(sl) sw = st_scaler.fit_transform(sw) print(sl) print(sw)

Questions about programming?Chat with your personal AI assistant