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

Patch for class_weights #54

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

Conversation

neilyboi
Copy link

@neilyboi neilyboi commented Feb 1, 2024

In the ml_config, current dbt_ml code does not adequately support the 'class_weights' argument for models. This has to do with macros/materializations/model.sql line 29. The BigQuery ML specification for class weights requires an array of structs of key-value pairs to be passed in as a parameter (see here). In dbt, this needs to be passed as a string, as code will not compile with the word 'struct' and curly brace constructors are not supported. However, the current logic for string parameter handling, specifically the | tojson does not work with structs. This simple patch allows for the following types of class weight calls for model creation:

Screenshot 2024-02-01 at 11 05 25 AM

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