1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! BigML dataset support.
use std::collections::HashMap;
use super::id::*;
use super::status::*;
use super::{Resource, ResourceCommon};
use super::source::Field;
/// A BigML dataset. Basically a table of data with named columns.
///
/// TODO: Still lots of missing fields.
#[derive(Clone, Debug, Deserialize, Resource, Serialize)]
#[api_name = "dataset"]
pub struct Dataset {
/// Common resource information. These fields will be serialized at the
/// top-level of this structure by `serde`.
#[serde(flatten)]
pub common: ResourceCommon,
/// The ID of this resource.
pub resource: Id<Dataset>,
/// The current status of this execution.
pub status: GenericStatus,
/// The number of columns in the dataset.
pub columns: usize,
/// Field IDs excluded when building this dataset.
pub excluded_fields: Vec<String>,
/// The number of fields of each type. This includes a few odd things
/// like "preferred", so we represent it as a string.
pub field_types: HashMap<String, u64>,
/// Metadata describing each field.
pub fields: HashMap<String, Field>,
/// Field IDs included when building this dataset.
pub input_fields: Vec<String>,
/// The number of rows in this dataset.
pub rows: usize,
/// Placeholder to allow extensibility without breaking the API.
#[serde(skip)]
_placeholder: (),
}