mdod 2.0.0__tar.gz → 3.0.1__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,18 +1,26 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mdod
3
- Version: 2.0.0
3
+ Version: 3.0.1
4
4
  Summary: MDOD, Multi-Dimensional data Outlier Detection
5
5
  Home-page: https://github.com/mddod/mdod
6
6
  Author: Z Shen
7
7
  Author-email: 626456708@qq.com
8
8
  License: BSD 3-Clause License
9
- Platform: UNKNOWN
10
9
  Classifier: Development Status :: 5 - Production/Stable
11
10
  Classifier: Intended Audience :: Developers
12
11
  Classifier: Programming Language :: Python
13
12
  Classifier: Programming Language :: Python :: 3
14
13
  Description-Content-Type: text/markdown
15
14
  License-File: LICENSE.txt
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: license-file
23
+ Dynamic: summary
16
24
 
17
25
  # mdod
18
26
  MDOD, Multi-Dimensional data Outlier Detection
@@ -36,52 +44,10 @@ cd mdod
36
44
  python setup.py install
37
45
 
38
46
  # usage example:
39
- import numpy as np
40
-
41
- import mdod
42
-
43
- localFile = 'TestDataset.txt'
44
-
45
- dets= np.loadtxt(localFile,delimiter=',')
46
-
47
- nd = 1
48
-
49
- sn = 15
50
-
51
- result = mdod.md(dets,nd,sn)
52
-
53
- print (result)
54
-
55
- # TestDataset.txt format:
56
- data1,data2,data3,data4,data5,data6
57
-
58
- data1,data2,data3,data4,data5,data6
59
-
60
- data1,data2,data3,data4,data5,data6
61
-
62
- ...
63
-
64
- # dets format:
65
- [[data1 data2 data3 data4 data5 data6]
66
-
67
- [data1 data2 data3 data4 data5 data6]
68
-
69
- [data1 data2 data3 data4 data5 data6]
70
-
71
- ...]
72
-
73
- # result format:
74
- [value1, '[data1 data2 data3 data4 data5 data6]', '0']
75
-
76
- [value2, '[data1 data2 data3 data4 data5 data6]', '1']
77
-
78
- [value3, '[data1 data2 data3 data4 data5 data6]', '2']
79
-
80
- ...
81
-
82
- # file exampls:
83
47
  Please visit https://github.com/mddod/mdod, or https://mddod.github.io/
84
48
 
85
-
49
+ Please try testmdodmodelv3.py to see usage
86
50
 
51
+ python testmdodmodelv3.py
87
52
 
53
+
mdod-3.0.1/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # mdod
2
+ MDOD, Multi-Dimensional data Outlier Detection
3
+
4
+ Python library for Multi-Dimensional data Outlier/Anomaly Detection algorithm.
5
+
6
+ # MDOD paper
7
+ MDOD paper is published in ICAIIC 2024 as title "Outlier Detect using Vector Cosine Similarity by Adding a Dimension"
8
+
9
+ https://doi.org/10.1109/ICAIIC60209.2024.10463442
10
+
11
+ # Installation:
12
+ pip install mdod
13
+
14
+ or
15
+
16
+ git clone https://github.com/mddod/mdod.git
17
+
18
+ cd mdod
19
+
20
+ python setup.py install
21
+
22
+ # usage example:
23
+ Please visit https://github.com/mddod/mdod, or https://mddod.github.io/
24
+
25
+ Please try testmdodmodelv3.py to see usage
26
+
27
+ python testmdodmodelv3.py
28
+
29
+
@@ -1,18 +1,26 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mdod
3
- Version: 2.0.0
3
+ Version: 3.0.1
4
4
  Summary: MDOD, Multi-Dimensional data Outlier Detection
5
5
  Home-page: https://github.com/mddod/mdod
6
6
  Author: Z Shen
7
7
  Author-email: 626456708@qq.com
8
8
  License: BSD 3-Clause License
9
- Platform: UNKNOWN
10
9
  Classifier: Development Status :: 5 - Production/Stable
11
10
  Classifier: Intended Audience :: Developers
12
11
  Classifier: Programming Language :: Python
13
12
  Classifier: Programming Language :: Python :: 3
14
13
  Description-Content-Type: text/markdown
15
14
  License-File: LICENSE.txt
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: license-file
23
+ Dynamic: summary
16
24
 
17
25
  # mdod
18
26
  MDOD, Multi-Dimensional data Outlier Detection
@@ -36,52 +44,10 @@ cd mdod
36
44
  python setup.py install
37
45
 
38
46
  # usage example:
39
- import numpy as np
40
-
41
- import mdod
42
-
43
- localFile = 'TestDataset.txt'
44
-
45
- dets= np.loadtxt(localFile,delimiter=',')
46
-
47
- nd = 1
48
-
49
- sn = 15
50
-
51
- result = mdod.md(dets,nd,sn)
52
-
53
- print (result)
54
-
55
- # TestDataset.txt format:
56
- data1,data2,data3,data4,data5,data6
57
-
58
- data1,data2,data3,data4,data5,data6
59
-
60
- data1,data2,data3,data4,data5,data6
61
-
62
- ...
63
-
64
- # dets format:
65
- [[data1 data2 data3 data4 data5 data6]
66
-
67
- [data1 data2 data3 data4 data5 data6]
68
-
69
- [data1 data2 data3 data4 data5 data6]
70
-
71
- ...]
72
-
73
- # result format:
74
- [value1, '[data1 data2 data3 data4 data5 data6]', '0']
75
-
76
- [value2, '[data1 data2 data3 data4 data5 data6]', '1']
77
-
78
- [value3, '[data1 data2 data3 data4 data5 data6]', '2']
79
-
80
- ...
81
-
82
- # file exampls:
83
47
  Please visit https://github.com/mddod/mdod, or https://mddod.github.io/
