ed9179bb9f9bc1d55d5977615f364c26641dfe3f,src/metamodels/crosscat.py,CrosscatMetamodel,create_generator,#CrosscatMetamodel#Any#Any#Any#Any#,497

Before Change


            qt = sqlite3_quote_name(table)
            cursor = None
            if do_subsample:
                cursor = bdb.sql_execute("""
                    SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC LIMIT ?
                """ % (qt,), (do_subsample,))
            else:
                cursor = bdb.sql_execute("""
                     SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC
                """ % (qt,))

After Change


                // XXX Let the user pass in a seed.
                k = do_subsample
                sql = "SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC" % (qt,)
                cursor = bdb.sql_execute(sql)
                rowids = [row[0] for row in cursor]
                n = len(rowids)
                seed = struct.pack("<QQQQ", 0, 0, k, n)
                uniform = weakprng.weakprng(seed).weakrandom_uniform
                randomly_permute(rowids, uniform)
                rowids = rowids[:k]
                cursor = ((rowid,) for rowid in rowids)
            else:
                cursor = bdb.sql_execute("""
                     SELECT _rowid_ FROM %s ORDER BY _rowid_ ASC
                """ % (qt,))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: probcomp/bayeslite
Commit Name: ed9179bb9f9bc1d55d5977615f364c26641dfe3f
Time: 2015-09-23
Author: riastradh+probcomp@csail.mit.edu
File Name: src/metamodels/crosscat.py
Class Name: CrosscatMetamodel
Method Name: create_generator


Project Name: probcomp/bayeslite
Commit Name: 0780f7ce1d347c7f20591865451aa5583d5dfcb6
Time: 2015-06-04
Author: riastradh+probcomp@csail.mit.edu
File Name: src/crosscat.py
Class Name: CrosscatMetamodel
Method Name: _crosscat_data


Project Name: probcomp/bayeslite
Commit Name: cafe7cc9cd3678163cf50ac554b723ce226f268f
Time: 2017-02-04
Author: fsaad@mit.edu
File Name: src/bql.py
Class Name:
Method Name: _create_population