opengood.py-ml-plot 2.5.0__tar.gz → 2.6.0__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.4
2
2
  Name: opengood.py_ml_plot
3
- Version: 2.5.0
3
+ Version: 2.6.0
4
4
  Summary: Modules containing reusable functions for machine learning visualization plotting
5
5
  Author-email: OpenGood <ai@opengood.ai>
6
6
  License: MIT License
@@ -33,14 +33,14 @@ Classifier: Operating System :: OS Independent
33
33
  Requires-Python: >=3.12
34
34
  Description-Content-Type: text/markdown
35
35
  License-File: LICENSE
36
- Requires-Dist: matplotlib>=3.10.8
37
- Requires-Dist: numpy>=2.4.3
38
- Requires-Dist: pandas>=3.0.1
39
- Requires-Dist: scikit-learn>=1.8.0
36
+ Requires-Dist: matplotlib>=3.11.2
37
+ Requires-Dist: numpy>=2.4.4
38
+ Requires-Dist: pandas>=3.1.0
39
+ Requires-Dist: scikit-learn>=1.9.1
40
40
  Provides-Extra: dev
41
41
  Requires-Dist: pip-tools>=7.5.3; extra == "dev"
42
- Requires-Dist: pytest>=9.0.2; extra == "dev"
43
- Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
42
+ Requires-Dist: pytest>=9.0.3; extra == "dev"
43
+ Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
44
44
  Dynamic: license-file
45
45
 
46
46
  # Python Machine Learning (ML) Plot
@@ -127,15 +127,10 @@ setup_classification_plot(
127
127
  0: {"min": 10, "max": 10, "step": 0.25},
128
128
  1: {"min": 1000, "max": 1000, "step": 0.25},
129
129
  },
130
- feature_scale=lambda x_set, y_set: (
131
- sc.inverse_transform(x_set), y_set
132
- ),
133
- predict=lambda x1, x2: (
134
- classifier.predict(
135
- sc.transform(
136
- np.array([x1.ravel(), x2.ravel()]).T)
137
- ).reshape(x1.shape)
138
- ),
130
+ feature_scale=lambda x_set, y_set: (sc.inverse_transform(x_set), y_set),
131
+ predict=lambda x1, x2: classifier.predict(
132
+ sc.transform(np.array([x1.ravel(), x2.ravel()]).T)
133
+ ).reshape(x1.shape),
139
134
  )
140
135
 
141
136
  plt.show()
@@ -158,8 +153,8 @@ plt.show()
158
153
  the `StandardScaler` object `sc` created earlier for feature scaling
159
154
  * `x_set` and `y_set` are assigned non-feature scaled values of the matrix of
160
155
  features and the dependent variable
161
- * `x_set` values are inverted from their feature-scaled values in `x`
162
- * `y_set` values are not inverted and taken directly from `y`
156
+ * `x_set` values are inverted from their feature-scaled values in `x`
157
+ * `y_set` values are not inverted and taken directly from `y`
163
158
 
164
159
  ###### Predict Lambda Logic
165
160
 
@@ -174,11 +169,11 @@ is as follows:
174
169
  scaling
175
170
  * `ravel` function from the NumPy library is used to flatten a
176
171
  multidimensional array into a one-dimensional array
177
- * `x1` and `x2` are flatten into a 1D array via the `ravel` function
178
- * They are then combined via the `array` function from the NumPy
179
- library into a 2D array
180
- * The result is then reshaped via the `reshape` function to match
181
- the shape of `x1`
172
+ * `x1` and `x2` are flatten into a 1D array via the `ravel` function
173
+ * They are then combined via the `array` function from the NumPy
174
+ library into a 2D array
175
+ * The result is then reshaped via the `reshape` function to match
176
+ the shape of `x1`
182
177
 
183
178
  ###### Setup Plot Visualization Logic
184
179
 
@@ -200,38 +195,38 @@ as follows:
200
195
  * `y_set` values are not inverted and taken directly from `y`
201
196
  * `meshgrid` function from the NumPy library returns a tuple of coordinate
202
197
  matrices from coordinate vectors
