Spaces:
Runtime error
Runtime error
Celine
commited on
Commit
•
6b29618
1
Parent(s):
54fe72e
tidied code
Browse files
app.py
CHANGED
@@ -4,24 +4,6 @@ from sklearn.datasets import make_blobs
|
|
4 |
from sklearn.cluster import KMeans
|
5 |
from sklearn.preprocessing import StandardScaler
|
6 |
|
7 |
-
# create synthetic data
|
8 |
-
features, true_labels = make_blobs(n_samples=200, centers=3, cluster_std=2.75, random_state=42)
|
9 |
-
|
10 |
-
# goal:
|
11 |
-
# load in a dataset
|
12 |
-
# take user input for number of clusters
|
13 |
-
# cluster dataset into that many clusters
|
14 |
-
|
15 |
-
# page layout:
|
16 |
-
# visualise the data on a plot
|
17 |
-
# normalise the data
|
18 |
-
#
|
19 |
-
|
20 |
-
# def greet(name):
|
21 |
-
# return "Hello " + name + "! Welcome to my unsupervised learning space."
|
22 |
-
|
23 |
-
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
24 |
-
|
25 |
def compute(number_of_samples, number_of_clusters, randomised_state):
|
26 |
# create synthetic data
|
27 |
if randomised_state: seed = None
|
|
|
4 |
from sklearn.cluster import KMeans
|
5 |
from sklearn.preprocessing import StandardScaler
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def compute(number_of_samples, number_of_clusters, randomised_state):
|
8 |
# create synthetic data
|
9 |
if randomised_state: seed = None
|