Source code for api.views.runmanager_auto_rule

import json
from rest_framework.response import Response
from rest_framework.views import APIView
from master.automl.automl_rule import AutoMlRule
from django.core import serializers
import coreapi

[docs]class RunManagerAutoRule(APIView): coreapi_fields = ( coreapi.Field( name='netconf_node', required=True, type='string', ), coreapi.Field( name='datasrc', required=True, type='string', ), coreapi.Field( name='evaldata', required=True, type='string', ), coreapi.Field( name='evalnode', required=True, type='string', ), )
[docs] def post(self, request, graph_id): """ Manage AutoML define information include (id, desc and etc ) \n Structure : AutoML - NetID - NetVer(Auto Generated by GA) - NetBatch (auto generated on every batch) \n (1) Define AutoML Graph definition (<- for this step) \n (2) Select Type of Data (<- for this step)\n (3) Select Type of Anal algorithm (<- for this step)\n (4) Select range of hyper parameters (<- for this step)\n (5) Run - AutoML \n (6) Check result of each generation with UI/UX \n (7) Select Best model you want use and activate it \n --- # Class Name : RunManagerAutoRule # Description: Set AutoML description, This is necessary process if you want to use automatically tune hyperparameters for deep learning algorithms """ try: return_data = AutoMlRule().set_graph_type_list(graph_id, request.data) return Response(json.dumps(return_data)) except Exception as e: return_data = {"status": "404", "result": str(e)} return Response(json.dumps(return_data))
[docs] def get(self, request, graph_id): """ Manage AutoML define information include (id, desc and etc ) \n Structure : AutoML - NetID - NetVer(Auto Generated by GA) - NetBatch (auto generated on every batch) \n (1) Define AutoML Graph definition (<- for this step) \n (2) Select Type of Data (<- for this step)\n (3) Select Type of Anal algorithm (<- for this step)\n (4) Select range of hyper parameters (<- for this step)\n (5) Run - AutoML \n (6) Check result of each generation with UI/UX \n (7) Select Best model you want use and activate it \n --- # Class Name : RunManagerAutoRule # Description: Get AutoML description include hyperparameters for deep learning algorithms """ try: if graph_id.isdigit() == True : return_data = AutoMlRule().get_graph_type_list(graph_id) elif graph_id is not None : return_data = AutoMlRule().get_graph_info(graph_id) else : raise Exception("no vailed graph_id") return Response(json.dumps(return_data)) except Exception as e: return_data = {"status": "404", "result": str(e)} return Response(json.dumps(return_data))
[docs] def put(self, request, graph_id): """ Manage AutoML define information include (id, desc and etc ) \n Structure : AutoML - NetID - NetVer(Auto Generated by GA) - NetBatch (auto generated on every batch) \n (1) Define AutoML Graph definition (<- for this step) \n (2) Select Type of Data (<- for this step)\n (3) Select Type of Anal algorithm (<- for this step)\n (4) Select range of hyper parameters (<- for this step)\n (5) Run - AutoML \n (6) Check result of each generation with UI/UX \n (7) Select Best model you want use and activate it \n --- # Class Name : RunManagerAutoRule # Description: Modify AutoML description include hyperparameters for deep learning algorithms """ try: return_data = AutoMlRule().update_graph_type_list(graph_id, request.data) return Response(json.dumps(return_data)) except Exception as e: return_data = {"status": "404", "result": str(e)} return Response(json.dumps(return_data))
[docs] def delete(self, request, graph_id): """ Manage AutoML define information include (id, desc and etc ) \n Structure : AutoML - NetID - NetVer(Auto Generated by GA) - NetBatch (auto generated on every batch) \n (1) Define AutoML Graph definition (<- for this step) \n (2) Select Type of Data (<- for this step)\n (3) Select Type of Anal algorithm (<- for this step)\n (4) Select range of hyper parameters (<- for this step)\n (5) Run - AutoML \n (6) Check result of each generation with UI/UX \n (7) Select Best model you want use and activate it \n --- # Class Name : RunManagerAutoRule # Description: Delete AutoML description include hyperparameters for deep learning algorithms This will remove all realted information (nn_id, ver, batch and model) """ try: return_data = "" return Response(json.dumps(return_data)) except Exception as e: return_data = {"status": "404", "result": str(e)} return Response(json.dumps(return_data))