Skip to content

Commit

Permalink
Add docstring for Dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Sep 13, 2022
1 parent 8e9cbc6 commit e45d1ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ HallOfFame(options::Options, ::Type{T}) where {T<:Real}
## Dataset

```@docs
Dataset{T<:Real}
Dataset(X::AbstractMatrix{T},
y::AbstractVector{T};
weights::Union{AbstractVector{T}, Nothing}=nothing,
Expand Down
15 changes: 15 additions & 0 deletions src/Dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ module DatasetModule

import ..ProgramConstantsModule: BATCH_DIM, FEATURE_DIM

"""
Dataset{T<:Real}
# Fields
- `X::AbstractMatrix{T}`: The input features, with shape `(nfeatures, n)`.
- `y::AbstractVector{T}`: The desired output values, with shape `(n,)`.
- `n::Int`: The number of samples.
- `nfeatures::Int`: The number of features.
- `weighted::Bool`: Whether the dataset is non-uniformly weighted.
- `weights::Union{AbstractVector{T},Nothing}`: If the dataset is weighted,
these specify the per-sample weight (with shape `(n,)`).
- `varMap::Array{String,1}`: The names of the features,
with shape `(nfeatures,)`.
"""
struct Dataset{T<:Real}
X::AbstractMatrix{T}
y::AbstractVector{T}
Expand Down

0 comments on commit e45d1ba

Please sign in to comment.