Predictors

Predictors

Following are the available online predictors provided by this package.

Adaptive MPP

AdaptiveMPP{SymbolType}(context_length::Int [,α::Float64 ])

Creates an Adaptive MPP predictor with a context depth of context_length and mixing coefficient $α$ for SymbolType. Default value of mixing parameter $α = 0.10$. SymbolType can be any valid type including Char, Int etc.,

Examples

julia> p = AdaptiveMPP{Char}(4)
DiscretePredictors.adaptiveMPP{Char}([*] (0)
, Char[], 4, 0.1, Inf, 0.0, [0.2, 0.2, 0.2, 0.2, 0.2], Dict{Char,Float64}[Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}()])

julia> p = AdaptiveMPP{Char}(4,0.13)
DiscretePredictors.adaptiveMPP{Char}([*] (0)
, Char[], 4, 0.13, Inf, 0.0, [0.2, 0.2, 0.2, 0.2, 0.2], Dict{Char,Float64}[Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}()])

Reference: V’yugin, Vladimir V. "Online Aggregation of Unbounded Signed Losses Using Shifting Experts." Conformal and Probabilistic Prediction and Applications. 2017.

source

Active LeZi

ALZ{SymbolType}()

Creates an Active LeZi predictor for SymbolType. SymbolType can be any valid type including Char, Int etc.,

Examples

julia> p = ALZ{Char}()
DiscretePredictors.ALZ{Char}(Array{Char,1}[], [*] (0)
, Char[], Char[], 0)

julia> p = ALZ{Int}()
DiscretePredictors.ALZ{Int}(Array{Int,1}[], [*] (0)
, Int[], Int[], 0)

Reference: Gopalratnam, Karthik, and Diane J. Cook. "Online sequential prediction via incremental parsing: The active lezi algorithm." IEEE Intelligent Systems 22.1 (2007).

source

Dependency Graph

DG{SymbolType}(win_length::Int)

Creates a Dependency Graph predictor for SymbolType with lookahead window of win_length. SymbolType can be any valid type including Char, Int etc.,

Examples

jjulia> p = DG{Char}( 4 )
DiscretePredictors.DG{Char}([*] (0)
, Char[], 4)

julia> p = DG{Int}( 3 )
DiscretePredictors.DG{Int}([*] (0)
, Int[], 3)

Reference: Padmanabhan, Venkata N., and Jeffrey C. Mogul. "Using predictive prefetching to improve world wide web latency." ACM SIGCOMM Computer Communication Review 26.3 (1996): 22-36.

source

Discounted HEDGE with PPM

dHedgePPM{SymbolType}( c::Int, [ β::Float64 = 1.0, γ::Float64 = 1.0 ] )

Creates a Discounted HEDGE Predictor for SymbolType with context length c, learning parameter $β$ and discounting parameter $γ$.

Examples

julia> p = dHedgePPM{Char}( 4 )
DiscretePredictors.dHedgePPM{Char}([*] (0)
, Char[], 4, 1.0, 1.0, [1.0, 1.0, 1.0, 1.0, 1.0], Dict{Char,Float64}[Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}()])

julia> p = dHedgePPM{Char}( 4, 0.8 )
DiscretePredictors.dHedgePPM{Char}([*] (0)
, Char[], 4, 0.8, 1.0, [1.0, 1.0, 1.0, 1.0, 1.0], Dict{Char,Float64}[Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}()])

julia> p = dHedgePPM{Char}( 4, 0.9, 0.8 )
DiscretePredictors.dHedgePPM{Char}([*] (0)
, Char[], 4, 0.9, 0.8, [1.0, 1.0, 1.0, 1.0, 1.0], Dict{Char,Float64}[Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}(), Dict{Char,Float64}()])

Reference: Raj, Vishnu, and Sheetal Kalyani. "An aggregating strategy for shifting experts in discrete sequence prediction." arXiv preprint arXiv:1708.01744 (2017).

source

Error Weighted PPM

ewPPM{Char}( c::Int [,ϵ::Float64 = 1.0] )

Creates an Error Weighted PPM predictor with context length c and weighing paramter ϵ.

Examples

julia> p = ewPPM{Int}(3)
DiscretePredictors.ewPPM{Int}([*] (0)
, Int[], 3, 1.0, [1.0, 1.0, 1.0, 1.0], Dict{Int,Float64}[Dict{Int,Float64}(), Dict{Int,Float64}(), Dict{Int,Float64}(), Dict{Int,Float64}()])

julia> p = ewPPM{Int}(3, 0.95)
DiscretePredictors.ewPPM{Int}([*] (0)
, Int[], 3, 0.95, [1.0, 1.0, 1.0, 1.0], Dict{Int,Float64}[Dict{Int,Float64}(), Dict{Int,Float64}(), Dict{Int,Float64}(), Dict{Int,Float64}()])

Reference: Pulliyakode, Saishankar Katri, and Sheetal Kalyani. "A modified ppm algorithm for online sequence prediction using short data records." IEEE Communications Letters 19.3 (2015): 423-426.

source

K-th Order Markov Model

KOM{SymbolType}(context_length::Int)

Creates a K-th Order Markov Model predictor with a context depth of context_length for SymbolType. SymbolType can be any valid type including Char, Int etc.,

Examples

julia> p = KOM{Char}(3)
DiscretePredictors.KOM{Char}([*] (0)
, Char[], 3)

julia> p = KOM{Int}(5)
DiscretePredictors.KOM{Int}([*] (0)
, Int[], 5)

julia> p = KOM{String}(4)
DiscretePredictors.KOM{String}([*] (0)
, String[], 4)

Reference:

source

LeZi Update

LeZiUpdate{SymbolType}()

Creates a LeZiUpdate predictor for SymbolType. SymbolType can be any valid type including Char, Int etc.,

Examples

julia> p = LeZiUpdate{Char}()
DiscretePredictors.LeZiUpdate{Char}(Array{Char,1}[], [*] (0)
, Char[], Char[])

julia> p = LeZiUpdate{Int}()
DiscretePredictors.LeZiUpdate{Int}(Array{Int,1}[], [*] (0)
, Int[], Int[])

julia> p = LeZiUpdate{String}()
DiscretePredictors.LeZiUpdate{String}(Array{String,1}[], [*] (0)
, String[], String[])

Reference: Bhattacharya, Amiya, and Sajal K. Das. "LeZi-update: An information-theoretic framework for personal mobility tracking in PCS networks." Wireless Networks 8.2/3 (2002): 121-135.

source

LZ78

LZ78{SymbolType}()

Creates a LZ78 predictor for SymbolType. SymbolType can be any valid type including Char, Int etc.,

Examples

julia> p = LZ78{Int}()
DiscretePredictors.LZ78{Int}([*] (0)
, Int[], Int[])

julia> p = LZ78{Char}()
DiscretePredictors.LZ78{Char}([*] (0)
, Char[], Char[])

julia> p = LZ78{String}()
DiscretePredictors.LZ78{String}([*] (0)
, String[], String[])

Reference: Ziv, Jacob, and Abraham Lempel. "Compression of individual sequences via variable-rate coding." IEEE transactions on Information Theory 24.5 (1978): 530-536.

source