Write a simple code to binarize data.

By ayush goel in 22 Sep 2023 | 03:50 pm
ayush goel

ayush goel

Student
Posts: 346
Member since: 21 Sep 2023

Write a simple code to binarize data.

22 Sep 2023 | 03:50 pm
0 Likes
divas goyal

divas goyal

Student
Posts: 453
Member since: 22 Sep 2023

import Binarizer

import numpy as np


data = np.array([[1.0, 2.0, 3.0],

                 [4.0, 5.0, 6.0],

                 [7.0, 8.0, 9.0]])


binarizer = Binarizer(threshold=3.0)

binarized_data = binarizer.transform(data)

print(binarized_data)

23 Sep 2023 | 03:01 pm
0 Likes

Report

Please describe about the report short and clearly.

-->