203
- * The ranges for each axis are controlled by the `meshgrid` dict parameter
204
- * Two sets of matrices (`x1` and `x2`) are returned with coordinate vectors
205
- * `x1`
206
- * `arange` function is called with a defined start and stop interval
207
- * `x_set[:, 0]` returns all the rows for feature `x1`
208
- * `start` parameter
209
- * Start of an interval
210
- * `x_set[:, 0].min()` returns the minimum value for feature `x1`
211
- * Value of `10` is subtracted for padding
212
- * `stop` parameter
213
- * End of an interval
214
- * `x_set[:, 0].max()` returns the maximum value for feature `x1`
215
- * Value of `10` is added for padding
216
- * `step` parameter
217
- * Spacing between values
218
- * Value of `0.25` is added for spacing
219
- * `x2`
220
- * `arange` function is called with a defined start and stop interval
221
- * `x_set[:, 1]` returns all the rows for feature `x2`
222
- * `start` parameter
223
- * Start of an interval
224
- * `x_set[:, 1].min()` returns the minimum value for feature `x2`
225
- * Value of `1000` is subtracted for padding
226
- * Value of `1000` is used instead of `10` due to the difference
227
- in scaling for feature `x2` vs. feature `x1`
228
- * `stop` parameter
229
- * End of interval
230
- * `x_set[:, 1].max()` returns the maximum value for feature `x2`
231
- * Value of `1000` is added for padding
232
- * `step` parameter
233
- * Spacing between values
234
- * Value of `0.25` is added for spacing
198
+ * The ranges for each axis are controlled by the `meshgrid` dict parameter
199
+ * Two sets of matrices (`x1` and `x2`) are returned with coordinate vectors
200
+ * `x1`
201
+ * `arange` function is called with a defined start and stop interval
202
+ * `x_set[:, 0]` returns all the rows for feature `x1`
203
+ * `start` parameter
204
+ * Start of an interval
205
+ * `x_set[:, 0].min()` returns the minimum value for feature `x1`
206
+ * Value of `10` is subtracted for padding
207
+ * `stop` parameter
208
+ * End of an interval
209
+ * `x_set[:, 0].max()` returns the maximum value for feature `x1`
210
+ * Value of `10` is added for padding
211
+ * `step` parameter
212
+ * Spacing between values
213
+ * Value of `0.25` is added for spacing
214
+ * `x2`
215
+ * `arange` function is called with a defined start and stop interval
216
+ * `x_set[:, 1]` returns all the rows for feature `x2`
217
+ * `start` parameter
218
+ * Start of an interval
219
+ * `x_set[:, 1].min()` returns the minimum value for feature `x2`
220
+ * Value of `1000` is subtracted for padding
221
+ * Value of `1000` is used instead of `10` due to the difference
222
+ in scaling for feature `x2` vs. feature `x1`
223
+ * `stop` parameter
224
+ * End of interval
225
+ * `x_set[:, 1].max()` returns the maximum value for feature `x2`
226
+ * Value of `1000` is added for padding
227
+ * `step` parameter
228
+ * Spacing between values
229
+ * Value of `0.25` is added for spacing
235
230
  * The prediction logic implemented in the `predict` lambda is executed, and
236
231
  the result is assigned to `y_pred`, containing the predictions
237
232
  * `contourf` function from the Matplotlib library is used for creating filled
@@ -82,15 +82,10 @@ setup_classification_plot(
82
82
  0: {"min": 10, "max": 10, "step": 0.25},
83
83
  1: {"min": 1000, "max": 1000, "step": 0.25},
84
84
  },
85
- feature_scale=lambda x_set, y_set: (
86
- sc.inverse_transform(x_set), y_set
87
- ),
88
- predict=lambda x1, x2: (
89
- classifier.predict(
90
- sc.transform(
91
- np.array([x1.ravel(), x2.ravel()]).T)
92
- ).reshape(x1.shape)
93
- ),
85
+ feature_scale=lambda x_set, y_set: (sc.inverse_transform(x_set), y_set),
86
+ predict=lambda x1, x2: classifier.predict(
87
+ sc.transform(np.array([x1.ravel(), x2.ravel()]).T)
88
+ ).reshape(x1.shape),
94
89
  )
95
90
 
96
91
  plt.show()
@@ -113,8 +108,8 @@ plt.show()
113
108
  the `StandardScaler` object `sc` created earlier for feature scaling
114
109
  * `x_set` and `y_set` are assigned non-feature scaled values of the matrix of
115
110
  features and the dependent variable
116
- * `x_set` values are inverted from their feature-scaled values in `x`
117
- * `y_set` values are not inverted and taken directly from `y`
111
+ * `x_set` values are inverted from their feature-scaled values in `x`
112
+ * `y_set` values are not inverted and taken directly from `y`
118
113
 
119
114
  ###### Predict Lambda Logic
120
115
 
@@ -129,11 +124,11 @@ is as follows:
129
124
  scaling
130
125
  * `ravel` function from the NumPy library is used to flatten a
131
126
  multidimensional array into a one-dimensional array
