9
$\begingroup$

I find having ResourceData/Objects for machine learning datasets to be extremely useful, with their "TrainingData", "TestData" properties:

enter image description here

Right now there's only a handful:

enter image description here

And even fewer for computer vision datasets:

enter image description here

I'd like to turn the small CALTECH Faces challenge dataset of 465 images into a dataset as ResourceObject["CALTECH-Faces"], and then publish it for others, can anyone show me how to do this?

$\endgroup$
  • 1
    $\begingroup$ From the documentation, it seems that you can define your own resource object using ResourceObject [assoc]. $\endgroup$ – xslittlegrass Apr 15 '17 at 5:47
  • $\begingroup$ But how to publish it for others? $\endgroup$ – M.R. Apr 15 '17 at 17:37
8
$\begingroup$

It seems that Wolfram Data Repository can be used to share data using ResourceObject. Here is a simple example:

mytrainingData = RandomSample[ResourceData[ResourceObject["MNIST"], "TrainingData"], 10];

I'm trying to make mytrainingData into a ResourceObject so that we can access the data like

resource = ResourceObject[...];
data = ResourceData[resource,"mytrainingData"];

To do that, we first fill the descriptions in the template created by

CreateNotebook["DataResource"]

enter image description here

Then in the data "Resource Content" section, specify the data content

$$Object["FullContent"] = 
  DataResource`$$ContentConversion@<|
    "mytrainingData" -> mytrainingData|>;

Now we can deploy the data to the cloud using the button, which returns a CloudObject:

CloudObject[https://www.wolframcloud.com/objects/a701ff40-d42b-4e08-a324-df0c6906887c]

We can then set this CloudObject to be publically accessible:

obj=CloudObject["https://www.wolframcloud.com/objects/a701ff40-d42b-4e08-a324-df0c6906887c"]
SetPermissions[obj, "Public"]

Now this data set can be accessed similarly with the built in data

resource = ResourceObject[CloudObject["https://www.wolframcloud.com/objects/a701ff40-d42b-4e08-a324-df0c6906887c"]]
data = ResourceData[resource, "mytrainingData"]

or

resource = ResourceObject["f49415d4-56c2-4892-90d2-330d1e444db8"]
data = ResourceData[resource, "mytrainingData"]
$\endgroup$
  • $\begingroup$ What do you actually need to make CreateNotebook["DataResource"] work? Mathematica 11 does not understand it... $\endgroup$ – leosenko May 22 '17 at 23:02
  • $\begingroup$ @leosenko I think you have to use the newest version of Mathematica (11.1.1) $\endgroup$ – xslittlegrass May 23 '17 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.