|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import fire
- import os
- import joblib
- import numpy as np
- import learnware
-
- from sklearn import svm
- from learnware.market import EasyMarket, BaseUserInfo
- from learnware.market import database_ops
- from learnware.learnware import Learnware
- import learnware.specification as specification
- from learnware.utils import get_module_by_module_path
-
-
- class LearnwareMarketWorkflow:
- curr_root = os.path.dirname(os.path.abspath(__file__))
-
- semantic_specs = [
- {
- "Data": {"Values": ["Tabular"], "Type": "Class"},
- "Task": {
- "Values": ["Classification"],
- "Type": "Class",
- },
- "Device": {"Values": ["GPU"], "Type": "Tag"},
- "Scenario": {"Values": ["Nature"], "Type": "Tag"},
- "Description": {"Values": "", "Type": "Description"},
- "Name": {"Values": "learnware_1", "Type": "Name"},
- },
- {
- "Data": {"Values": ["Tabular"], "Type": "Class"},
- "Task": {
- "Values": ["Classification"],
- "Type": "Class",
- },
- "Device": {"Values": ["GPU"], "Type": "Tag"},
- "Scenario": {"Values": ["Business", "Nature"], "Type": "Tag"},
- "Description": {"Values": "", "Type": "Description"},
- "Name": {"Values": "learnware_2", "Type": "Name"},
- },
- {
- "Data": {"Values": ["Tabular"], "Type": "Class"},
- "Task": {
- "Values": ["Classification"],
- "Type": "Class",
- },
- "Device": {"Values": ["GPU"], "Type": "Tag"},
- "Scenario": {"Values": ["Business"], "Type": "Tag"},
- "Description": {"Values": "", "Type": "Description"},
- "Name": {"Values": "learnware_3", "Type": "Name"},
- },
- ]
-
- user_senmantic = {
- "Data": {"Values": ["Tabular"], "Type": "Class"},
- "Task": {
- "Values": ["Classification"],
- "Type": "Class",
- },
- "Device": {"Values": ["GPU"], "Type": "Tag"},
- "Scenario": {"Values": ["Business"], "Type": "Tag"},
- "Description": {"Values": "", "Type": "Description"},
- "Name": {"Values": "", "Type": "Name"},
- }
-
- def _init_learnware_market(self):
- """initialize learnware market"""
- database_ops.clear_learnware_table()
- learnware.init()
-
- self.learnware_market = EasyMarket()
-
- def _generate_learnware_randomly(self):
- pass
-
- # def _
-
-
- if __name__ == "__main__":
- fire.Fire(LearnwareMarketWorkflow)
|