Associating the configured model algorithm
After you have configured the model algorithm, you are ready to associate the model algorithm to a collaboration. Associating a model algorithm makes the model algorithm available to all members of the collaboration.
- Console
-
To associate a custom ML model algorithm in AWS Clean Rooms
-
Sign in to the AWS Management Console and open the AWS Clean Rooms console
with your AWS account (if you have not yet done so). -
In the left navigation pane, choose Custom ML models.
-
On the Custom ML models page, choose the configured model algorithm that you want to associate to a collaboration and click Associate to collaboration.
-
In the Associate configured model algorithm window, choose the Collaboration that you want to associate to.
-
Choose Choose collaboration.
-
- API
-
Associate the configured model algorithm with the collaboration. You also provide a privacy policy that defines who has access to the different logs, allows customers to define regex, and how much data can be exported from the training model outputs or inference results.
Note
Configured model algorithm associations are immutable.
import boto3 acr_ml_client= boto3.client('cleanroomsml') acr_ml_client.create_configured_model_algorithm_association( name='
configured_model_algorithm_association_name
', description='purpose of the association
', membershipIdentifier='membership_id
', configuredModelAlgorithmArn= 'arn:aws:cleanrooms-ml:region
:account
:membership
/membershipIdentifier/configured-model-algorithm
/identifier
', privacyConfiguration = { "policies": { "trainedModels": { "containerLogs": [ { "allowedAccountIds": ['member_account_id
'], }, { "allowedAccountIds": ['member_account_id
'], "filterPattern": "INFO" } ], "containerMetrics": { "noiseLevel": 'noise value
' } }, "trainedModelInferenceJobs": { "containerLogs": [ { "allowedAccountIds": ['member_account_id
'] } ] }, trainedModelExports: { maxSize: { unit: GB, value: 5 }, filesToExport: [ "MODEL", // final model artifacts that container should write to /opt/ml/model directory "OUTPUT" // other artifacts that container should write to /opt/ml/output/data directory ] } } } )After the configured model algorithm is associated to the collaboration, training data providers must add a collaboration analysis rule to their table. This rule allows the configured model algorithm association to access their configured table. All contributing training data providers must run the following code:
import boto3 acr_client= boto3.client('cleanrooms') acr_client.create_configured_table_association_analysis_rule( membershipIdentifier= '
membership_id
', configuredTableAssociationIdentifier= 'configured_table_association_id
', analysisRuleType= 'CUSTOM', analysisRulePolicy = { 'v1': { 'custom': { 'allowedAdditionalAnalyses': ['arn:aws:cleanrooms-ml:region
:*:membership
/*/configured-model-algorithm-association/*''], 'allowedResultReceivers': [] } } } )Note
Because configured model algorithm associations are immutable, we recommend that training data providers who wants to allowlist models for use to use wild cards in
allowedAdditionalAnalyses
during the first few iterations of customm model configuration. This allows model providers to iterate on their code without requiring other training providers to re-associate before training their updated model code with data.