Binarization of training data set

    0

    0

    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])
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.