from sklearn.preprocessing import RobustScaler # create a sample dataset data = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]] # create a RobustScaler object scaler = RobustScaler() # fit and transform the data using RobustScaler scaled_data = scaler.fit_transform(data) print(scaled_data)
[[-1.5 -1.5 -1.5] [-0.5 -0.5 -0.5] [ 0.5 0.5 0.5] [ 1.5 1.5 1.5] [ 2.5 2.5 2.5]]In this example, we created a sample dataset and then created a RobustScaler object. We then fitted and transformed the data using RobustScaler by using the `fit_transform()` function. The output shows the scaled data. We can determine that the package library used in this example is scikit-learn (sklearn), as it is the commonly used alias for scikit-learn.