pyerualjetwork 2.1.6__py3-none-any.whl → 2.1.7__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.
plan_bi/plan_bi.py CHANGED
@@ -1331,7 +1331,7 @@ def plot_evaluate(y_test, y_preds, acc_list):
1331
1331
  y_preds = np.array(y_preds)
1332
1332
  fpr, tpr, thresholds = roc_curve(y_true, y_preds)
1333
1333
  precision, recall, f1 = metrics(y_test, y_preds)
1334
- Class = np.unique(y_test)
1334
+ Class = np.unique(decode_one_hot(y_test))
1335
1335
 
1336
1336
 
1337
1337
  cm = confusion_matrix(y_true, y_preds, len(Class))
plan_di/plan_di.py CHANGED
@@ -1266,32 +1266,24 @@ def roc_curve(y_true, y_score):
1266
1266
  return fpr, tpr, thresholds
1267
1267
 
1268
1268
 
1269
- def confusion_matrix(y_true, y_pred, class_count=None):
1269
+ def confusion_matrix(y_true, y_pred, class_count):
1270
1270
  """
1271
1271
  Computes confusion matrix.
1272
1272
 
1273
1273
  Args:
1274
1274
  y_true (numpy.ndarray): True class labels (1D array).
1275
1275
  y_pred (numpy.ndarray): Predicted class labels (1D array).
1276
- class_count (int, optional): Number of classes. If None, inferred from data.
1276
+ num_classes (int): Number of classes.
1277
1277
 
1278
1278
  Returns:
1279
1279
  numpy.ndarray: Confusion matrix of shape (num_classes, num_classes).
1280
1280
  """
1281
- if class_count is None:
1282
- class_count = len(np.unique(np.concatenate((y_true, y_pred))))
1283
-
1284
1281
  confusion = np.zeros((class_count, class_count), dtype=int)
1285
1282
 
1286
1283
  for i in range(len(y_true)):
1287
1284
  true_label = y_true[i]
1288
1285
  pred_label = y_pred[i]
1289
-
1290
- # Ensure that true_label and pred_label are within the correct range
1291
- if 0 <= true_label < class_count and 0 <= pred_label < class_count:
1292
- confusion[true_label, pred_label] += 1
1293
- else:
1294
- print(f"Warning: Ignoring out of range label - True: {true_label}, Predicted: {pred_label}")
1286
+ confusion[true_label, pred_label] += 1
1295
1287
 
1296
1288
  return confusion
1297
1289
 
@@ -1305,7 +1297,7 @@ def plot_evaluate(y_test, y_preds, acc_list):
1305
1297
  y_preds = np.array(y_preds)
1306
1298
  fpr, tpr, thresholds = roc_curve(y_true, y_preds)
1307
1299
  precision, recall, f1 = metrics(y_test, y_preds)
1308
- Class = np.unique(y_test)
1300
+ Class = np.unique(decode_one_hot(y_test))
1309
1301
 
1310
1302
  # Confusion matrix
1311
1303
  cm = confusion_matrix(y_true, y_preds, len(Class))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 2.1.6
3
+ Version: 2.1.7
4
4
  Summary: 8 new functions: multiple_evaluate , encode_one_hot, split, metrics, decode_one_hot, roc_curve, confusion_matrix, plot_evaluate And Code improvements (Documentation in desc. Examples in GİTHUB: https://github.com/HCB06/PyerualJetwork)
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -0,0 +1,8 @@
1
+ plan_bi/__init__.py,sha256=82q8bWRYqzwMrFuViQzBg7P19i6EqdV7VYBVxuQ-LV0,517
2
+ plan_bi/plan_bi.py,sha256=m8KZHORNNPyNxglFn25oLPcUoz6H7GA6c6QdS6l79XE,47219
3
+ plan_di/__init__.py,sha256=Eut7tVtvQaczEejYyqfQ4eqF71j69josJcY91WN_dkk,508
4
+ plan_di/plan_di.py,sha256=vvAnYRA9NM3PXOk7gXp4aX9UHRsPZUVq50Rz2wwdc1Q,44160
5
+ pyerualjetwork-2.1.7.dist-info/METADATA,sha256=ptRD_gNFfDWdq_EiYZgfG-vDPbq6KUiQNYNI2bUL-J4,457
6
+ pyerualjetwork-2.1.7.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
7
+ pyerualjetwork-2.1.7.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
8
+ pyerualjetwork-2.1.7.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- plan_bi/__init__.py,sha256=82q8bWRYqzwMrFuViQzBg7P19i6EqdV7VYBVxuQ-LV0,517
2
- plan_bi/plan_bi.py,sha256=mfBNSNqoTtXKvPZNCZuNYkVJnkOmg1JpM2FsLhE0nak,47203
3
- plan_di/__init__.py,sha256=Eut7tVtvQaczEejYyqfQ4eqF71j69josJcY91WN_dkk,508
4
- plan_di/plan_di.py,sha256=fiaYet8F6N1ad3xIvzLwgUZwridxuc-i03cZifoyJfc,44581
5
- pyerualjetwork-2.1.6.dist-info/METADATA,sha256=T2M8jWa5LYTkdXcTrzmoHOKVeGdVdgrf_1UXaomsOw4,457
6
- pyerualjetwork-2.1.6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
7
- pyerualjetwork-2.1.6.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
8
- pyerualjetwork-2.1.6.dist-info/RECORD,,