Skip to content

Commit

Permalink
Merge pull request #81 from eustomaqua/master
Browse files Browse the repository at this point in the history
Correct the random_seed in ``classify.py''
  • Loading branch information
zzy14 authored Aug 12, 2019
2 parents 1e5eae6 + e717872 commit d9cbf34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/openne/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def main(args):
print("Training classifier using {:.2f}% nodes...".format(
args.clf_ratio*100))
clf = Classifier(vectors=vectors, clf=LogisticRegression())
clf.split_train_evaluate(X, Y, args.clf_ratio)
clf.split_train_evaluate(X, Y, args.clf_ratio, seed=0)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion src/openne/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def predict(self, X, top_k_list):
Y = self.clf.predict(X_, top_k_list=top_k_list)
return Y

def split_train_evaluate(self, X, Y, train_precent, seed=0):
def split_train_evaluate(self, X, Y, train_precent, seed=None):
state = numpy.random.get_state()

training_size = int(train_precent * len(X))
Expand Down

0 comments on commit d9cbf34

Please sign in to comment.