4318f75c365f0eabb6230482b2c5c9134e3e2f49,pyinterpret/core/global_interpretation/partial_dependence.py,PartialDependence,_check_grid,#Any#Any#Any#,336

Before Change



    @staticmethod
    def _check_grid(grid, feature_ids, grid_resolution):
        assert isinstance(grid, np.ndarray), "Grid is not a numpy array"
        assert len(grid.shape) == 2, "Grid is not 2D"
        assert len(feature_ids) == grid.shape[0], "There should be as many rows in " \
                                                  "grid as there are features."
        assert grid_resolution == grid.shape[1], "There should be as many columns in " \

After Change


    @staticmethod
    def _check_grid(grid, feature_ids, grid_resolution):

        if not isinstance(grid, np.ndarray):
            err_msg = "Grid of type {} must be a numpy array".format(type(grid))
            raise exceptions.MalformedGridError(err_msg)
        if len(grid.shape) != 2:
            err_msg = "Grid of shape {} not 2D".format(grid.shape)
            raise exceptions.MalformedGridError(grid)

        if len(feature_ids) != grid.shape[0]:
            err_msg = "Given {0} features, there must be {1} rows in grid" \
                      "but {2} were found".format(len(feature_ids),
                                                  len(feature_ids),
                                                  grid.shape[0])
            raise exceptions.MalformedGridError(err_msg)

        if grid_resolution != grid.shape[1]:
            err_msg = "Given {0} grid resolution, there must be {1} columns in grid" \
                      "but {2} were found".format(grid_resolution,
                                                  grid_resolution,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 9

Instances


Project Name: datascienceinc/Skater
Commit Name: 4318f75c365f0eabb6230482b2c5c9134e3e2f49
Time: 2017-03-16
Author: aikramer2@gmail.com
File Name: pyinterpret/core/global_interpretation/partial_dependence.py
Class Name: PartialDependence
Method Name: _check_grid


Project Name: pfnet-research/chainer-chemistry
Commit Name: 6f868707240cc2aa84afaf0d80170f3e2cc1d420
Time: 2018-12-07
Author: acc1ssnn9terias@gmail.com
File Name: chainer_chemistry/link_hooks/variable_monitor_link_hook.py
Class Name: VariableMonitorLinkHook
Method Name: add_process


Project Name: IDSIA/sacred
Commit Name: dc52ab8685236c6e1e7781f91750451e1ea06210
Time: 2019-04-24
Author: ruedigerbusche@web.de
File Name: sacred/observers/mongo.py
Class Name: MongoObserver
Method Name: create


Project Name: pfnet-research/chainer-chemistry
Commit Name: 6f868707240cc2aa84afaf0d80170f3e2cc1d420
Time: 2018-12-07
Author: acc1ssnn9terias@gmail.com
File Name: chainer_chemistry/link_hooks/variable_monitor_link_hook.py
Class Name: VariableMonitorLinkHook
Method Name: __init__