10000 remove R inspired implementation, starting over · scikit-learn/scikit-learn@8af9364 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8af9364

Browse files
committed
remove R inspired implementation, starting over
1 parent b8fcc9c commit 8af9364

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

sklearn/cluster/optics_.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -776,57 +776,3 @@ def _get_leaves(node, arr):
776776
return arr
777777

778778

779-
# Determines if the reachability distance at the current index 'i'
780-
# is a valid distance
781-
def _valid(reachability_plot, idx):
782-
return (idx >= len(reachability_plot)
783-
or not np.isnan(reachability_plot[idx]))
784-
785-
786-
# Determines if the reachability distance at the current index 'i' is
787-
# (xi) significantly higher than the next index
788-
def _steepDown(reachability_plot, idx, ixi):
789-
if not _valid(reachability_plot, idx + 1):
790-
return False
791-
if np.isinf(reachability_plot[idx + 1]):
792-
return False
793-
return reachability_plot[idx] * ixi >= reachability_plot[i + 1]
794-
795-
# Determines if the reachability distance at the current index 'i' is
796-
# (xi) significantly lower than the next index
797-
def _steepUp(reachability_plot, idx, ixi):
798-
if np.isinf(reachability_plot[idx]):
799-
return False
800-
if not _valid(reachability_plot, idx + 1):
801-
return True
802-
return reachability_plot[idx] <= reachability_plot[idx + 1] * ixi
803-
804-
805-
def updateFilterSDASet(sdaset, mib, ixi):
806-
pass
807-
808-
809-
def _extractXi(reachability, ordering, xi, minimum=False):
810-
reachability_plot = reachability[ordering]
811-
ixi = 1 - xi
812-
steep_down_areas = list()
813-
clusters = list()
814-
index = 1
815-
mib = 0
816-
sdaset = list()
817-
while index <= len(ordering):
818-
mib = np.max(mib, reachability_plot[index])
819-
if not _valid(reachability_plot, idx + 1):
820-
break
821-
822-
# test if this is a steep down area
823-
if _steepDown(reachability_plot, idx):
824-
# Update mib values with current mib and filter
825-
sdaset = updateFilterSDASet(sdaset, mib, ixi)
826-
startval = reachability_plot[index]
827-
mib = 0
828-
startsteep = index
829-
endsteep = index + 1
830-
while not
831-
if _steepDown(reachability_plot, index):
832-
endsteep = index + 1

0 commit comments

Comments
 (0)
0