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 / estimate.py View on Github external
    @timeout(1)
    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']

scitime

Training time estimator for scikit-learn algorithms

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis