{"id":13857301,"url":"https://github.com/neptune-ai/neptune-r","last_synced_at":"2025-04-13T14:32:49.845Z","repository":{"id":42082406,"uuid":"244134910","full_name":"neptune-ai/neptune-r","owner":"neptune-ai","description":"📒 The MLOps stack component for experiment tracking (R interface)","archived":false,"fork":false,"pushed_at":"2023-10-05T09:58:47.000Z","size":199,"stargazers_count":14,"open_issues_count":1,"forks_count":6,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-05T22:25:45.722Z","etag":null,"topics":["compare","language","log","management","metadata","metrics","mlops","models","monitoring","organize","parameters","r","store","tracker","visualization"],"latest_commit_sha":null,"homepage":"https://docs.neptune.ai/integrations/r/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neptune-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-03-01T11:14:49.000Z","updated_at":"2024-08-10T19:28:51.000Z","dependencies_parsed_at":"2024-02-09T01:46:42.288Z","dependency_job_id":"283836d3-e3a6-4f27-98b8-cecc431af537","html_url":"https://github.com/neptune-ai/neptune-r","commit_stats":{"total_commits":87,"total_committers":8,"mean_commits":10.875,"dds":0.5977011494252873,"last_synced_commit":"7c51ab3da976dcc9407999a6a3d5b8f8c6eb714f"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptune-ai%2Fneptune-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptune-ai%2Fneptune-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptune-ai%2Fneptune-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neptune-ai%2Fneptune-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neptune-ai","download_url":"https://codeload.github.com/neptune-ai/neptune-r/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248728235,"owners_count":21152181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compare","language","log","management","metadata","metrics","mlops","models","monitoring","organize","parameters","r","store","tracker","visualization"],"created_at":"2024-08-05T03:01:32.845Z","updated_at":"2025-04-13T14:32:49.535Z","avatar_url":"https://github.com/neptune-ai.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://neptune.ai/wp-content/uploads/2023/08/Github-cover.png\" width=\"1500\" /\u003e\n \u003c/div\u003e\n\n## What is neptune.ai?\n\nNeptune is a lightweight experiment tracker for ML teams that struggle with debugging and reproducing experiments, sharing results, and messy model handover. **It offers a single place to track, compare, store, and collaborate on experiments and models.**\n\nWith Neptune, Data Scientists can develop production-ready models faster, and ML Engineers can access model artifacts instantly in order to deploy them to production.\n\u0026nbsp;\n\n\u003ca href=\"https://www.youtube.com/watch?v=bQzgnqM5J6U\"\u003e\u003cb\u003eWatch a 3min explainer video →\u003c/b\u003e\u003c/a\u003e\n\u0026nbsp;\n\n\u003ca href=\"https://neptune.ai/demo\"\u003e\u003cb\u003eWatch a 20min product demo →\u003c/b\u003e\u003c/a\u003e\n\u0026nbsp;\n\n# Getting started\n\n## Register\n[Sign up for Neptune](https://neptune.ai).\n\nYou can use Neptune for free for work, research, and personal projects. Individual accounts are free, and if you're interested in using Neptune as a team, [check available plans](https://neptune.ai/pricing).\n\n## Install Neptune R package\n\nIf you don't have Python installed and just want to use Neptune, simply run the following code:\n\n```R\ninstall.packages(\"reticulate\")\nlibrary(reticulate)\ninstall_miniconda()\n\ninstall.packages(\"neptune\")\nlibrary(neptune)\nneptune_install()\n```\n\nThis code will install [miniconda](https://docs.conda.io/en/latest/miniconda.html) (a minimalistic Python environment) and set it up for you. This is a one-time thing and after that, you only need to run the last two lines when you want to work with Neptune:\n\n```R\nlibrary(neptune)\nneptune_install()\n```\n\nIf you have a Python virtual environment already set up (conda, miniconda, or virtualenv), you can point to it instead of creating a new one:\n\n```R\n# If you are using virtualenv\ninstall.packages(\"neptune\")\nlibrary(neptune)\nneptune_install(method=\"virtualenv\", envname = \"PATH/TO/YOUR/VIRTUALENV\")\n\n\n# If you are using conda or miniconda\ninstall.packages(\"neptune\")\nlibrary(neptune)\nneptune_install(method=\"conda\", envname = \"PATH/TO/YOUR/CONDA/ENVIRONMENT\")\n```\n\n## Create a tracked run\n\n```R\nrun \u003c- neptune_init(project=\"MY_WORKSPACE/MY_PROJECT\",\n                    api_token=\"NEPTUNE_API_TOKEN\")\n```\n\nThis code creates a run in the specified project. This will be your gateway to logging metadata to Neptune.\n\nYou need to pass your credentials (project and API token) to the `neptune_init()` method. You can also set the API token globally:\n\n```R\nneptune_set_api_token(token = \"NEPTUNE_API_TOKEN\")\n```\n\n### API token\n\nTo find your API token:\n* Go to the Neptune UI\n* Open the **User menu** toggle in the upper right\n* Click **Get your API token**\n* Copy your API token \n\nor [get your API token directly from here](https://app.neptune.ai/get_my_api_token).\n\n### Project\n\nThe project argument has the format `WORKSPACE_NAME/PROJECT_NAME`.\n\nTo find it:\n* Go to the Neptune UI \n* Go to your project \n* Open **Settings** \u003e **Properties**\n* Copy the project name\n\n### Stop tracking\n\nOnce you are finished with tracking metadata you need to stop the tracking for that particular run:\n\n```R\nneptune_stop(run)\n\n# Note that you can also use reticulate based syntax:\nrun$stop()\n```\n\nIf you are running a script it will stop tracking automatically at the end. However, in an interactive environment such as RStudio, you need to stop it explicitly.\n\n## Track metadata\n\n### Log hyperparameters\n\n```R\nparams \u003c- list(\n  \"dense_units\"= 128,\n  \"activation\"= \"relu\",\n  \"dropout\"= 0.23,\n  \"learning_rate\"= 0.15,\n  \"batch_size\"= 64,\n  \"n_epochs\"= 30\n)\nrun[\"parameters\"] \u003c- params\n```\n\nIf you have parameters in form of a dictionary you can log them to Neptune in batch. It will create a field with the appropriate type for each dictionary entry. \nYou can update the hyperparameters or add new ones later in the code:\n\n```R\n# Add additional parameters \nrun[\"model/parameters/seed\"] \u003c- .Random.seed\n\n# Update parameters e.g. after triggering an early stopping\nrun[\"model/parameters/n_epochs\"] \u003c- epoch\n```\n\n### Log training metrics\n\n```R\nfor (i in 1:epochs) {\n  [...] # My training loop\n  neptune_log(run[\"train/epoch/loss\"], loss)\n  neptune_log(run[\"train/epoch/accuracy\"], acc)\n}\n\n# Note that you can also use reticulate based syntax:\nrun[\"train/epoch/loss\"]$log(loss)\n```\n\nYou can log training metrics to Neptune using series fields. In Neptune, there are three types of series - float series, string series, and file series. Each `neptune_append()` will add a new value at the end of the series. \n\n### Log evaluation results\n\n```R\nrun[\"evaluation/accuracy\"] \u003c- eval_acc\nrun[\"evaluation/loss\"] \u003c- eval_loss\n```\n\nTo log evaluation metrics simply assign them to a field of your choice. Using the snippet above, both evaluation metrics will be stored in the same evaluation namespace.\n\n```R\nneptune_upload(run[\"evaluation/ROC\"], \"roc.png\")\n\n# You can upload ggplot plots directly without saving them to a file\nneptune_upload(run[\"evaluation/ROC\"], ggplot_roc)\n\n# If you want to control additional parameters like size of the plot you can pass the same arguments as to ggsave\nneptune_upload(run[\"evaluation/ROC\"], ggplot_roc, width=20, height=20, units=\"cm\")\n\n# Note that you can also use reticulate based syntax:\nrun[\"evaluation/ROC\"]$upload(\"roc.png\")\nrun[\"evaluation/ROC\"]$upload(ggplot_roc)\n```\n\nYou can log plots and charts easily using the `neptune_upload()` function. In the case of a ggplot object, it gets converted to an image file and uploaded, but you can also upload images from the local disc.\n\n### Upload model file\n\nYou can upload any binary file (e.g. model weights) from disk using the `neptune_upload()` method. If your model is saved as multiple files you can upload a whole folder as a `FileSet` using `neptune_upload_files()`.\n\n```R\n# Upload a single fingle sile\nneptune_upload(run[\"model\"], \"model.Rdata\")\n\n# You can also upload folders in batch if you don't need access to the separate files\nneptune_upload_files(run[\"model\"], \"models\")\n\n# Note that you can also use reticulate based syntax:\nrun[\"model\"]$upload(\"model.Rdata\")\nrun[\"model\"]$upload_files(\"models\")\n```\n\n# Getting help\n\nIf you got stuck or simply want to talk to us, here are your options:\n\n* Check the [Neptune R client package documentation](https://docs.neptune.ai/integrations/r/)\n* Check our [FAQ page](https://docs.neptune.ai/getting_help)\n* You can submit bug reports, feature requests, or contributions directly to the repository.\n* Chat! When in the Neptune application, click on the blue message icon in the bottom-right corner and send a message. A real person will talk to you ASAP (typically very ASAP),\n* You can just shoot us an email at support@neptune.ai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneptune-ai%2Fneptune-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneptune-ai%2Fneptune-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneptune-ai%2Fneptune-r/lists"}