probcomp/bayeslite

gracefully report error in CGPM for latent categoricals without specified number of categories

Open

#461 建立於 2016年7月15日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Python (915 star) (63 fork)batch import
help wantedk min/hr

描述

CREATE GENERATOR g FOR p USING cgpm (
    LATENT y CATEGORICAL,
    MODEL y GIVEN x USING whatever,
    MODEL z GIVEN y USING frobnosticator
)

In order to use the latent categorical (or, 'nominal') variable y as an input of the frobnosticator model, CGPM wants to know fictitious distribution parameters, namely the number of categories (or, 'names' or 'labels'), but there is no way to ascertain this because x is latent and does not actually appear in the table. The _default_categorical (or, _default_nominal) method will fail trying to select a nonexistent variable from the table -- or maybe quietly return 1 because of the usual sqlite3 quotation misfeature.

Not tested; observed by code inspection.

Alternative fix: Obviate the need to specify fictitious distribution parameters. This requires changes to CGPM.

貢獻者指南

gracefully report error in CGPM for latent categoricals without specified number of categories · probcomp/bayeslite#461 | Good First Issue