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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdod
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: MDOD, Multi-Dimensional data Outlier Detection
5
5
  Home-page: https://github.com/mddod/mdod
6
6
  Author: Z Shen
@@ -0,0 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from .mdod import md
4
+
5
+ __all__ = ['mdod']
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdod
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: MDOD, Multi-Dimensional data Outlier Detection
5
5
  Home-page: https://github.com/mddod/mdod
6
6
  Author: Z Shen
@@ -1,6 +1,8 @@
1
1
  LICENSE.txt
2
2
  README.md
3
3
  setup.py
4
+ mdod/__init__.py
5
+ mdod/mdod.py
4
6
  mdod.egg-info/PKG-INFO
5
7
  mdod.egg-info/SOURCES.txt
6
8
  mdod.egg-info/dependency_links.txt
@@ -0,0 +1 @@
1
+ mdod
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="mdod",
5
- version="1.0.1",
5
+ version="1.0.2",
6
6
  packages=find_packages(),
7
7
  package_data={"": ["*"]},
8
8
  install_requires=[
@@ -1 +0,0 @@
1
-
File without changes
File without changes
File without changes