84
48
 
85
-
49
+ Please try testmdodmodelv3.py to see usage
86
50
 
51
+ python testmdodmodelv3.py
87
52
 
53
+
@@ -1,8 +1,6 @@
1
1
  LICENSE.txt
2
2
  README.md
3
3
  setup.py
4
- mdod/__init__.py
5
- mdod/mdod.py
6
4
  mdod.egg-info/PKG-INFO
7
5
  mdod.egg-info/SOURCES.txt
8
6
  mdod.egg-info/dependency_links.txt
@@ -0,0 +1 @@
1
+
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="mdod",
8
- version="2.0.0",
8
+ version="3.0.1",
9
9
  packages=find_packages(),
10
10
  package_data={"": ["*"]},
11
11
  install_requires=[],
mdod-2.0.0/README.md DELETED
@@ -1,69 +0,0 @@
1
- # mdod
2
- MDOD, Multi-Dimensional data Outlier Detection
3
-
4
- Python library for Multi-Dimensional data Outlier/Anomaly Detection algorithm.
5
-
6
- # MDOD paper
7
- MDOD paper is published in ICAIIC 2024 as title "Outlier Detect using Vector Cosine Similarity by Adding a Dimension"
8
-
9
- https://doi.org/10.1109/ICAIIC60209.2024.10463442
10
-
11
- # Installation:
12
- pip install mdod
13
-
14
- or
15
-
16
- git clone https://github.com/mddod/mdod.git
17
-
18
- cd mdod
19
-
20
- python setup.py install
21
-
22
- # usage example:
23
- import numpy as np
24
-
25
- import mdod
26
-
27
- localFile = 'TestDataset.txt'
28
-
29
- dets= np.loadtxt(localFile,delimiter=',')
30
-
31
- nd = 1
32
-
33
- sn = 15
34
-
35
- result = mdod.md(dets,nd,sn)
36
-
37
- print (result)
38
-
39
- # TestDataset.txt format:
40
- data1,data2,data3,data4,data5,data6
41
-
42
- data1,data2,data3,data4,data5,data6
43
-
44
- data1,data2,data3,data4,data5,data6
45
-
46
- ...
47
-
48
- # dets format:
49
- [[data1 data2 data3 data4 data5 data6]
50
-
51
- [data1 data2 data3 data4 data5 data6]
52
-
53
- [data1 data2 data3 data4 data5 data6]
54
-
55
- ...]
56
-
57
- # result format:
58
- [value1, '[data1 data2 data3 data4 data5 data6]', '0']
59
-
60
- [value2, '[data1 data2 data3 data4 data5 data6]', '1']
61
-
62
- [value3, '[data1 data2 data3 data4 data5 data6]', '2']
63
-
64
- ...
65
-
66
- # file exampls:
67
- Please visit https://github.com/mddod/mdod, or https://mddod.github.io/
68
-
69
-
@@ -1,5 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- from .mdod import md
4
-
5
- __all__ = ['mdod']
mdod-2.0.0/mdod/mdod.py DELETED
@@ -1,55 +0,0 @@
1
- import numpy as np
2
-
3
- def md(detections, norm_distance, top_n):
4
- """
5
- Calculate the vector cosine similarity score and return the sum of the first top_n scores of each vector.
6
-
7
- Args:
8
- detections: Array data
9
- norm_distance: Standardized distance value (scalar) in the new dimension
10
- top_n: The number of highest similarity scores retained
11
-
12
- Returns:
13
- List of [score_sum, original_vector, index]
14
- """
15
- # Input verification: check whether detections is empty or whether top_n is valid
16
- if detections is None or detections.size == 0 or top_n <= 0:
17
- return []
18
-
19
- # Make sure the input is a NumPy array
20
- dets_array = np.array(detections, dtype=float)
21
- n_samples, n_features = dets_array.shape
22
-
23
- # Precomputed constant term
24
- nd_squared = norm_distance ** 2
25
- denominator_left = norm_distance
26
-
27
- # Result storage
28
- result_list = []
29
-
30
- # Vectorize each vector
31
- for i in range(n_samples):
32
- current_vector = dets_array[i]
33
-
34
- # Calculate the sum of squares of the difference between all vectors and the current vector
35
- diff = dets_array - current_vector
36
- diff_squared_sum = np.sum(diff ** 2, axis=1)
37
-
38
- # Calculate the right part of the denominator
39
- denominator_right = np.sqrt(diff_squared_sum + nd_squared)
40
- denominator = denominator_left * denominator_right
41
-
42
- # Calculate the molecule
43
- numerator = nd_squared * np.ones(n_samples)
44
-
45
- # Calculate the similarity score and avoid dividing by zero
46
- similarity_scores = np.where(denominator == 0, 0, numerator / denominator)
47
- similarity_scores[i] = -np.inf
48
-
49
- # Get the sum of the top_n scores
50
- top_scores_sum = np.sum(np.partition(similarity_scores, -top_n)[-top_n:])
51
-
52
- # Save result
53
- result_list.append([top_scores_sum, detections[i].tolist(), i])
54
-
55
- return result_list
@@ -1 +0,0 @@
1
- mdod
File without changes
File without changes