-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
One task to train + infer, the other to load the data. Some caveats due to the earliness of the dbt API.
73e5edc
to
48e9dd4
Compare
e1f6056
to
096132f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Will need to publish a new example docker image once we merge this.
examples/dbt/models/predict.py
Outdated
titanic_dag = driver.Driver( | ||
{ | ||
"random_state": 5, | ||
"test_size": 0.2, | ||
"model_to_use": "create_new", | ||
}, | ||
data_loader, | ||
feature_transforms, | ||
model_pipeline, | ||
adapter=adapter, | ||
) | ||
# gather resutls | ||
results = titanic_dag.execute( | ||
final_vars=["model_predict"], inputs={"raw_passengers_df": raw_passengers_df} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the inference set, is just all the data, i.e. the training set. Not a separate set or anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, was too happy earlier -- a few corrections required given what is actually being returned/predicted over.
examples/dbt/models/predict.py
Outdated
@@ -0,0 +1,44 @@ | |||
def model(dbt, session): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah so predict
probably isn't the right name of this file.
examples/dbt/README.md
Outdated
We've organized the code into two separate DBT models: | ||
1. [raw_passengers](models/raw_passengers.sql) This is a simple select and join using duckdb and DBT. Due to the simplicity of DBT -- its just as you would write if it were embedded within a python program, or you were executing SQL on your own! | ||
It does, however, automatically get materialized. | ||
2. [predict](models/predict.py) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the name of this.
examples/dbt/README.md
Outdated
|
||
- feature engineering to extract a test/train set | ||
- train a model using the train set | ||
- run inference over an inference set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- run inference over an inference set | |
- run inference over the entire data set... |
096132f
to
5676b14
Compare
Shows how Hamilton + DBT work together
Changes
Adds a
dbt/
in theexamples
directory.How I tested this
Ran locally.
Notes
Its simple, but a good start and will work for a write-up.
Checklist