colda.workflow.train_workflow.sponsor package
Submodules
colda.workflow.train_workflow.sponsor.api module
- class colda.workflow.train_workflow.sponsor.api.TrainSponsorFindAssistor
Bases:
TrainBaseWorkflow
Handle sponsor train find assistor.
Methods
find_assistor
- classmethod find_assistor(max_round: int, assistors: list, train_file_path: str, train_id_column: str, train_data_column: str, train_target_column: str, task_mode: Literal['classification', 'regression'], model_name: Literal['linear', 'decision_tree', 'svm', 'gradient_boosting', 'mlp'], metric_name: Literal['MAD', 'RMSE', 'R2', 'Accuracy', 'F1', 'AUCROC'], task_name: str | None = None, task_description: str | None = None) str
Execute sponsor find assistor logic.
Parameters
maxRound : int assistors : list train_file_path : str train_id_column : str train_data_column : str train_target_column : str task_mode : Task_Mode model_name : Model_Name metric_name : Metric_Name task_name : str=None task_description : str=None
Returns
None
- class colda.workflow.train_workflow.sponsor.api.TrainSponsorMatchIdentifier
Bases:
TrainBaseWorkflow
Handle sponsor match identifier stage.
Methods
train_sponsor_match_identifier
- class colda.workflow.train_workflow.sponsor.api.TrainSponsorOutput
Bases:
TrainBaseWorkflow
Handle sponsor train output stage.
Methods
train_sponsor_output
- classmethod train_calculate_next_round_residual(user_id: str, train_id: str, train_file_path: str, train_target_column: str, task_mode: Literal['classification', 'regression'], metric_name: Literal['MAD', 'RMSE', 'R2', 'Accuracy', 'F1', 'AUCROC'], cur_rounds_num: int, sponsor_matched_identifers: Any, last_round_result: Any) None
Handle stages in new round.
Parameters
user_id : str train_id : str train_file_path : str train_target_column : str task_mode : Task_Mode metric_name : Metric_Name cur_rounds_num : int sponsor_matched_identifers : Any last_round_result : Any
Returns
None
- classmethod train_calculate_result(user_id: str, train_id: str, cur_rounds_num: int, assistor_random_id_to_output_content_dict: dict[str, Any]) None
Function to avoid async case. When sponsor gets the output content sent by assistors, the sponsor may not complete its own training model step. We need to wait till it complete.
Parameters
user_id : str train_id : str cur_rounds_num : int assistor_random_id_to_output_content_dict : dict[str, Any]
Returns
None
colda.workflow.train_workflow.sponsor.find_assistor module
- class colda.workflow.train_workflow.sponsor.find_assistor.TrainSponsorFindAssistor
Bases:
TrainBaseWorkflow
Handle sponsor train find assistor.
Methods
find_assistor
- classmethod find_assistor(max_round: int, assistors: list, train_file_path: str, train_id_column: str, train_data_column: str, train_target_column: str, task_mode: Literal['classification', 'regression'], model_name: Literal['linear', 'decision_tree', 'svm', 'gradient_boosting', 'mlp'], metric_name: Literal['MAD', 'RMSE', 'R2', 'Accuracy', 'F1', 'AUCROC'], task_name: str | None = None, task_description: str | None = None) str
Execute sponsor find assistor logic.
Parameters
maxRound : int assistors : list train_file_path : str train_id_column : str train_data_column : str train_target_column : str task_mode : Task_Mode model_name : Model_Name metric_name : Metric_Name task_name : str=None task_description : str=None
Returns
None
colda.workflow.train_workflow.sponsor.match_identifier module
colda.workflow.train_workflow.sponsor.output module
- class colda.workflow.train_workflow.sponsor.output.TrainSponsorOutput
Bases:
TrainBaseWorkflow
Handle sponsor train output stage.
Methods
train_sponsor_output
- classmethod train_calculate_next_round_residual(user_id: str, train_id: str, train_file_path: str, train_target_column: str, task_mode: Literal['classification', 'regression'], metric_name: Literal['MAD', 'RMSE', 'R2', 'Accuracy', 'F1', 'AUCROC'], cur_rounds_num: int, sponsor_matched_identifers: Any, last_round_result: Any) None
Handle stages in new round.
Parameters
user_id : str train_id : str train_file_path : str train_target_column : str task_mode : Task_Mode metric_name : Metric_Name cur_rounds_num : int sponsor_matched_identifers : Any last_round_result : Any
Returns
None
- classmethod train_calculate_result(user_id: str, train_id: str, cur_rounds_num: int, assistor_random_id_to_output_content_dict: dict[str, Any]) None
Function to avoid async case. When sponsor gets the output content sent by assistors, the sponsor may not complete its own training model step. We need to wait till it complete.
Parameters
user_id : str train_id : str cur_rounds_num : int assistor_random_id_to_output_content_dict : dict[str, Any]
Returns
None