mdod 1.0.1__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mdod-1.0.1 → mdod-1.0.2}/PKG-INFO +1 -1
- mdod-1.0.2/mdod/__init__.py +5 -0
- mdod-1.0.2/mdod/mdod.py +39 -0
- {mdod-1.0.1 → mdod-1.0.2}/mdod.egg-info/PKG-INFO +1 -1
- {mdod-1.0.1 → mdod-1.0.2}/mdod.egg-info/SOURCES.txt +2 -0
- mdod-1.0.2/mdod.egg-info/top_level.txt +1 -0
- {mdod-1.0.1 → mdod-1.0.2}/setup.py +1 -1
- mdod-1.0.1/mdod.egg-info/top_level.txt +0 -1
- {mdod-1.0.1 → mdod-1.0.2}/LICENSE.txt +0 -0
- {mdod-1.0.1 → mdod-1.0.2}/README.md +0 -0
- {mdod-1.0.1 → mdod-1.0.2}/mdod.egg-info/dependency_links.txt +0 -0
- {mdod-1.0.1 → mdod-1.0.2}/setup.cfg +0 -0
mdod-1.0.2/mdod/mdod.py
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*-coding: utf-8- -*-
|
2
|
+
#MDOD, Multi-Dimensional data Outlier Detection
|
3
|
+
# Author: Z Shen<626456708@qq.com>
|
4
|
+
# License: BSD 3-Clause License
|
5
|
+
|
6
|
+
import numpy as np
|
7
|
+
|
8
|
+
def md(dets0, nd, sn):
|
9
|
+
VCS_list = []
|
10
|
+
i = 0
|
11
|
+
|
12
|
+
for line0 in dets0:
|
13
|
+
VCSResult_list = []
|
14
|
+
line0_arr = np.array(line0, dtype=float)
|
15
|
+
|
16
|
+
for j, line1 in enumerate(dets0):
|
17
|
+
if j == i:
|
18
|
+
continue
|
19
|
+
|
20
|
+
line1_arr = np.array(line1, dtype=float)
|
21
|
+
|
22
|
+
DenominatorLeft = np.sqrt(np.sum((line0_arr - line0_arr) ** 2) + (nd - 0) ** 2)
|
23
|
+
DenominatorRight = np.sqrt(np.sum((line0_arr - line1_arr) ** 2) + (nd - 0) ** 2)
|
24
|
+
DenominatorSum = DenominatorLeft * DenominatorRight
|
25
|
+
|
26
|
+
NumeratorSum = np.sum(np.sqrt((line0_arr - line0_arr) ** 2) * np.sqrt((line0_arr - line1_arr) ** 2))
|
27
|
+
NumeratorPlus = np.sqrt((nd - 0) ** 2) * np.sqrt((nd - 0) ** 2)
|
28
|
+
NumeratorSum += NumeratorPlus
|
29
|
+
|
30
|
+
VCSResult = 0 if DenominatorSum == 0 else NumeratorSum / DenominatorSum
|
31
|
+
VCSResult_list.append(VCSResult)
|
32
|
+
|
33
|
+
VCSResult_list.sort(reverse=True)
|
34
|
+
VCSTotal = sum(VCSResult_list[:min(sn, len(VCSResult_list))])
|
35
|
+
|
36
|
+
VCS_list.append([VCSTotal, line0.tolist(), i])
|
37
|
+
i += 1
|
38
|
+
|
39
|
+
return VCS_list
|
@@ -0,0 +1 @@
|
|
1
|
+
mdod
|
@@ -1 +0,0 @@
|
|
1
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|