Learn R Programming

⚠️There's a newer version (0.2.3) of this package.Take me there.

neptune-r

R interface for Neptune, machine learning experiment tracking tool.

It lets you easily track:

  • hyperparameters
  • metrics
  • performance charts and images
  • model binaries

Everything is logged to Neptune and can be:

  • organized
  • visualized
  • shared
  • accessed

Keep the knowledge in one place, organized and ready to be shared with anyone.

Getting started

Register

Go to https://neptune.ai/ and sign up.

It is completely free for individuals and academic teams, and you can invite others to join your team!

Get your API token

In order to start working with Neptune you need to get the API token first. To do that, click on the Get API Token button on the top left.

Create your first project

Click on Projects and the New project. Choose a name for it and whether you want it public or private.

Invite others

Go to your project, click Settings and send invites!

Start tracking your work

Neptune let's you track any information important to your experimentation process.

Install R package

Simply run:

install.packages('neptune')

and

install_neptune()

Set Neptune token

set_neptune_token(token = 'eyJhcGlfYWRkcmVzcyI6Imh0dHBzOi8vdWkubmVwdHVuZS5haSIsImFwaV9rZXkiOiJiNzA2YmM4Zi03NmY5LTRjMmUtOTM5ZC00YmEwMzZmOTMyZTQifQ==')

Initialize Neptune

Toward the top of your script insert the following snippet.

init_neptune(project_name = "common-r/quickstarts")

Create and stop the experiment

You can treat every piece of work that you want to record as an experiment. Just create an experiment:

create_experiment(name = 'my first experiment')

Do whatever you want and record it here! Stop the experiment.

stop_experiment()

Track hyperparameters

Making sure that all your hyperparameters are recorded is very important. With Neptune, you can do that easily by passing params dictionary when creating the experiment.

create_experiment(name = 'my-first-experiment',
                  params = list(metric='Accuracy', model='rf', 'cvFolds'=2),
)

Track metrics

It is super easy. Just log your metric to Neptune.

log_metric('accuracy', 0.92)

Track result diagnostics

You can even log images to Neptune. Just save to the

log_image(name = 'performance charts', filename = 'roc_auc.png')
log_image(name = 'performance charts', filename = 'confusion_matrix.png')

Track artifacts

You can save model weights and any other artifact that you created during your experiment.

log_artifact(filename = 'model.Rdata')

Check the example project here

Getting help

If you get stuck, don't worry we are here to help. The best order of communication is:

Copy Link

Version

Install

install.packages('neptune')

Monthly Downloads

218

Version

0.2.0

License

Apache License 2.0 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Rafal Jankowski

Last Published

January 13th, 2022

Functions in neptune (0.2.0)

neptune_fetch_files_list

Fetches a list of artifact files from the Neptune servers.
neptune_exists

Checks if there is any field or namespace under the specified path.
neptune_add

Adds the provided tag or tags to the run's tags.
neptune_fetch_hash

Fetches the Hash of the artifact from Neptune servers.
neptune_download

Downloads all the files that are referenced in the field.
neptune_assign

Assigns the provided value to the field.
neptune_fetch

Fetch values of all non-File Atom fields as a named list.
neptune_download_last

Downloads the last File stored in the series from Neptune servers and save it locally.
neptune_clear

Removes all tags from the StringSet.
neptune_delete_files

Delete the file or files specified by paths from the FileSet stored on the Neptune servers.
neptune_fetch_last

Fetches last value stored in the series from Neptune servers.
neptune_sync

Synchronizes the run with with Neptune servers.
neptune_fetch_runs_table

Retrieve runs matching the specified criteria.
neptune_stop

Stop neptune run.
neptune_file_as_image

Static method for converting image objects or image-like objects to an image File value object.
neptune_get_structure

Returns a run's metadata structure in form of a named list.
neptune_get_run_url

Returns a direct link to run in Neptune. It's the same link that is printed at the moment of initialization of the run.
neptune_upload_files

Uploads the provided file or files and stores them inside the FileSet.
neptune_remove

Removes the provided tag or tags from the set.
neptune_init

Starts a new tracked run, and append it to the top of the Runs table view.
neptune_wait

Wait for all the tracking calls to finish.
neptune_fetch_values

Fetches all values stored in the series from Neptune servers.
neptune_print_structure

Pretty prints the structure of the run's metadata. Paths are ordered lexicographically and the whole structure is neatly colored.
[.neptune.new.run.Run

Field lookup
neptune_log

Logs the provided number or a collection of numbers.
neptune_install

Install neptune-client along with required python enviroment.
neptune_pop

Removes the field or whole namespace stored under the path completely and all data associated with them.
[<-.neptune.new.run.Run

Assigns the provided value to the field.
neptune_track_files

Saves the artifact metadata.
neptune_upload

Uploads provided file under specified field path
neptune_file_as_html

Converts an object to an HTML File value object.
neptune_set_api_token

Sets NEPTUNE_API_TOKEN environment variables