Skip to content

Commit

Permalink
Remove the usage of the deprecated parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
drivanov committed Sep 27, 2024
1 parent adbefc6 commit a7f502e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def compute_acc(emb, labels, train_nids, val_nids, test_nids):
labels = labels.cpu().numpy()

emb = (emb - emb.mean(0, keepdims=True)) / emb.std(0, keepdims=True)
lr = lm.LogisticRegression(multi_class="multinomial", max_iter=10000)
lr = lm.LogisticRegression(max_iter=10000)
lr.fit(emb[train_nids], labels[train_nids])

pred = lr.predict(emb)
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/graphsage/advanced/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def compute_acc_unsupervised(emb, labels, train_nids, val_nids, test_nids):

emb = (emb - emb.mean(0, keepdims=True)) / emb.std(0, keepdims=True)

lr = lm.LogisticRegression(multi_class="multinomial", max_iter=10000)
lr = lm.LogisticRegression(max_iter=10000)
lr.fit(emb[train_nids], train_labels)

pred = lr.predict(emb)
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/graphsage/dist/train_dist_unsupervised.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def compute_acc(emb, labels, train_nids, val_nids, test_nids):
labels = labels.cpu().numpy()

emb = (emb - emb.mean(0, keepdims=True)) / emb.std(0, keepdims=True)
lr = lm.LogisticRegression(multi_class="multinomial", max_iter=10000)
lr = lm.LogisticRegression(max_iter=10000)
lr.fit(emb[train_nids], labels[train_nids])

pred = lr.predict(emb)
Expand Down
4 changes: 2 additions & 2 deletions examples/pytorch/metapath2vec/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@
file.close()
print("beging predicting")

Check warning on line 96 in examples/pytorch/metapath2vec/test.py

View workflow job for this annotation

GitHub Actions / lintrunner

UFMT format

Run `lintrunner -a` to apply this patch.
clf_venue = LogisticRegression(
random_state=0, solver="lbfgs", multi_class="multinomial"
random_state=0, solver="lbfgs"
).fit(venue_training, venue_label)
y_pred_venue = clf_venue.predict(venue_testing)
clf_author = LogisticRegression(
random_state=0, solver="lbfgs", multi_class="multinomial"
random_state=0, solver="lbfgs"
).fit(author_training, author_label)
y_pred_author = clf_author.predict(author_testing)
macro_average_venue += f1_score(
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/multigpu/multi_gpu_link_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def compute_acc_unsupervised(emb, labels, train_nids, val_nids, test_nids):
test_nids = test_nids.cpu().numpy()
test_labels = labels[test_nids]
emb = (emb - emb.mean(0, keepdims=True)) / emb.std(0, keepdims=True)
lr = lm.LogisticRegression(multi_class="multinomial", max_iter=10000)
lr = lm.LogisticRegression(max_iter=10000)
lr.fit(emb[train_nids], train_labels)
pred = lr.predict(emb)
f1_micro_eval = skm.f1_score(val_labels, pred[val_nids], average="micro")
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/node2vec/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def evaluate(self, x_train, y_train, x_val, y_val):
x_train, y_train = x_train.cpu().numpy(), y_train.cpu().numpy()
x_val, y_val = x_val.cpu().numpy(), y_val.cpu().numpy()

Check warning on line 192 in examples/pytorch/node2vec/model.py

View workflow job for this annotation

GitHub Actions / lintrunner

UFMT format

Run `lintrunner -a` to apply this patch.
lr = LogisticRegression(
solver="lbfgs", multi_class="auto", max_iter=150
solver="lbfgs", max_iter=150
).fit(x_train, y_train)

return lr.score(x_val, y_val)
Expand Down

0 comments on commit a7f502e

Please sign in to comment.