How to use the scitime._utils.timeout function in scitime

To help you get started, we’ve selected a few scitime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nathan-toubiana / scitime / scitime / View on Github external
    def _fit_start(self, algo, X, y=None):
        starts fitting the model on a small subset of the data
        to make sure the fit is legit, throws error if error happens before
        1 sec raises or a TimeoutError if no other exception is raised
        before used in the .time function

        :param algo: algo used
        :param X: inputs for the algo
        :param y: outputs for the algo
        algo.verbose = 0
        param_dic = self._fetch_algo_metadata(algo)
        params = param_dic['config']
        algo_type = params['type']