Skip to content

Commit

Permalink
Removed whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
VaclavMacha committed Jul 30, 2020
1 parent a8f6bff commit 5c60ba8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/encodings/Encodings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export AbstractEncoding, MultiClassEncoding, TwoClassEncoding,


abstract type AbstractEncoding{T}; end
abstract type MultiClassEncoding{T} <: AbstractEncoding{T}; end
abstract type TwoClassEncoding{T} <: AbstractEncoding{T}; end
abstract type MultiClassEncoding{T} <: AbstractEncoding{T}; end
abstract type TwoClassEncoding{T} <: AbstractEncoding{T}; end

Base.show(io::IO, ::MIME"text/plain", enc::T) where {T <: TwoClassEncoding} =
print(io, "$T: \n positive class: $(enc.positives) \n negative class: $(enc.negatives)")
Expand Down
20 changes: 10 additions & 10 deletions src/encodings/twoclassencodings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ and `zero(T)` the negative class.
"""
struct OneZero{T<:Number} <: TwoClassEncoding{T}
positives::T
negatives::T
negatives::T

OneZero(::Type{T} = Float64) where {T<:Number} =
new{T}(one(T), zero(T))
new{T}(one(T), zero(T))
end


Expand All @@ -43,10 +43,10 @@ and `-one(T)` the negative class.
"""
struct OneMinusOne{T<:Number} <: TwoClassEncoding{T}
positives::T
negatives::T
negatives::T

OneMinusOne(::Type{T} = Float64) where {T<:Number} =
new{T}(one(T), -one(T))
new{T}(one(T), -one(T))
end


Expand All @@ -58,10 +58,10 @@ and `2*one(T)` the negative class.
"""
struct OneTwo{T<:Number} <: TwoClassEncoding{T}
positives::T
negatives::T
negatives::T

OneTwo(::Type{T} = Float64) where {T<:Number} =
new{T}(one(T), 2*one(T))
new{T}(one(T), 2*one(T))
end


Expand All @@ -74,7 +74,7 @@ struct OneVsOne{T} <: TwoClassEncoding{T}
positives::T
negatives::T

OneVsOne(pos::P, neg::N, ::Type{T} = default_type(P, N)) where {P, N, T} =
OneVsOne(pos::P, neg::N, ::Type{T} = default_type(P, N)) where {P, N, T} =
new{T}(T(pos), T(neg))
end

Expand All @@ -90,7 +90,7 @@ struct OneVsRest{T} <: TwoClassEncoding{T}
positives::T
negatives::AbstractVector{T}

OneVsRest(pos::P, neg::AbstractVector{N}, ::Type{T} = default_type(P, N)) where {P, N, T} =
OneVsRest(pos::P, neg::AbstractVector{N}, ::Type{T} = default_type(P, N)) where {P, N, T} =
new{T}(T(pos), T.(neg))
end

Expand All @@ -109,9 +109,9 @@ Two class label encoding ...
"""
struct RestVsOne{T} <: TwoClassEncoding{T}
positives::AbstractVector{T}
negatives::T
negatives::T

RestVsOne(pos::AbstractVector{P}, neg::N, ::Type{T} = default_type(P, N)) where {P, N, T} =
RestVsOne(pos::AbstractVector{P}, neg::N, ::Type{T} = default_type(P, N)) where {P, N, T} =
new{T}(T.(pos), T(neg))
end

Expand Down

0 comments on commit 5c60ba8

Please sign in to comment.