Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Saving prediction results on cikm contest data #238

Merged
merged 9 commits into from
Jul 18, 2022

Conversation

DavdGao
Copy link
Collaborator

@DavdGao DavdGao commented Jul 15, 2022

  • This PR is a temporary solution to save prediction results on the cikmcup dataset.
  • It will be updated soon.
  • It should be merged after the PR Some modification for CIKMCUP #227

def save_prediction(self, client_id, task_type):
y_inds, y_probs = self.ctx.test_y_inds, self.ctx.test_y_prob
if 'classification' in task_type:
y_probs = np.argmax(y_probs, axis=-1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y_preds = np.argmax(y_probs, axis=-1)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified accordingly

@DavdGao DavdGao requested a review from joneswong July 18, 2022 01:40
@joneswong joneswong added the Feature New feature label Jul 18, 2022
@DavdGao DavdGao changed the base branch from master to cikm22competition July 18, 2022 02:50
@@ -69,6 +84,21 @@ def _hook_on_batch_forward_flop_count(self, ctx):
self.ctx.monitor.total_flops += self.ctx.monitor.flops_per_sample * \
ctx.batch_size

def save_prediction(self, client_id, task_type):
y_inds, y_probs = self.ctx.test_y_inds, self.ctx.test_y_prob
os.makedirs('../prediction', exist_ok=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is "../" necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified accordingly

Copy link
Collaborator

@joneswong joneswong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DavdGao DavdGao merged commit e772811 into alibaba:cikm22competition Jul 18, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants