mdod 0.1.0__py3-none-any.whl

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/LICENSE.txt ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, mddod
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mdod/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # mdod
2
+ MDOD, Multi-Dimensional data Outlier Detection
3
+
4
+ Python library for Multi-Dimensional data Outlier/Anomaly Detection algorithm.
5
+
6
+ # Installation:
7
+ pip install mdod
8
+
9
+ cd mdod
10
+
11
+ pip install
12
+
13
+ # usage example:
14
+ import mdod
15
+
16
+ localFile = 'TestDataset.txt'
17
+
18
+ dets= np.loadtxt(localFile,delimiter=',')
19
+
20
+ nd = 1
21
+
22
+ sn = 15
23
+
24
+ result = mdod.md(dets,nd,sn)
25
+
26
+ print (result)
27
+
28
+ # TestDataset.txt format:
29
+ data1,data2,data3,data4,data5,data6
30
+
31
+ data1,data2,data3,data4,data5,data6
32
+
33
+ data1,data2,data3,data4,data5,data6
34
+
35
+ ...
36
+
37
+ # dets format:
38
+ [[data1 data2 data3 data4 data5 data6]
39
+
40
+ [data1 data2 data3 data4 data5 data6]
41
+
42
+ [data1 data2 data3 data4 data5 data6]
43
+
44
+ ...]
45
+
46
+ # rusult format:
47
+ [value1, '[data1 data2 data3 data4 data5 data6]', '0']
48
+
49
+ [value2, '[data1 data2 data3 data4 data5 data6]', '1']
50
+
51
+ [value3, '[data1 data2 data3 data4 data5 data6]', '2']
52
+
53
+ ...
54
+
55
+ # MDOD paper
56
+ MDOD paper is published in ICAIIC 2024 as title "Outlier Detect using Vector Cosine Similarity by Adding a Dimension"
57
+
58
+ https://doi.org/10.1109/ICAIIC60209.2024.10463442
59
+
60
+
61
+
mdod/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from .mdod import md
4
+
5
+ __all__ = ['mdod']
mdod/mdod.py ADDED
@@ -0,0 +1,59 @@
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
+ VCSResult_list = []
11
+ i=0
12
+ VCS_list.clear()
13
+ for line0 in dets0:
14
+ VCSTotal = 0
15
+ DenominatorLeft = 0
16
+ DenominatorRight = 0
17
+ Numerator1 = 0
18
+ Numerator2 = 0
19
+ NumeratorPlus = 0
20
+ DenominatorSum = 0
21
+ NumeratorSum = 0
22
+ VCSResult = 0
23
+ j = 0
24
+ VCSResult_list.clear()
25
+ line0size=np.array(line0)
26
+ for line1 in dets0:
27
+ VCSResult = 0
28
+ DenominatorLeft = 0
29
+ DenominatorRight = 0
30
+ Numerator1 = 0
31
+ Numerator2 = 0
32
+ NumeratorPlus = 0
33
+ DenominatorSum = 0
34
+ NumeratorSum = 0
35
+ VCSResult = 0
36
+ for k in range(0, (line0size.size), 1):
37
+ DenominatorLeft = float(DenominatorLeft) + (float(str(line0[k]))-float(str(line0[k])))**2
38
+ DenominatorLeft = float(DenominatorLeft) + (float(str(nd))-float(str('0')))**2
39
+ DenominatorLeft = (float(DenominatorLeft)**0.5)
40
+ for k in range(0, (line0size.size), 1):
41
+ DenominatorRight = float(DenominatorRight) + (float(str(line0[k]))-float(str(line1[k])))**2
42
+ DenominatorRight = float(DenominatorRight) + (float(str(nd))-float(str('0')))**2
43
+ DenominatorRight = (float(DenominatorRight)**0.5)
44
+ for k in range(0, (line0size.size), 1):
45
+ NumeratorSum = NumeratorSum + (float(((float(str(line0[k]))-float(str(line0[k])))**2)**0.5) * float(((float(str(line0[k]))-float(str(line1[k])))**2)**0.5))
46
+ NumeratorPlus = (float(((float(str(nd))-float(str('0')))**2)**0.5) * float(((float(str(nd))-float(str('0')))**2)**0.5))
47
+ DenominatorSum = float(DenominatorLeft) * float(DenominatorRight)
48
+ NumeratorSum = NumeratorSum + NumeratorPlus
49
+ VCSResult = float(NumeratorSum)/float(DenominatorSum)
50
+ VCSResult_list.append(VCSResult)
51
+ VCSResult_list.sort(key=None, reverse=True)
52
+ for j in range(1, sn):
53
+ VCSTotal = VCSTotal + float(str(VCSResult_list[j]))
54
+ VCS_list.append([VCSTotal, str(line0), str(i)])
55
+ i = i + 1
56
+ return VCS_list
57
+
58
+
59
+
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.1
2
+ Name: mdod
3
+ Version: 0.1.0
4
+ Summary: MDOD, Multi-Dimensional data Outlier Detection
5
+ Home-page: https://https://github.com/mddod/mdod
6
+ Author: Z Shen
7
+ Author-email: 626456708@qq.com
8
+ License: BSD 3-Clause License
9
+ Platform: UNKNOWN
10
+ Classifier: Development Status :: 1 - Planning
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+
15
+ UNKNOWN
16
+
@@ -0,0 +1,8 @@
1
+ mdod/LICENSE.txt,sha256=7ToR4JRGCu-ZhydtQcKP7V_h7tesBPP2RAoQM6lfwpk,1492
2
+ mdod/README.md,sha256=_xIRoz2H19wgAXyCyFJh0LnKEaVaPqRex-CS29cBERo,1022
3
+ mdod/__init__.py,sha256=Za_ZM6LquGiu3NYA4UQORA-etiQKDfJ1asE7-SJlTNA,71
4
+ mdod/mdod.py,sha256=d0jxlf9kCaCKSkQDIO2-i8ZHnRHzvSHu9_pLcVga7Cg,2400
5
+ mdod-0.1.0.dist-info/METADATA,sha256=XO79mqffo7l37SUEcNKZvhMPXcKK9kIAWg7w_7EH_wU,455
6
+ mdod-0.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
7
+ mdod-0.1.0.dist-info/top_level.txt,sha256=wc3s5DwL33MzLW72ABBR4vg36euFZNFKFD51Og1hnAY,5
8
+ mdod-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ mdod