Skip to content

Instantly share code, notes, and snippets.

@ashhadulislam
Created December 24, 2021 16:03
Show Gist options
  • Save ashhadulislam/7bc6ed67d7302099081769a292bcbd59 to your computer and use it in GitHub Desktop.
Save ashhadulislam/7bc6ed67d7302099081769a292bcbd59 to your computer and use it in GitHub Desktop.
from sklearn.datasets import load_breast_cancer
import numpy as np
import collections
from knnor import data_augment
dataset = load_breast_cancer()
(unique, counts) = np.unique(dataset['target'], return_counts=True)
print('Unique values of the target variable', unique)
print('Counts of the target variable :', counts)
X=dataset["data"]
y=dataset["target"]
print("Original shape=",X.shape,y.shape)
elements_count = collections.Counter(y)
# printing the element and the frequency
print("Original distribution:")
for key, value in elements_count.items():
print(f"{key}: {value}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment