Index

All structures and methods can be found in the Full Index with their accompanying docstrings in Documentation

Full Index

Documentation

MetaICVI.MetaICVIModule

Main module for MetaICVI.jl, a Julia package implementing the MetaICVI method.

This module exports all of the modules, options, and utilities used by the MetaICVI.jl package. For full usage, see the official guide at https://ap6yc.github.io/MetaICVI.jl/dev/man/guide/.

Basic Usage

Install and import the package in a script with

using Pkg
Pkg.add("MetaICVI")
using MetaICVI

Next, create a MetaICVI module with some options

# Create the options
opts = MetaICVIOpts(
    fail_on_missing = false
)
# Create a module
metaicvi = MetaICVIModule(opts)

Imports

The following names are imported by the package as dependencies:

  • Base
  • ClusterValidityIndices
  • Core
  • DocStringExtensions
  • JLD
  • JLD2
  • Logging
  • MetaICVI.Rocket
  • NumericalTypeAliases
  • Parameters
  • PyCall
  • PyCallJLD
  • Random
  • ScikitLearn

Exports

The following names are exported and available when using the package:

source
MetaICVI.MetaICVIModuleType
mutable struct MetaICVIModule

Summary

Stateful information for a single MetaICVI module.

Fields

  • opts::MetaICVIOpts: Options for construction.
  • cvis::Vector{ClusterValidityIndices.CVI}: List of cvis used for computing the CVIs.
  • criterion_values::Vector{Vector{Float64}}: List of outputs of the cvis used for computing correlations.
  • correlations::Vector{Float64}: List of outputs of the rank correlations.
  • features::Vector{Float64}: List of outputs of the rocket feature kernels.
  • rocket::MetaICVI.Rocket.RocketModule: Time-series random feature kernels module.
  • classifier::PyCall.PyObject: ScikitLearn classifier.
  • performance::Float64: Final output of the most recent the Meta-ICVI step.
  • probabilities::Vector{Float64}: Final output of the most recent the Meta-ICVI step.
  • is_pretrained::Bool: Internal flag for if the classifier is trained and ready for inference.
source
MetaICVI.MetaICVIOptsType
mutable struct MetaICVIOpts

Summary

Meta-ICVI module options.

Examples

julia> MetaICVIOpts()

Fields

  • classifier_selection::Symbol: Which scikitlearn classifier to load. Default: :SGDClassifier

  • classifier_opts::NamedTuple: Scikitlearn classifier keyword arguments. Default: (loss = "log", max_iter = 30)

  • icvi_window::Int64: Size of ICVI window: [1, infty). Default: 5

  • correlation_window::Int64: Size of correlation window: [1, infty). Default: 5

  • n_rocket::Int64: Number of rocket kernels: [1, infty). Default: 5

  • rocket_file::String: Rocket file location. Default: module_dir("data", "models", "rocket.jld2")

  • classifier_file::String: Classifier file location. Default: module_dir("data", "models", "classifier.jld")

  • display::Bool: Display flag. Default: true

  • fail_on_missing::Bool: Flag to fail if any file is missing (rather than creating new objects). Default: false

source
MetaICVI.get_featuresMethod
get_features(
    metaicvi::MetaICVIModule,
    sample::AbstractVector{T} where T<:Real,
    label::Integer
) -> Vector{Float64}

Summary

Compute only the features on the sample and label without classifier inference.

Arguments

  • metaicvi::MetaICVIModule: the Meta-ICVI module.
  • sample::RealVector: the sample used for clustering.
  • label::Integer: the label prescribed to the sample by the clustering algorithm.

Method List / Definition Locations

get_features(metaicvi, sample, label)

defined at /home/runner/work/MetaICVI.jl/MetaICVI.jl/src/meta-icvi/meta-icvi.jl:452.

source
MetaICVI.get_icvisMethod
get_icvis(
    metaicvi::MetaICVIModule,
    sample::AbstractVector{T} where T<:Real,
    label::Integer
)

Summary

Compute and store the icvi criterion values.

Arguments

  • metaicvi::MetaICVIModule: the Meta-ICVI module.
  • sample::RealVector: the sample used for clustering.
  • label::Integer: the label prescribed to the sample by the clustering algorithm.

Method List / Definition Locations

get_icvis(metaicvi, sample, label)

defined at /home/runner/work/MetaICVI.jl/MetaICVI.jl/src/meta-icvi/meta-icvi.jl:359.

source
MetaICVI.get_metaicviMethod
get_metaicvi(
    metaicvi::MetaICVIModule,
    sample::AbstractVector{T} where T<:Real,
    label::Integer
) -> Float64

Summary

Compute and return the meta-icvi value.

Arguments

  • metaicvi::MetaICVIModule: the Meta-ICVI module.
  • sample::RealVector: the sample used for clustering.
  • label::Integer: the label prescribed to the sample by the clustering algorithm.

Method List / Definition Locations

get_metaicvi(metaicvi, sample, label)

defined at /home/runner/work/MetaICVI.jl/MetaICVI.jl/src/meta-icvi/meta-icvi.jl:471.

source
MetaICVI.train_and_saveMethod
train_and_save(
    metaicvi::MetaICVIModule,
    x::AbstractMatrix{T} where T<:Real,
    y::AbstractVector{T} where T<:Integer
) -> Any

Summary

Train the classifier on x/y and save the kernels and classifier.

Arguments

  • metaicvi::MetaICVIModule: metaicvi module to save with.
  • x::RealMatrix: features to train on.
  • y::IntegerVector: correct/over/under partition targets.

Method List / Definition Locations

train_and_save(metaicvi, x, y)

defined at /home/runner/work/MetaICVI.jl/MetaICVI.jl/src/meta-icvi/meta-icvi.jl:662.

source
MetaICVI.Rocket.RocketModuleType
RocketModule

Structure containing a vector of rocket kernels.

References

Authors

Angus Dempster, Francois Petitjean, Geoff Webb

Bibtex Entry

@article{dempsteretal2020, author = {Dempster, Angus and Petitjean, Francois and Webb, Geoffrey I}, title = {ROCKET: Exceptionally fast and accurate time classification using random convolutional kernels}, year = {2020}, journal = {Data Mining and Knowledge Discovery}, doi = {https://doi.org/10.1007/s10618-020-00701-z} }

Arxiv Preprint Link

https://arxiv.org/abs/1910.13051 (preprint)

source
MetaICVI.Rocket.RocketModuleMethod
RocketModule(input_length::Integer, n_kernels::Integer)

Create a new RocketModule structure, requiring feature length and the number of kernels.

source
MetaICVI.Rocket.apply_kernelMethod
apply_kernel(kernel::RocketKernel, x::RealVector)

Apply a single RocketModule kernel to the sequence x.

Arguments

  • kernel::RocketKernel: rocket kernel used for computing features.
  • x::RealVector: data sequence for computing rocket features.
source
MetaICVI.Rocket.apply_kernelsMethod
apply_kernels(rocket::RocketModule, x::RealVector)

Run a vector of rocket kernels along a sequence x.

Arguments

  • rocket::RocketModule: rocket module containing many kernels for processing.
  • x::RealVector: data sequence for computing rocket features.
source
MetaICVI.Rocket.load_rocketFunction
load_rocket(filepath::String="rocket.jld2")

Load and return a rocket module with existing parameters from a .jld2 file.

Arguments

filepath::String: path to .jld2 containing rocket parameters. Defaults to rocket.jld2.

source
MetaICVI.Rocket.save_rocketFunction
save_rocket(rocket::RocketModule, filepath::String="rocket.jld2")

Save the rocket parameters to a .jld2 file.

Arguments

rocket::RocketModule: rocket module to save. filepath::String: path to .jld2 for saving rocket parameters. Defaults to rocket.jld2.

source