pyerualjetwork 2.1.3__py3-none-any.whl → 2.1.5__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 +8 -4
- plan_di/plan_di.py +8 -4
- {pyerualjetwork-2.1.3.dist-info → pyerualjetwork-2.1.5.dist-info}/METADATA +1 -1
- pyerualjetwork-2.1.5.dist-info/RECORD +8 -0
- pyerualjetwork-2.1.3.dist-info/RECORD +0 -8
- {pyerualjetwork-2.1.3.dist-info → pyerualjetwork-2.1.5.dist-info}/WHEEL +0 -0
- {pyerualjetwork-2.1.3.dist-info → pyerualjetwork-2.1.5.dist-info}/top_level.txt +0 -0
plan_bi/plan_bi.py
CHANGED
@@ -1131,7 +1131,7 @@ def encode_one_hot(y_train, y_test):
|
|
1131
1131
|
return y_train_encoded, y_test_encoded
|
1132
1132
|
|
1133
1133
|
|
1134
|
-
def split(X, y, test_size
|
1134
|
+
def split(X, y, test_size, random_state):
|
1135
1135
|
"""
|
1136
1136
|
Splits the given X (features) and y (labels) data into training and testing subsets.
|
1137
1137
|
|
@@ -1292,24 +1292,28 @@ def roc_curve(y_true, y_score):
|
|
1292
1292
|
return fpr, tpr, thresholds
|
1293
1293
|
|
1294
1294
|
|
1295
|
-
def confusion_matrix(y_true, y_pred, class_count):
|
1295
|
+
def confusion_matrix(y_true, y_pred, class_count=None):
|
1296
1296
|
"""
|
1297
1297
|
Computes confusion matrix.
|
1298
1298
|
|
1299
1299
|
Args:
|
1300
1300
|
y_true (numpy.ndarray): True class labels (1D array).
|
1301
1301
|
y_pred (numpy.ndarray): Predicted class labels (1D array).
|
1302
|
-
|
1302
|
+
class_count (int, optional): Number of classes. If None, inferred from data.
|
1303
1303
|
|
1304
1304
|
Returns:
|
1305
1305
|
numpy.ndarray: Confusion matrix of shape (num_classes, num_classes).
|
1306
1306
|
"""
|
1307
|
+
if class_count is None:
|
1308
|
+
class_count = len(np.unique(np.concatenate((y_true, y_pred))))
|
1309
|
+
|
1307
1310
|
confusion = np.zeros((class_count, class_count), dtype=int)
|
1308
1311
|
|
1309
1312
|
for i in range(len(y_true)):
|
1310
1313
|
true_label = y_true[i]
|
1311
1314
|
pred_label = y_pred[i]
|
1312
|
-
|
1315
|
+
if true_label < class_count and pred_label < class_count:
|
1316
|
+
confusion[true_label, pred_label] += 1
|
1313
1317
|
|
1314
1318
|
return confusion
|
1315
1319
|
|
plan_di/plan_di.py
CHANGED
@@ -1105,7 +1105,7 @@ def encode_one_hot(y_train, y_test):
|
|
1105
1105
|
return y_train_encoded, y_test_encoded
|
1106
1106
|
|
1107
1107
|
|
1108
|
-
def split(X, y, test_size
|
1108
|
+
def split(X, y, test_size, random_state):
|
1109
1109
|
"""
|
1110
1110
|
Splits the given X (features) and y (labels) data into training and testing subsets.
|
1111
1111
|
|
@@ -1266,24 +1266,28 @@ 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):
|
1269
|
+
def confusion_matrix(y_true, y_pred, class_count=None):
|
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
|
-
|
1276
|
+
class_count (int, optional): Number of classes. If None, inferred from data.
|
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
|
+
|
1281
1284
|
confusion = np.zeros((class_count, class_count), dtype=int)
|
1282
1285
|
|
1283
1286
|
for i in range(len(y_true)):
|
1284
1287
|
true_label = y_true[i]
|
1285
1288
|
pred_label = y_pred[i]
|
1286
|
-
|
1289
|
+
if true_label < class_count and pred_label < class_count:
|
1290
|
+
confusion[true_label, pred_label] += 1
|
1287
1291
|
|
1288
1292
|
return confusion
|
1289
1293
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.5
|
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=wfffeqlZXS7EPrEiI533EIrWZFOE-pThdK8LFn66IUM,46988
|
3
|
+
plan_di/__init__.py,sha256=Eut7tVtvQaczEejYyqfQ4eqF71j69josJcY91WN_dkk,508
|
4
|
+
plan_di/plan_di.py,sha256=jKLwKY-Imh0IXVmaOS9xi7enPAV07QfZFvwe2qDPHAs,44366
|
5
|
+
pyerualjetwork-2.1.5.dist-info/METADATA,sha256=6j5OCAQdkAKkVMkP08jTESQj9BeL4mAh9kiCPE93gN0,457
|
6
|
+
pyerualjetwork-2.1.5.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
7
|
+
pyerualjetwork-2.1.5.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
|
8
|
+
pyerualjetwork-2.1.5.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
plan_bi/__init__.py,sha256=82q8bWRYqzwMrFuViQzBg7P19i6EqdV7VYBVxuQ-LV0,517
|
2
|
-
plan_bi/plan_bi.py,sha256=GwkLWUB6cQdiNUTZICEHfUdzNPitVj-KMO9btIhi6sA,46775
|
3
|
-
plan_di/__init__.py,sha256=Eut7tVtvQaczEejYyqfQ4eqF71j69josJcY91WN_dkk,508
|
4
|
-
plan_di/plan_di.py,sha256=HGG5JDORXcxrljk7mHpq4nwKKzR9se2yhMS4S0T3zY8,44153
|
5
|
-
pyerualjetwork-2.1.3.dist-info/METADATA,sha256=-8p_wTatYlyDwRUd66Y1GZG8SJimkQ8RIOv1b2LAEC4,457
|
6
|
-
pyerualjetwork-2.1.3.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
7
|
-
pyerualjetwork-2.1.3.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
|
8
|
-
pyerualjetwork-2.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|