probcomp / bdbcontrib

BayesDB contributions, including plotting, helper methods, and examples
http://probcomp.csail.mit.edu/bayesdb
Apache License 2.0
9 stars 6 forks source link

Request: Draw_state for gpmcc #139

Open BelhalK opened 8 years ago

BelhalK commented 8 years ago

The draw_state function I'm using from crosscat.utils does not work with gpmcc as it is because of :

Would be great to adapt it to gpmcc. @gregory-marton would be happy to help on that.

fsaad commented 8 years ago

Plus one on the feature request, roughly the way to achieve this feature with maximum code reuse of draw_state is

gregory-marton commented 8 years ago

@fsaad if you're not sure of the exact details of using those vars, I'm not sure who is. Can you clarify what you're unsure about? Is it something we should discuss?

Belhal, you said you might work on it before I did. Have you?

BelhalK commented 8 years ago

I did. The 'exact details' of @fsaad are wrt the combination of those vars to make this following function work:

DrawStateUtils.sort_state(X_L, X_D, M_c, T)

Ultimately, making it work will solve DrawStateUtils.gen_cell_colors output.

The first strategy consist in building the new X_L, X_D and M_c with gpmcc metadat. For instance, we know that:

scheme = bu.query(first,'''select engine_json from gpmcc_generator where generator_id= 1;''')
X_D = schema['states'][0]['Zrv']

and that X_L['column_partition']['assignments'] = schema['states'][0]['Zv']

I am looking at https://github.com/probcomp/gpmcc_metamodel/blob/master/gpmcc_metamodel/utils/convert.py script to kind of write the inverse conversion (gpmcc to lovcat)