Skip to content

Do you need the sunspot dataset? #260

Description

@Nimrais

Hi, I don't know what are the rules for the contributions sorry. I haven't not found it in the documentation.

Thanks for the nice package!

Do you need the sunspot dataset? It's a dataset of the sunspots over the years.

const SUNSPOTS_DEPNAME = "Sunspots"
const SUNSPOTS_LINK = "https://raw.githubusercontent.com/STAT-JET-ASU/Datasets/master/Instructor/"
const SUNSPOTS_DOCS = "https://stat-jet-asu.github.io/Datasets/InstructorDescriptions/sunspots.html"
const SUNSPOTS_FILE = "sunspots.csv"
const SUNSPOTS_SHA256 = "657169832a67571b46385046a2966a6056890ad22da82c26f7a26e615adde840"

function __init__sunspots()
    register(DataDep(SUNSPOTS_DEPNAME,
                     """
                     Dataset: Monthly mean relative sunspot numbers (1749-).
                     Website: $SUNSPOTS_DOCS
                     """,
                     SUNSPOTS_LINK * SUNSPOTS_FILE,
                     SUNSPOTS_SHA256))
end

"""
    Sunspots(; as_df = true, dir = nothing)

Monthly mean relative sunspot numbers from 1749 onwards, a classic
univariate time-series dataset.

Each row reports, for one month, the average daily sunspot number together
with its standard deviation. The data is downloaded on first use from the
[STAT-JET-ASU datasets collection]($(SUNSPOTS_DOCS)) and cached locally
via DataDeps.jl.

Columns:

- `year`: calendar year of the observation.
- `month`: month of the year (1-12).
- `date`: observation date as a fractional year.
- `average`: monthly mean relative sunspot number — used as the target.
- `sd`: standard deviation of the daily values within the month.

NOTE: this is a time series with no pre-defined train-test split.

# Arguments

- If `as_df = true` (default), `features`/`targets` are `DataFrame`s, and
  `dataframe` holds the full table; otherwise they are plain `Matrix`es and
  `dataframe` is `nothing`.
- `dir`: directory to load/download into. Defaults to the DataDeps cache.

# Fields

- `metadata`: dictionary with `path`, `n_observations`, `feature_names`,
  `target_names`.
- `features`: the `year`, `month`, `date`, `sd` columns.
- `targets`: the `average` column.
- `dataframe`: the full table, or `nothing` when `as_df = false`.

The full implementation attached in the file below, github does not render the full code in a readiable way for whatever reason.

sunspots.jl.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions