-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataset.py
More file actions
68 lines (53 loc) · 4.03 KB
/
dataset.py
File metadata and controls
68 lines (53 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import random
import numpy
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
import pandas as pd
def dataset1() :
#================================================================== 2 overlaped 1 alone==============================
features2, clusters=make_blobs(n_samples=1000, n_features=21, centers=1, cluster_std=1.4, shuffle=True, random_state=8)
return pd.DataFrame(features2, columns=["Feature1", "Feature2", "Feature3", "Feature4", "Feature5",
"Feature6", "Feature7", "Feature8", "Feature9", "Feature10", "Feature11",
"Feature12", "Feature13", "Feature14", "Feature15", "Feature16", "Feature17",
"Feature18", "Feature19", "Feature20", "Feature21"])
def dataset2():
#===================================================== 3 distinct clusters =======================================
features, clusters = make_blobs(n_samples=1000, n_features=21, centers=3, cluster_std=0.6, shuffle=True, random_state=40 )
return pd.DataFrame(features, columns = ["Feature1", "Feature2", "Feature3","Feature4","Feature5",
"Feature6","Feature7","Feature8","Feature9","Feature10","Feature11",
"Feature12","Feature13","Feature14", "Feature15","Feature16", "Feature17",
"Feature18", "Feature19","Feature20", "Feature21"])
def dataset3():
#===============================================================#3 Overlaped==========================
features1, clusters = make_blobs(n_samples=1000, n_features=21, centers=3, cluster_std=1.8, shuffle=True, random_state=22)
return pd.DataFrame(features1, columns = ["Feature1", "Feature2", "Feature3","Feature4","Feature5",
"Feature6","Feature7","Feature8","Feature9","Feature10","Feature11",
"Feature12","Feature13","Feature14", "Feature15","Feature16", "Feature17",
"Feature18", "Feature19","Feature20", "Feature21"])
def dataset4():
#======================================================= 1 cluster + outliers=============================================
features, clusters = make_blobs(n_samples=1000, n_features=21, centers=1, cluster_std=0.6, shuffle=True, random_state=40 )
new_row_values = []
for _ in range(40):
for _ in range (21):
new_row_values.append(random.uniform(-15.20,15.20))
features = numpy.vstack([features, new_row_values])
new_row_values = []
return pd.DataFrame(features, columns=["Feature1", "Feature2", "Feature3", "Feature4", "Feature5",
"Feature6", "Feature7", "Feature8", "Feature9", "Feature10", "Feature11",
"Feature12", "Feature13", "Feature14", "Feature15", "Feature16", "Feature17",
"Feature18", "Feature19", "Feature20", "Feature21"])
def dataset5():
#=====================================3 clusters + outliers===================================
features, clusters = make_blobs(n_samples=1000, n_features=21, centers=3, cluster_std=1.8, shuffle=True,
random_state=22)
new_row_values = []
for _ in range(40):
for _ in range (21):
new_row_values.append(random.uniform(-80.20,80.20))
features = numpy.vstack([features, new_row_values])
new_row_values = []
return pd.DataFrame(features, columns=["Feature1", "Feature2", "Feature3", "Feature4", "Feature5",
"Feature6", "Feature7", "Feature8", "Feature9", "Feature10", "Feature11",
"Feature12", "Feature13", "Feature14", "Feature15", "Feature16", "Feature17",
"Feature18", "Feature19", "Feature20", "Feature21"])