Skip to content

Commit 670203e

Browse files
committed
rename confusing method name from n_emotions() to get_n_samples()
1 parent c7fd4eb commit 670203e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

deep_emotion_recognition.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ def confusion_matrix(self, percentage=True, labeled=True):
322322
columns=[ f"predicted_{e}" for e in self.emotions ])
323323
return matrix
324324

325-
def n_emotions(self, emotion, partition):
326-
"""Returns number of `emotion` data samples in a particular `partition`
325+
def get_n_samples(self, emotion, partition):
326+
"""Returns number data samples of the `emotion` class in a particular `partition`
327327
('test' or 'train')
328328
"""
329329
if partition == "test":
@@ -348,8 +348,8 @@ def get_samples_by_class(self):
348348
test_samples = []
349349
total = []
350350
for emotion in self.emotions:
351-
n_train = self.n_emotions(self.emotions2int[emotion]+1, "train")
352-
n_test = self.n_emotions(self.emotions2int[emotion]+1, "test")
351+
n_train = self.get_n_samples(self.emotions2int[emotion]+1, "train")
352+
n_test = self.get_n_samples(self.emotions2int[emotion]+1, "test")
353353
train_samples.append(n_train)
354354
test_samples.append(n_test)
355355
total.append(n_train + n_test)

emotion_recognition.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ def draw_confusion_matrix(self):
317317
pl.imshow(matrix, cmap="binary")
318318
pl.show()
319319

320-
def n_emotions(self, emotion, partition):
321-
"""Returns number of `emotion` data samples in a particular `partition`
320+
def get_n_samples(self, emotion, partition):
321+
"""Returns number data samples of the `emotion` class in a particular `partition`
322322
('test' or 'train')
323323
"""
324324
if partition == "test":
@@ -338,8 +338,8 @@ def get_samples_by_class(self):
338338
test_samples = []
339339
total = []
340340
for emotion in self.emotions:
341-
n_train = self.n_emotions(emotion, "train")
342-
n_test = self.n_emotions(emotion, "test")
341+
n_train = self.get_n_samples(emotion, "train")
342+
n_test = self.get_n_samples(emotion, "test")
343343
train_samples.append(n_train)
344344
test_samples.append(n_test)
345345
total.append(n_train + n_test)

0 commit comments

Comments
 (0)