132
- * `x1` and `x2` are flatten into a 1D array via the `ravel` function
133
- * They are then combined via the `array` function from the NumPy
134
- library into a 2D array
135
- * The result is then reshaped via the `reshape` function to match
136
- the shape of `x1`
127
+ * `x1` and `x2` are flatten into a 1D array via the `ravel` function
128
+ * They are then combined via the `array` function from the NumPy
129
+ library into a 2D array
130
+ * The result is then reshaped via the `reshape` function to match
131
+ the shape of `x1`
137
132
 
138
133
  ###### Setup Plot Visualization Logic
139
134
 
@@ -155,38 +150,38 @@ as follows:
155
150
  * `y_set` values are not inverted and taken directly from `y`
156
151
  * `meshgrid` function from the NumPy library returns a tuple of coordinate
157
152
  matrices from coordinate vectors
158
- * The ranges for each axis are controlled by the `meshgrid` dict parameter
159
- * Two sets of matrices (`x1` and `x2`) are returned with coordinate vectors
160
- * `x1`
161
- * `arange` function is called with a defined start and stop interval
162
- * `x_set[:, 0]` returns all the rows for feature `x1`
163
- * `start` parameter
164
- * Start of an interval
165
- * `x_set[:, 0].min()` returns the minimum value for feature `x1`
166
- * Value of `10` is subtracted for padding
167
- * `stop` parameter
168
- * End of an interval
169
- * `x_set[:, 0].max()` returns the maximum value for feature `x1`
170
- * Value of `10` is added for padding
171
- * `step` parameter
172
- * Spacing between values
173
- * Value of `0.25` is added for spacing
174
- * `x2`
175
- * `arange` function is called with a defined start and stop interval
176
- * `x_set[:, 1]` returns all the rows for feature `x2`
177
- * `start` parameter
178
- * Start of an interval
179
- * `x_set[:, 1].min()` returns the minimum value for feature `x2`
180
- * Value of `1000` is subtracted for padding
181
- * Value of `1000` is used instead of `10` due to the difference
182
- in scaling for feature `x2` vs. feature `x1`
183
- * `stop` parameter
184
- * End of interval
185
- * `x_set[:, 1].max()` returns the maximum value for feature `x2`
186
- * Value of `1000` is added for padding
187
- * `step` parameter
188
- * Spacing between values
189
- * Value of `0.25` is added for spacing
153
+ * The ranges for each axis are controlled by the `meshgrid` dict parameter
154
+ * Two sets of matrices (`x1` and `x2`) are returned with coordinate vectors
155
+ * `x1`
156
+ * `arange` function is called with a defined start and stop interval
157
+ * `x_set[:, 0]` returns all the rows for feature `x1`
158
+ * `start` parameter
159
+ * Start of an interval
160
+ * `x_set[:, 0].min()` returns the minimum value for feature `x1`
161
+ * Value of `10` is subtracted for padding
162
+ * `stop` parameter
163
+ * End of an interval
164
+ * `x_set[:, 0].max()` returns the maximum value for feature `x1`
165
+ * Value of `10` is added for padding
166
+ * `step` parameter
167
+ * Spacing between values
168
+ * Value of `0.25` is added for spacing
169
+ * `x2`
170
+ * `arange` function is called with a defined start and stop interval
171
+ * `x_set[:, 1]` returns all the rows for feature `x2`
172
+ * `start` parameter
173
+ * Start of an interval
174
+ * `x_set[:, 1].min()` returns the minimum value for feature `x2`
175
+ * Value of `1000` is subtracted for padding
176
+ * Value of `1000` is used instead of `10` due to the difference
177
+ in scaling for feature `x2` vs. feature `x1`
178
+ * `stop` parameter
179
+ * End of interval
180
+ * `x_set[:, 1].max()` returns the maximum value for feature `x2`
181
+ * Value of `1000` is added for padding
182
+ * `step` parameter
183
+ * Spacing between values
184
+ * Value of `0.25` is added for spacing
190
185
  * The prediction logic implemented in the `predict` lambda is executed, and
191
186
  the result is assigned to `y_pred`, containing the predictions
192
187
  * `contourf` function from the Matplotlib library is used for creating filled
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "opengood.py_ml_plot"
7
- version = "2.5.0"
7
+ version = "2.6.0"
8
8
  description = "Modules containing reusable functions for machine learning visualization plotting"
