Joint Optimization

Some algorithms support joint optimization of the task across multiple outputs, which can improve results compared to using multiple independent models.

To leverage multiple outputs in PostgresML, you'll need to substitute the standard usage of pgml.train() with pgml.train_joint(), which has the same API, except the notable exception of y_column_name parameter, which now accepts an array instead of a simple string.

content_copy link edit
SELECT * FROM pgml.train_join(
'My Joint Project',
task => 'regression',
relation_name => 'my_table',
y_column_name => ARRAY['target_a', 'target_b'],

You can read more in scikit-learn documentation.

Have Questions?

Join our Discord and ask us anything! We're friendly and would love to talk about PostgresML.

Try It Out

Try PostresML using our free serverless cloud. It comes with GPUs, 5 GiB of space and plenty of datasets to get you started.

Powered by PostgresML Logo PostgresML