Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/classification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ classify(x::RealMatrix, t::Real) = classify(x, t, Forward)
## label map

immutable LabelMap{K}
vs::Array{K}
vs::Vector{K}
v2i::Dict{K,Int}
end

function LabelMap{K}(vs::Array{K}, v2i::Dict{K,Int})
length(vs) == length(v2i) || throw(DimensionMismatch("Lengths of vs and v2i mismatch"))
LabelMap{K}(vs, v2i)
function LabelMap(vs, v2i)
length(vs) == length(v2i) || throw(DimensionMismatch("lengths of vs and v2i mismatch"))
new(vs, v2i)
end
end

LabelMap{K}(vs::Vector{K}, v2i::Dict{K,Int}) = LabelMap{K}(vs, v2i)

length(lmap::LabelMap) = length(lmap.vs)
keys(lmap::LabelMap) = lmap.vs

Expand Down
3 changes: 0 additions & 3 deletions src/perfeval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ immutable BinaryThresPredVec{ScoreVec <: RealVector,
ord::Ord
end

BinaryThresPredVec{SVec<:RealVector,T<:Real,Ord<:Ordering}(scores::SVec, thres::T, ord::Ord) =
BinaryThresPredVec{SVec,T,Ord}(scores, thres, ord)

length(v::BinaryThresPredVec) = length(v.scores)
getindex(v::BinaryThresPredVec, i::Integer) = !lt(v.ord, v.scores[i], v.thres)

Expand Down