Liking cljdoc? Tell your friends :D

psb2.core


fetch-and-possibly-cache-dataclj

(fetch-and-possibly-cache-data datasets-directory problem-name edge-or-random)

Helper function for fetch-examples that does the following for edge or random dataset:

  1. Checks if EDN file for dataset is already downloaded.
  2. If not, downloads the dataset file to the specified location.
  3. Loads and returns list of the data from the dataset file.
Helper function for fetch-examples that does the following for edge or random dataset:
1. Checks if EDN file for dataset is already downloaded.
2. If not, downloads the dataset file to the specified location.
3. Loads and returns list of the data from the dataset file.
sourceraw docstring

fetch-examplesclj

(fetch-examples datasets-directory problem-name n-train n-test)

Downloads, fetches, and returns training and test data from a PSB2 problem. Caches downloaded datasets in datasets_directory to avoid multiple downloads. Returns a map of the form {:train training-examples :test testing-examples} where training-examples and testing-examples are lists of training and test data. The elements of these lists are maps of the form: {:input1 first-input :input2 second-input ... :output1 first-output ...} The training examples will include all hard-coded edge cases included in the suite, along with enough random cases to include n-train cases. Note that this function downloads and loads large datasets and can be slow, up to 2 minutes. Parameters: datasets-directory - Location to download the PSB2 datasets. problem-name - Name of the PSB2 problem, lowercase and seperated by dashes. - Ex: indices-of-substring n-train - Number of training cases to return n-test - Number of test cases to return

Downloads, fetches, and returns training and test data from a PSB2 problem.
Caches downloaded datasets in `datasets_directory` to avoid multiple downloads.
Returns a map of the form {:train training-examples :test testing-examples}
where training-examples and testing-examples are lists of training and test
data. The elements of these lists are maps of the form:
{:input1 first-input :input2 second-input ... :output1 first-output ...}
The training examples will include all hard-coded edge cases included in the suite,
along with enough random cases to include `n-train` cases.
Note that this function downloads and loads large datasets and can
be slow, up to 2 minutes.
Parameters:
  `datasets-directory` - Location to download the PSB2 datasets.
  `problem-name` - Name of the PSB2 problem, lowercase and seperated by dashes.
      - Ex: indices-of-substring
  `n-train` - Number of training cases to return
  `n-test` - Number of test cases to return
sourceraw docstring

get-problem-namesclj

(get-problem-names)

Returns a list of strings of the problem names in PSB2.

Returns a list of strings of the problem names in PSB2.
sourceraw docstring

load-edn-linesclj

(load-edn-lines source)

Load edn from an io/reader source (filename or io/resource). Expects file to have multiple lines of EDN.

Load edn from an io/reader source (filename or io/resource).
Expects file to have multiple lines of EDN.
sourceraw docstring

problemsclj

source

psb1-problemsclj

source

sampleclj

(sample coll sample-size)

Returns a random sample of given collection of size sample-size

Returns a random sample of given collection of size sample-size
sourceraw docstring

save-file-from-uriclj

(save-file-from-uri uri file)

Saves a file given a particular URI. Taken from here: https://stackoverflow.com/a/19297746/2023312

Saves a file given a particular URI.
Taken from here: https://stackoverflow.com/a/19297746/2023312
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close