How to use the a2ml.api.azure.project.AzureProject function in a2ml

To help you get started, we’ve selected a few a2ml 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 augerai / a2ml / a2ml / api / azure / dataset.py View on Github external
def _get_ws(self, create_if_not_exist = False):
        if self.ws is None:
            self.ws = AzureProject(self.ctx)._get_ws(
                create_if_not_exist=create_if_not_exist)
        return self.ws
github augerai / a2ml / a2ml / api / azure / project.py View on Github external
def __init__(self, ctx):
        super(AzureProject, self).__init__()
        self.ctx = ctx
        self.credentials = Credentials(self.ctx).load()
        self.credentials.verify()
github augerai / a2ml / a2ml / api / azure / experiment.py View on Github external
def stop(self, run_id = None):
        ws = AzureProject(self.ctx)._get_ws()
        experiment_name = self.ctx.config.get('experiment/name', None)
        if experiment_name is None:
            raise AzureException('Please specify Experiment name...')
        if run_id is None:
            run_id = self.ctx.config.get('experiment/run_id', None)
        if run_id is None:
            raise AzureException(
                'Pleae provide Run ID (experiment/run_id)...')
        experiment = Experiment(ws, experiment_name)
        run = AutoMLRun(experiment = experiment, run_id = run_id)
        run.cancel()
        return {'stopped': experiment_name}
github augerai / a2ml / a2ml / api / azure / experiment.py View on Github external
def list(self):
        ws = AzureProject(self.ctx)._get_ws()
        experiments = Experiment.list(workspace=ws)
        nexperiments = len(experiments)
        experiments = [e.name for e in experiments]
        for name in experiments:
            self.ctx.log(name)
        self.ctx.log('%s Experiment(s) listed' % str(nexperiments))
        return {'experiments': experiments}
github augerai / a2ml / a2ml / api / azure / model.py View on Github external
def _get_experiment(self):
        from azureml.core import Experiment
        from .project import AzureProject

        ws = AzureProject(self.ctx)._get_ws()
        experiment_name = self.ctx.config.get('experiment/name', None)
        if experiment_name is None:
            raise AzureException('Please specify Experiment name...')
        experiment = Experiment(ws, experiment_name)

        return ws, experiment