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

classmethod train_sponsor_match_identifier(train_id: str, train_id_dict: dict[str, Any]) None

Execute sponsor match identifier logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

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

classmethod train_sponsor_output(train_id: str, train_id_dict: dict[str, Any]) None

Execute sponsor train output logic.

Parameters

train_id : str train_id_dict : dict[str, Any]

Returns

None

class colda.workflow.train_workflow.sponsor.api.TrainSponsorSituation

Bases: TrainBaseWorkflow

Handle sponsor train situation logic

Methods

train_sponsor_situation

classmethod train_sponsor_situation(train_id: str, train_id_dict: dict[str, Any]) None

Execute sponsor train situation logic.

Parameters

train_id: str train_id_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

class colda.workflow.train_workflow.sponsor.match_identifier.TrainSponsorMatchIdentifier

Bases: TrainBaseWorkflow

Handle sponsor match identifier stage.

Methods

train_sponsor_match_identifier

classmethod train_sponsor_match_identifier(train_id: str, train_id_dict: dict[str, Any]) None

Execute sponsor match identifier logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

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

classmethod train_sponsor_output(train_id: str, train_id_dict: dict[str, Any]) None

Execute sponsor train output logic.

Parameters

train_id : str train_id_dict : dict[str, Any]

Returns

None

colda.workflow.train_workflow.sponsor.situation module

class colda.workflow.train_workflow.sponsor.situation.TrainSponsorSituation

Bases: TrainBaseWorkflow

Handle sponsor train situation logic

Methods

train_sponsor_situation

classmethod train_sponsor_situation(train_id: str, train_id_dict: dict[str, Any]) None

Execute sponsor train situation logic.

Parameters

train_id: str train_id_dict : dict[str, Any]

Returns

None

Module contents