probcomp / bayeslite

BayesDB on SQLite. A Bayesian database table for querying the probable implications of data as easily as SQL databases query the data itself.
http://probcomp.csail.mit.edu/software/bayesdb
Apache License 2.0
918 stars 64 forks source link

ALTER POPULATION not available in Loom #625

Open versar opened 6 years ago

versar commented 6 years ago

The following code:

%mml ALTER POPULATION data ADD VARIABLE cluster_1 nominal;

fails in Jupyter with the following behavior:

Even if Loom does not support adding iterations of ANALYZE, being unable to alter the population is still an issue because it is necessary for certain plotting workflows in exploratory data analysis. One example workflow is:

interactive_pairplot does not allow plotting a non-modeled variable, so the exploratory workflow above fails without the availability of ALTER POPULATION.

fsaad commented 6 years ago

The Loom backend does not have support for incremental updates such as adding/remove new rows or new variables. Trying to use ALTER POPULATION ... ADD VARIABLE ... causes a NotImplementedError to be thrown.

The reason that interactive_pairplot needs a population is to infer the stattypes. In terms of the plotting workflow you described for plotting one option is to create a new table and population that include the new column.

A second option is for us to extend the command line interface of interactive_pairplot so that it can take additional stattypes directly from the user.

(As for the Jupyter error message, it is capturing the stack trace from the NotImplementedError that was raised and is trying to print a succinct error message, although the error that is raised does not have custom message so you just see a pink output bar with no message.)