Skip to content

Commit

Permalink
Fixed flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Dang🤖 authored and andyndang committed Feb 22, 2021
1 parent 89c3896 commit f1331c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/whylogs/core/metrics/confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from whylogs.proto import ScoreMatrixMessage
from whylogs.core.statistics import NumberTracker


SUPPORTED_TYPES = ("binary", "multiclass")


Expand All @@ -28,7 +27,7 @@ def __init__(self,
labels: List[str] = None,
prediction_field: str = None,
target_field: str = None,
score_field: str =None):
score_field: str = None):
self.prediction_field = prediction_field
self.target_field = target_field
self.score_field = score_field
Expand Down Expand Up @@ -131,7 +130,7 @@ def from_protobuf(cls, message: ScoreMatrixMessage, ):
return None
labels = message.labels
num_labels = len(labels)
matrix = np.array([NumberTracker.from_protobuf(score)for score in message.scores]).reshape(
matrix = np.array([NumberTracker.from_protobuf(score) for score in message.scores]).reshape(
(num_labels, num_labels)) if num_labels > 0 else None

cm_instance = ConfusionMatrix(labels=labels,
Expand Down Expand Up @@ -162,12 +161,11 @@ def _merge_CM(old_conf_matrix: ConfusionMatrix, new_conf_matrix: ConfusionMatrix

for old_row_idx, each_row_indx in enumerate(new_indxes):
for old_column_idx, each_column_inx in enumerate(new_indxes):

res_conf_matrix.confusion_matrix[each_row_indx, each_column_inx] = \
new_conf_matrix.confusion_matrix[each_row_indx,
each_column_inx].merge(
old_conf_matrix.confusion_matrix[old_indxes[old_row_idx],
old_indxes[old_column_idx]])
old_conf_matrix.confusion_matrix[old_indxes[old_row_idx],
old_indxes[old_column_idx]])

return res_conf_matrix

Expand Down
2 changes: 0 additions & 2 deletions src/whylogs/core/model_profile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import List

from sklearn.utils.multiclass import type_of_target
import numpy as np

Expand Down

0 comments on commit f1331c9

Please sign in to comment.