Giter Club home page Giter Club logo

algorithmia-r's Introduction

algorithmia-r

R client library for accessing the Algorithmia API

Calling algorithms

First make a client object:

client <- getAlgorithmiaClient("ALGORITHMIA_API_KEY")

Then get the algorithm object:

algorithm <- client$algo("algo://AUTHOR/ALGORITHM_NAME/VERSION")

Call pipe passing in the input to the algorithm:

response <- algorithm$pipe(input)

There are two fields in the result. The meta data (which has timing data) and the result.

result <- response$result

Deployment

  • Verify that the Version field in the DESCRIPTION file has had its version updated per proper semantic versioning from the previous version in CRAN
  • Ensure that CI build passes successfully
  • Inside a Docker container with the image for that stage with the local directory bind-mounted (ex: docker run -it --rm -v pwd:/algorithmia-r <docker image from .gitlab-ci.yml>)
    • cd /algorithmia-r
    • Run all commands test:check_as_cran CI stage defined in .gitlab-ci.yml
  • Verify that the submission follows all CRAN policies.
  • Submit the new package https://xmpalantir.wu.ac.at/cransubmit/
    • Name: Robert Fulton
    • Email: [email protected]
    • Package: <the tar.gz file that was created from the build>
    • Optional comment:
  • Monitor email to [email protected] for any CRAN emails
    • At the very least, an email should come through asking to confirm the submission. This must be done before the submission will appear in CRAN.
  • Wait for the version of the library in CRAN is updated with the changes submitted
  • Create a new Git tag on the commit submitted to CRAN. This should include the major, minor, and patch versions (ex: 0.3.0).
  • Push any Git tags / release branches up to Github.

algorithmia-r's People

Contributors

dinoboy197 avatar jamesatha avatar john-bragg avatar pmcq avatar zeryx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

algorithmia-r's Issues

files() method on dataDirectory class returns empty directoryEntries list

Hi!

Great package! I tried to play around and use the deeplearning/ColorfulImageColorization/1.1.13 algorithm to colorizeblack and white images.

I uploaded the images in a new collection that I created on Algorithmia. I could access the collection directory with nlp_directory <- client$dir(path) and I could ask for a file by name in that directory with nlp_directory$file("test.jpg"). Or at least that is what I assume after the exists() method returned TRUE.

However, input_files <- nlp_directory$files() and then input_files$directoryEntries returned an empty list.

Maybe I am just missing something, I tried to find any explanation in the docs but with no luck.

p.s. I could get the filenames from my local dir at the end and I could use those in the algo call and it worked like a charm.

Thank you for your help!

Here is my full code:

install.packages("algorithmia")
library(algorithmia)
# Authenticate with your API key
apiKey <- "MY_API"
# Create the Algorithmia Client object
client <- getAlgorithmiaClient(apiKey)

# Get (and create) a directory collection
path <- "data://marton_balazs_kovacs/test"
nlp_directory <- client$dir(path)
nlp_directory$create()

# Update directory permissions (e.g. make it private)
nlp_directory$updatePermissions(ReadAcl.PRIVATE)
nlp_directory$getPermissions()$read_acl

# Get one file
## If you refer to the file with the exact name the function works
input <- nlp_directory$file("test.jpg")
## Test if the file that we asked for exists
input$exists()

# Get childs of the directory collection
## This function supposed to get all the files in my directory but it does not
input_files <- nlp_directory$files()
## This argument should get the names of the files in a list but it does not work
input_files <- input_files$directoryEntries

# Get the names of the files from a local repository
## Path to the local directory with the images
local_path <- file.path("MY_PATH")
## Get the filenames in that repository
local_filenames <- list.files(local_path)
## Append filenames to the dirpath on algorithmia and store it in a list obj
input_files <- list(image = paste(path, local_filenames, sep = "/"))

# Run the algorithm
algo <- client$algo("deeplearning/ColorfulImageColorization/1.1.13")
algo$setOptions(timeout=300) # optional
result <- algo$pipe(input_files)$result
print(result)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.