Skip to content

Commit

Permalink
start point of silhouette
Browse files Browse the repository at this point in the history
  • Loading branch information
elro77 committed Dec 18, 2021
1 parent 830eca2 commit 4615dc3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DBSCAN_Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from sklearn.cluster import DBSCAN
from MyDBSCAN import CMyDBSCAN
from silhouette import calculateSilhouetteValue


"""
Expand Down Expand Up @@ -106,7 +107,7 @@



testArray = vectorsArray[0:100000]
testArray = vectorsArray[0:10000]
#====== Sklearn =================
#the sklearn clustering takes 120 seconds to accomplish
#return an array where each index is the vector(point) and value is it clustering
Expand Down
37 changes: 37 additions & 0 deletions silhouette.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import numpy as np
import math
import time


"""
t = time.time()
elapsed = time.time() - t
print("creating graph time: ",elapsed)
"""

clustersDictionary = dict()
arrayValueA = np.zeros()
arrayValueB = np.zeros()

def calculateSilhouetteValue(dataset, clusters):
x=0


def createClustersDictionary(clusters):
x=0

def calculateValueA(cluster):
x=0

def calculateValueB(cluster):
x=0

def calculateAvgSilhouete():
x=0


def dist(A):
m, n = A.shape
B = A @ A.T
D = np.diag(B).reshape([1, m])
return (D.T + D - 2 * B)**0.5

0 comments on commit 4615dc3

Please sign in to comment.