Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix CVModel in TopicMembershipModel #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lukevs
Copy link

@lukevs lukevs commented Aug 6, 2023

The constructor for CVModel in TopicMembershipModel is incorrect and is causing adatest to throw errors when generating topics:

TypeError: CVModel.__init__() missing 2 required positional arguments: 'embeddings' and 'labels'

Removed the fit call because it happens internally in the __init__.

Also fixed the init to set class_weight to 1 for the passed in labels, instead of assuming labels are "pass" / "fail" (for TopicMembershipModel they are "on_topic" / "off_topic") - I think class_weight = 1 is the default behavior, but will keep for consistency

Now matches the other CVModel usage here: https://github.com/microsoft/adatest/blob/a77b5968dca69480aaf11af9a326bafab7c345a8/adatest/_topic_model.py#L93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant