Skip to content

Commit be7c74b

Browse files
authored
fixes
1 parent bfc0a36 commit be7c74b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/GoldStandardComparison.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,6 @@ def KVector(keep,K,diff,id_graphs,numberoccurences,LENGTHGRAPH,labels):
677677
import sys, getopt
678678

679679
def graphKeep(Graphes,labels):
680-
MAXG = 400
681-
nbc = 0
682680
"""Equilibrate the number of graphs in each class"""
683681
### Equilibre dataset
684682
if len(labels)-sum(labels)>sum(labels):
@@ -688,21 +686,21 @@ def graphKeep(Graphes,labels):
688686
minority =0
689687
NbMino=len(labels)-sum(labels)
690688
keep = []
689+
NbMino = 0
691690
count=0
692691
graphs=[]
693692
for i in range(len(labels)):
694-
if labels[i]==minority and nbc < MAXG:
693+
if labels[i]==minority:
694+
NbMino=NbMino+1
695695
keep.append(i)
696-
nbc=nbc+1
697-
#complete=NbMino
698-
complete = MAXG
696+
complete=NbMino
699697
for i in range(len(labels)):
700698
if labels[i]!=minority:
701699
if count<complete:
702700
count=count+1
703701
keep.append(i)
704-
return keep
705702

703+
return keep
706704

707705

708706
def cross_validation(X,Y,cv,classifier):

0 commit comments

Comments
 (0)