9
9
  authors = [
10
10
  { name = "OpenGood", email = "ai@opengood.ai" }
@@ -19,17 +19,17 @@ readme = "README.md"
19
19
  license = { file = "LICENSE" }
20
20
 
21
21
  dependencies = [
22
- "matplotlib >= 3.10.8",
23
- "numpy >= 2.4.3",
24
- "pandas >= 3.0.1",
25
- "scikit-learn >= 1.8.0",
22
+ "matplotlib >= 3.11.2",
23
+ "numpy >= 2.4.4",
24
+ "pandas >= 3.1.0",
25
+ "scikit-learn >= 1.9.1",
26
26
  ]
27
27
 
28
28
  [project.optional-dependencies]
29
29
  dev = [
30
30
  "pip-tools >= 7.5.3",
31
- "pytest >= 9.0.2",
32
- "pytest-cov >= 7.0.0",
31
+ "pytest >= 9.0.3",
32
+ "pytest-cov >= 7.1.0",
33
33
  ]
34
34
 
35
35
  [project.urls]
@@ -53,4 +53,3 @@ norecursedirs = [".git", ".tox", ".venv"]
53
53
  filterwarnings = "ignore::DeprecationWarning"
54
54
  log_cli = true
55
55
  log_cli_level = "INFO"
56
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opengood.py_ml_plot
3
- Version: 2.5.0
3
+ Version: 2.6.0
4
4
  Summary: Modules containing reusable functions for machine learning visualization plotting
5
5
  Author-email: OpenGood <ai@opengood.ai>
6
6
  License: MIT License
@@ -33,14 +33,14 @@ Classifier: Operating System :: OS Independent
33
33
  Requires-Python: >=3.12
34
34
  Description-Content-Type: text/markdown
35
35
  License-File: LICENSE
36
- Requires-Dist: matplotlib>=3.10.8
37
- Requires-Dist: numpy>=2.4.3
38
- Requires-Dist: pandas>=3.0.1
39
- Requires-Dist: scikit-learn>=1.8.0
36
+ Requires-Dist: matplotlib>=3.11.2
37
+ Requires-Dist: numpy>=2.4.4
38
+ Requires-Dist: pandas>=3.1.0
39
+ Requires-Dist: scikit-learn>=1.9.1
40
40
  Provides-Extra: dev
41
41
  Requires-Dist: pip-tools>=7.5.3; extra == "dev"
42
- Requires-Dist: pytest>=9.0.2; extra == "dev"
43
- Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
42
+ Requires-Dist: pytest>=9.0.3; extra == "dev"
43
+ Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
44
44
  Dynamic: license-file
45
45
 
46
46
  # Python Machine Learning (ML) Plot
@@ -127,15 +127,10 @@ setup_classification_plot(
127
127
  0: {"min": 10, "max": 10, "step": 0.25},
128
128
  1: {"min": 1000, "max": 1000, "step": 0.25},
129
129
  },
130
- feature_scale=lambda x_set, y_set: (
131
- sc.inverse_transform(x_set), y_set
132
- ),
133
- predict=lambda x1, x2: (
134
- classifier.predict(
135
- sc.transform(
136
- np.array([x1.ravel(), x2.ravel()]).T)
137
- ).reshape(x1.shape)
138
- ),
130
+ feature_scale=lambda x_set, y_set: (sc.inverse_transform(x_set), y_set),
131
+ predict=lambda x1, x2: classifier.predict(
132
+ sc.transform(np.array([x1.ravel(), x2.ravel()]).T)
133
+ ).reshape(x1.shape),
139
134
  )
140
135
 
141
136
  plt.show()
@@ -158,8 +153,8 @@ plt.show()
158
153
  the `StandardScaler` object `sc` created earlier for feature scaling
159
154
  * `x_set` and `y_set` are assigned non-feature scaled values of the matrix of
160
155
  features and the dependent variable
161
- * `x_set` values are inverted from their feature-scaled values in `x`
162
- * `y_set` values are not inverted and taken directly from `y`
156
+ * `x_set` values are inverted from their feature-scaled values in `x`
157
+ * `y_set` values are not inverted and taken directly from `y`
163
158
 
164
159
  ###### Predict Lambda Logic
165
160
 
@@ -174,11 +169,11 @@ is as follows:
174
169
  scaling
175
170
  * `ravel` function from the NumPy library is used to flatten a
176
171
  multidimensional array into a one-dimensional array
177
- * `x1` and `x2` are flatten into a 1D array via the `ravel` function
178
- * They are then combined via the `array` function from the NumPy
179
- library into a 2D array
180
- * The result is then reshaped via the `reshape` function to match
181
- the shape of `x1`
172
+ * `x1` and `x2` are flatten into a 1D array via the `ravel` function
173
+ * They are then combined via the `array` function from the NumPy
174
+ library into a 2D array
175
+ * The result is then reshaped via the `reshape` function to match
176
+ the shape of `x1`
182
177
 
