Binarization of testing data set

    0

    0

    After Binarization the test data set shape: (5, 1000) An example sample:[[-1., 1.], [-1., -1.], [-1., -2.], [-2., 1.], [-2., -1.], [-2., -2.

    import sklearn
    import numpy as np
    from sklearn import preprocessing
    
    
    X = x_test
    x_test_Binarized = preprocessing.Binarizer(threshold=1000).transform(X)
    print("After Binarization the train data set shape:\n", x_test_Binarized.shape)
    print("An example sample:\n", x_test_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.