ga_screening_protocol_jade
GA custom multi-algorithm protocol.
First runs a model inference on the GA model, then compute etdrs and the GA algorithm to compute the area affected by GA (as a whole and within the ETDRS subregions). Then CSV and PDF Reports get generated.
Classes
GAScreeningProtocol
class GAScreeningProtocol( *, algorithm: Sequence[Union[ModelInference, GATrialCalculationAlgorithmJade, CSVReportGeneratorOphthalmologyAlgorithm, GATrialPDFGeneratorAlgorithmJade, TrialInclusionCriteriaMatchAlgorithmJade]], results_notification_email: Optional[bool] = False, trial_name: Optional[str] = None, rename_columns: Optional[Mapping[str, str]] = None, **kwargs: Any,):
Protocol for running GA Algorithms sequentially.
Ancestors
- GAScreeningProtocolJade
- BaseProtocolFactory
- abc.ABC
- bitfount.federated.roles._RolesMixIn
- bitfount.types._BaseSerializableObjectMixIn
Variables
algorithms : list
- Returns the algorithms in the protocol.
Methods
dump
def dump(self) ‑> SerializedProtocol:
Inherited from:
GAScreeningProtocolJade.dump :
Returns the JSON-serializable representation of the protocol.
modeller
def modeller( self, mailbox: _ModellerMailbox, **kwargs: Any,) ‑> bitfount.federated.protocols.ophthalmology.ga_screening_protocol_jade._ModellerSide:
Inherited from:
GAScreeningProtocolJade.modeller :
Returns the Modeller side of the protocol.
run
def run( self, pod_identifiers: Collection[str], session: Optional[BitfountSession] = None, username: Optional[str] = None, hub: Optional[BitfountHub] = None, ms_config: Optional[MessageServiceConfig] = None, message_service: Optional[_MessageService] = None, pod_public_key_paths: Optional[Mapping[str, Path]] = None, identity_verification_method: IdentityVerificationMethod = IdentityVerificationMethod.OIDC_DEVICE_CODE, private_key_or_file: Optional[Union[RSAPrivateKey, Path]] = None, idp_url: Optional[str] = None, require_all_pods: bool = False, run_on_new_data_only: bool = False, model_out: Optional[Union[Path, str]] = None, project_id: Optional[str] = None, batched_execution: Optional[bool] = None,) ‑> Optional[Any]:
Inherited from:
Sets up a local Modeller instance and runs the protocol.
Arguments
pod_identifiers
: The BitfountHub pod identifiers to run against.session
: Optional. Session to use for authenticated requests. Created if needed.username
: Username to run as. Defaults to logged in user.hub
: BitfountHub instance. Default: hub.bitfount.com.ms_config
: Message service config. Default: messaging.bitfount.com.message_service
: Message service instance, created from ms_config if not provided. Defaults to "messaging.bitfount.com".pod_public_key_paths
: Public keys of pods to be checked against.identity_verification_method
: The identity verification method to use.private_key_or_file
: Private key (to be removed).idp_url
: The IDP URL.require_all_pods
: If true raise PodResponseError if at least one pod identifier specified rejects or fails to respond to a task request.run_on_new_data_only
: Whether to run the task on new datapoints only. Defaults to False.model_out
: The path to save the model to.project_id
: The project ID to run the task under.batched_execution
: Whether to run the task in batched mode. Defaults to False.
Returns Results of the protocol.
Raises
PodResponseError
: If require_all_pods is true and at least one pod identifier specified rejects or fails to respond to a task request.ValueError
: If attempting to train on multiple pods, and theDataStructure
table name is given as a string.
worker
def worker(self, mailbox: _WorkerMailbox, hub: BitfountHub, **kwargs: Any) ‑> _WorkerSide:
Inherited from:
GAScreeningProtocolJade.worker :
Returns worker side of the protocol.
GAScreeningProtocolJade
class GAScreeningProtocolJade( *, algorithm: Sequence[Union[ModelInference, GATrialCalculationAlgorithmJade, CSVReportGeneratorOphthalmologyAlgorithm, GATrialPDFGeneratorAlgorithmJade, TrialInclusionCriteriaMatchAlgorithmJade]], results_notification_email: Optional[bool] = False, trial_name: Optional[str] = None, rename_columns: Optional[Mapping[str, str]] = None, **kwargs: Any,):
Protocol for running GA Algorithms sequentially.
Ancestors
- BaseProtocolFactory
- abc.ABC
- bitfount.federated.roles._RolesMixIn
- bitfount.types._BaseSerializableObjectMixIn
Subclasses
Variables
- static
fields_dict : ClassVar[dict[str, marshmallow.fields.Field]]
algorithms : list
- Returns the algorithms in the protocol.
Methods
dump
def dump(self) ‑> SerializedProtocol:
Inherited from:
Returns the JSON-serializable representation of the protocol.
modeller
def modeller( self, mailbox: _ModellerMailbox, **kwargs: Any,) ‑> bitfount.federated.protocols.ophthalmology.ga_screening_protocol_jade._ModellerSide:
Returns the Modeller side of the protocol.
run
def run( self, pod_identifiers: Collection[str], session: Optional[BitfountSession] = None, username: Optional[str] = None, hub: Optional[BitfountHub] = None, ms_config: Optional[MessageServiceConfig] = None, message_service: Optional[_MessageService] = None, pod_public_key_paths: Optional[Mapping[str, Path]] = None, identity_verification_method: IdentityVerificationMethod = IdentityVerificationMethod.OIDC_DEVICE_CODE, private_key_or_file: Optional[Union[RSAPrivateKey, Path]] = None, idp_url: Optional[str] = None, require_all_pods: bool = False, run_on_new_data_only: bool = False, model_out: Optional[Union[Path, str]] = None, project_id: Optional[str] = None, batched_execution: Optional[bool] = None,) ‑> Optional[Any]:
Inherited from:
Sets up a local Modeller instance and runs the protocol.
Arguments
pod_identifiers
: The BitfountHub pod identifiers to run against.session
: Optional. Session to use for authenticated requests. Created if needed.username
: Username to run as. Defaults to logged in user.hub
: BitfountHub instance. Default: hub.bitfount.com.ms_config
: Message service config. Default: messaging.bitfount.com.message_service
: Message service instance, created from ms_config if not provided. Defaults to "messaging.bitfount.com".pod_public_key_paths
: Public keys of pods to be checked against.identity_verification_method
: The identity verification method to use.private_key_or_file
: Private key (to be removed).idp_url
: The IDP URL.require_all_pods
: If true raise PodResponseError if at least one pod identifier specified rejects or fails to respond to a task request.run_on_new_data_only
: Whether to run the task on new datapoints only. Defaults to False.model_out
: The path to save the model to.project_id
: The project ID to run the task under.batched_execution
: Whether to run the task in batched mode. Defaults to False.
Returns Results of the protocol.
Raises
PodResponseError
: If require_all_pods is true and at least one pod identifier specified rejects or fails to respond to a task request.ValueError
: If attempting to train on multiple pods, and theDataStructure
table name is given as a string.
worker
def worker(self, mailbox: _WorkerMailbox, hub: BitfountHub, **kwargs: Any) ‑> _WorkerSide:
Returns worker side of the protocol.