diff --git a/Project.toml b/Project.toml index 0a5bcee..78860bd 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "RelationalDatasets" uuid = "6b8bdb16-f930-11eb-22b5-7ba1dabdf7a8" license = "Apache 2.0" authors = ["Alexander L. Hayes "] -version = "0.1.1" +version = "0.2.0" [deps] HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" diff --git a/README.md b/README.md index 4c1c7bd..fafc4c9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # RelationalDatasets.jl -> *A small library for loading and downloading relational datasets.* -> -> or: -> -> *The [`relational-datasets`](https://github.com/srlearn/relational-datasets) -> Python package—but written in Julia.* +*A small library for loading and downloading relational datasets.* + +or: *The [`relational-datasets`](https://github.com/srlearn/relational-datasets) +Python package—but written in Julia.* + +```console +add RelationalDatasets +``` ![GitHub release (latest by date)](https://img.shields.io/github/v/release/srlearn/RelationalDatasets.jl) ![GitHub](https://img.shields.io/github/license/srlearn/RelationalDatasets.jl) @@ -14,6 +16,11 @@ ## Usage +[![RelationalDatasets.jl stable documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://srlearn.github.io/RelationalDatasets.jl/stable) +[![RelationalDatasets.jl latest documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://srlearn.github.io/RelationalDatasets.jl/dev) + +### Loading and Downloading Benchmark Datasets + `RelationalDatasets.jl` exports a single function: `load` to return train and test folds. @@ -21,11 +28,34 @@ and test folds. using RelationalDatasets train, test = load("webkb", "v0.0.4", fold=2) - -println(length(train.facts)) +length(train.facts) # 1344 ``` +### Converting Vector-based Datasets + +*Binary classification when `y` is a vector of 0/1*: + +```julia +using RelationalDatasets + +data, modes = RelationalDatasets.from_vector( + [0 1 1; 1 0 2; 2 2 0], + [0, 0, 1], +) +``` + +*Regression when `y` is a vector of floats*: + +```julia +using RelationalDatasets + +data, modes = RelationalDatasets.from_vector( + [0 1 1; 1 0 2; 2 2 0], + [1.1, 0.9, 2.5], +) +``` + ## Install ### From Registry