183
178
  ###### Setup Plot Visualization Logic
184
179
 
@@ -200,38 +195,38 @@ as follows:
200
195
  * `y_set` values are not inverted and taken directly from `y`
201
196
  * `meshgrid` function from the NumPy library returns a tuple of coordinate
202
197
  matrices from coordinate vectors
203
- * The ranges for each axis are controlled by the `meshgrid` dict parameter
204
- * Two sets of matrices (`x1` and `x2`) are returned with coordinate vectors
205
- * `x1`
206
- * `arange` function is called with a defined start and stop interval
207
- * `x_set[:, 0]` returns all the rows for feature `x1`
208
- * `start` parameter
209
- * Start of an interval
210
- * `x_set[:, 0].min()` returns the minimum value for feature `x1`
211
- * Value of `10` is subtracted for padding
212
- * `stop` parameter
213
- * End of an interval
214
- * `x_set[:, 0].max()` returns the maximum value for feature `x1`
215
- * Value of `10` is added for padding
216
- * `step` parameter
217
- * Spacing between values
218
- * Value of `0.25` is added for spacing
219
- * `x2`
220
- * `arange` function is called with a defined start and stop interval
221
- * `x_set[:, 1]` returns all the rows for feature `x2`
222
- * `start` parameter
223
- * Start of an interval
224
- * `x_set[:, 1].min()` returns the minimum value for feature `x2`
225
- * Value of `1000` is subtracted for padding
226
- * Value of `1000` is used instead of `10` due to the difference
227
- in scaling for feature `x2` vs. feature `x1`
228
- * `stop` parameter
229
- * End of interval
230
- * `x_set[:, 1].max()` returns the maximum value for feature `x2`
231
- * Value of `1000` is added for padding
232
- * `step` parameter
233
- * Spacing between values
234
- * Value of `0.25` is added for spacing
198
+ * The ranges for each axis are controlled by the `meshgrid` dict parameter
199
+ * Two sets of matrices (`x1` and `x2`) are returned with coordinate vectors
200
+ * `x1`
201
+ * `arange` function is called with a defined start and stop interval
202
+ * `x_set[:, 0]` returns all the rows for feature `x1`
203
+ * `start` parameter
204
+ * Start of an interval
205
+ * `x_set[:, 0].min()` returns the minimum value for feature `x1`
206
+ * Value of `10` is subtracted for padding
207
+ * `stop` parameter
208
+ * End of an interval
209
+ * `x_set[:, 0].max()` returns the maximum value for feature `x1`
210
+ * Value of `10` is added for padding
211
+ * `step` parameter
212
+ * Spacing between values
213
+ * Value of `0.25` is added for spacing
214
+ * `x2`
215
+ * `arange` function is called with a defined start and stop interval
216
+ * `x_set[:, 1]` returns all the rows for feature `x2`
217
+ * `start` parameter
218
+ * Start of an interval
219
+ * `x_set[:, 1].min()` returns the minimum value for feature `x2`
220
+ * Value of `1000` is subtracted for padding
221
+ * Value of `1000` is used instead of `10` due to the difference
222
+ in scaling for feature `x2` vs. feature `x1`
223
+ * `stop` parameter
224
+ * End of interval
225
+ * `x_set[:, 1].max()` returns the maximum value for feature `x2`
226
+ * Value of `1000` is added for padding
227
+ * `step` parameter
228
+ * Spacing between values
229
+ * Value of `0.25` is added for spacing
235
230
  * The prediction logic implemented in the `predict` lambda is executed, and
236
231
  the result is assigned to `y_pred`, containing the predictions
237
232
  * `contourf` function from the Matplotlib library is used for creating filled
@@ -0,0 +1,9 @@
1
+ matplotlib>=3.11.2
2
+ numpy>=2.4.4
3
+ pandas>=3.1.0
4
+ scikit-learn>=1.9.1
5
+
6
+ [dev]
7
+ pip-tools>=7.5.3
8
+ pytest>=9.0.3
9
+ pytest-cov>=7.1.0
@@ -1,9 +0,0 @@
1
- matplotlib>=3.10.8
2
- numpy>=2.4.3
3
- pandas>=3.0.1
4
- scikit-learn>=1.8.0
5
-
6
- [dev]
7
- pip-tools>=7.5.3
8
- pytest>=9.0.2
9
- pytest-cov>=7.0.0