Skip to content

Instantly share code, notes, and snippets.

@r-marques
Last active January 7, 2021 14:38
Show Gist options
  • Select an option

  • Save r-marques/d105638d2148dda5061ed84bbe824915 to your computer and use it in GitHub Desktop.

Select an option

Save r-marques/d105638d2148dda5061ed84bbe824915 to your computer and use it in GitHub Desktop.
Publish algorithm
metadata_algorithm = {
"main": {
"name": "Fraud Detection Algorithm",
"dateCreated": "2021-01-07T09:45:09Z",
"author": "Data Scientist",
"license": "",
"price": "0",
"files": [
{
"index": 0,
"contentType": "text/text",
"checksum": "0x52b5c93b82dd9e7ecc3d9fdf4755f7f69a54484941897dc517b4adfe3bbc3377",
"checksumType": "MD5",
"contentLength": "12057507",
"url": "https://raw.githubusercontent.com/nevermined-io/fl-demo/feature/xain-fraud-detection/fraud-detection-xain/notebooks/federated_fraud_demo.ipynb"
}
],
"type": "algorithm",
"algorithm": {
"language": "python",
"format": "py",
"version": "0.1.0",
"entrypoint": (
"pip install jupyter scikit-learn pandas papermill xain-sdk && "
"papermill --stdout-file - federated_fraud_demo.ipynb $NEVERMINED_OUTPUTS_PATH/federated_fraud_demo_output.ipynb"
),
"requirements": {
"container": {
"image": "python",
"tag": "3.8-slim-buster",
"checksum": "sha256:53ad3a03b2fb240b6c494339821e6638cd44c989bcf26ec4d51a6a52f7518c1d"
}
}
}
}
}
ddo_algorithm = nevermined.assets.create(
metadata_algorithm,
data_scientist_account
)
print(f"Algorithm DID: {ddo_algorithm.did}")
"Algorithm DID: did:nv:aeefc789be572c8dc143f2c4f2a6f0e571be73a2c34438b6194e6638c8419e4d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment