After Binarization the train data set shape: (2, 128, 3) An example sample:
After Binarization the train data set shape: (2, 128, 3)
x_test_binarized=Binarized_x_test X_test=x_test Binarized_x_test=preprocessing.Binarizer(threshold=1000).transform(X_test) print("After Binarization the test data set shape:\n", x_test_binarized.
import sklearn
import numpy as np
from sklearn import preprocessing
X = x_train
x_train_Binarized = preprocessing.Binarizer(threshold=1000).transform(X)
print("After Binarization the train data set shape:\n", x_train_Binarized.shape)
print("An example sample:\n", x_train_Binarized[0])