Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Mar 5, 2018
1 parent 9e5e0b8 commit 7c110b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
julia 0.6
StatsBase
LearnBase
NamedTuples
10 changes: 6 additions & 4 deletions src/OnlineStatsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ __precompile__(true)
module OnlineStatsBase

using NamedTuples
import LearnBase: value
import StatsBase: fit!
import LearnBase: fit!, value

#-----------------------------------------------------------------------# Data
const VectorOb = Union{AbstractVector, Tuple, NamedTuple} # 1
Expand All @@ -13,11 +12,14 @@ const XyOb = Tuple{VectorOb, Any} # (1, 0)
abstract type OnlineStat{N} end
default_weight(o::OnlineStat) = error("$(typeof(o)) has no `default_weight` method")

"An OnlineStat which can be `fit!`-ted and `merge!`-ed exactly"
"An OnlineStat that can be `fit!`-ted and `merge!`-ed exactly"
abstract type ExactStat{N} <: OnlineStat{N} end
default_weight(o::ExactStat) = EqualWeight()

"An OnlineStat that must be approximated. Subtypes are parameterized by an [`Updater`](@ref)"
"""
An OnlineStat that uses stochastic approximation. Subtypes should be parameterized by
an [`Updater`](@ref).
"""
abstract type StochasticStat{N} <: OnlineStat{N} end
default_weight(o::StochasticStat) = LearningRate()

Expand Down

0 comments on commit 7c110b0

Please sign in to comment.