Datamonger

Retrieve or Inspect Registered Data

Datamonger for R · r · 0.2.0

fetch_data

Resolve a dataset within one strongly selected registry. Artifact size and SHA-256 verification cannot be disabled. Decoded verification is enabled by default and may be disabled only explicitly.

Usage

fetch_data(
  name,
  source = NULL,
  version = NULL,
  registry = NULL,
  cache_dir = NULL,
  offline = FALSE,
  verify_decoded = TRUE,
  return_info = FALSE
)
fetch_artifact(
  name,
  source = NULL,
  version = NULL,
  artifact = NULL,
  registry = NULL,
  cache_dir = NULL,
  offline = FALSE
)
data_info(
  name,
  source = NULL,
  version = NULL,
  registry = NULL,
  cache_dir = NULL,
  offline = FALSE
)
list_data(registry = NULL, cache_dir = NULL, offline = FALSE)

Arguments

name

A bare dataset name, source:name, or source:name@version.

source

The dataset source. Required for bare names; omit it for qualified references, even if the values would agree.

version

An exact version. Omit it when the reference embeds a version, even if the values would agree. If neither form supplies a version, resolve the registry default.

registry

A strong selector, or NULL for the active selector.

cache_dir

An explicit cache path, or NULL for the platform default.

offline

Whether to forbid all network access.

verify_decoded

Whether to verify expected shape and canonical digest.

return_info

Whether to return reproducibility metadata with the data.

artifact

An artifact name. It may be omitted for a single-artifact dataset.

Value

fetch_data() returns a graph, hypergraph, data frame, Datamonger sparse result, or datamonger_dataset_splits named list in provider split order. With return_info = TRUE, it returns a datamonger_fetch_result. fetch_artifact() returns a cache path. Metadata functions return one or a list of datamonger_data_info records. Sparse features use a row-compressed Matrix, or an exact datamonger_csr_matrix when a declared dimension exceeds the Matrix integer limit.

Details

Named splits use manifest schema 4. Access them with data[["validation"]]. Each value is a table or sparse dataset, and a feature-only test table has no response column. Split names and row membership are preserved exactly.

Multilabel results have sparse features and response matrices and a label_index_base. Source label k maps to column k - label_index_base + 1.

Sparse label joins return named train and test splits. Each split also contains the row-aligned document_id vector and the label_codes vector in response column order.

Ranking results have class datamonger_ranking_sparse_dataset and contain sparse features, a relevance vector response, and a row-aligned int64 vector query_id.

Metadata records expose preprocessing when recorded in a version 3 registry. Upstream processing and Datamonger preparation have separate stages, with status unknown, none, or documented. Known steps retain their order, string parameters, and evidence references. Missing history is NULL. These records describe the registered artifacts; fetching does not apply the transformations.

Graphs return a datamonger_graph_dataset with directed, nodes, and edges. A datamonger_hypergraph_dataset has directed, nodes, hyperedges, and incidences. Each topology table is a data frame.

Examples

cache <- tempfile("datamonger-cache-")
registry <- active_registry(project_dir = tempdir())
datasets <- list_data(registry = registry, cache_dir = cache, offline = TRUE)
length(datasets)
data_info("uci:iris", registry = registry, cache_dir = cache, offline = TRUE)


# \dontrun

# These calls may download the dataset.
path <- fetch_artifact("uci:iris", registry = registry, cache_dir = cache)
head(fetch_data("uci:iris", registry = registry, cache_dir = cache))

unlink(cache, recursive = TRUE)
[1] 57
<datamonger_data_info>uci:iris@1
  Iris
  registry: 1.7.0

Help topic: fetch_data

Same API in