Skip to content

Commit

Permalink
Merge pull request #415 from alan-turing-institute/dev
Browse files Browse the repository at this point in the history
For 0.6.1 release
  • Loading branch information
ablaom committed Jan 3, 2020
2 parents 38744e4 + 52ad6d8 commit a7084d2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJ"
uuid = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
authors = ["Anthony D. Blaom <anthony.blaom@gmail.com>"]
version = "0.6"
version = "0.6.1"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand Down Expand Up @@ -37,7 +37,7 @@ OrderedCollections = "^1.1"
PrettyTables = "^0.6"
ProgressMeter = "^1.1"
RecipesBase = "^0.7"
ScientificTypes = "^0.3"
ScientificTypes = "^0.3.2"
StatsBase = "^0.32"
Tables = "^0.2"
julia = "1"
Expand Down
2 changes: 1 addition & 1 deletion src/resampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Holdout resampling strategy, for use in `evaluate!`, `evaluate` and in tuning.
Returns the pair `[(train, test)]`, where `train` and `test` are
vectors such that `rows=vcat(train, test)` and
`length(train)/length(test)` is approximatey equal to fraction_train`.
`length(train)/length(rows)` is approximatey equal to fraction_train`.
Pre-shuffling of `rows` is controlled by `rng` and `shuffle`. If `rng`
is an integer, then the `Holdout` keyword constructor resets it to
Expand Down
20 changes: 9 additions & 11 deletions src/scitypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

struct SupervisedScitype{input_scitype, target_scitype, prediction_type} end

ScientificTypes.scitype(model::Deterministic, ::Val{:mlj}) =
ScientificTypes.scitype(model::Deterministic, ::ScientificTypes.MLJ) =
SupervisedScitype{input_scitype(model),
target_scitype(model),
:deterministic}
ScientificTypes.scitype(model::Probabilistic, ::Val{:mlj}) =

ScientificTypes.scitype(model::Probabilistic, ::ScientificTypes.MLJ) =
SupervisedScitype{input_scitype(model),
target_scitype(model),
:probabilistic}
ScientificTypes.scitype(model::Interval, ::Val{:mlj}) =

ScientificTypes.scitype(model::Interval, ::ScientificTypes.MLJ) =
SupervisedScitype{input_scitype(model),
target_scitype(model),
:interval}

function Base.getproperty(::SupervisedScitype{input_scitype, target_scitype, prediction_type},
field::Symbol) where {input_scitype, target_scitype, prediction_type}
if field === :input_scitype
Expand Down Expand Up @@ -48,7 +48,7 @@ end

struct UnsupervisedScitype{input_scitype, output_scitype} end

ScientificTypes.scitype(model::Unsupervised, ::Val{:mlj}) =
ScientificTypes.scitype(model::Unsupervised, ::ScientificTypes.MLJ) =
UnsupervisedScitype{input_scitype(model),
MLJBase.output_scitype(model)}

Expand Down Expand Up @@ -77,7 +77,7 @@ function Base.show(io::IO, ::MIME"text/plain", S::UnsupervisedScitype)
show(io, MIME("text/plain"), _as_named_tuple(S))
end


## MEASURES

struct MeasureScitype{target_scitype,
Expand All @@ -87,7 +87,7 @@ struct MeasureScitype{target_scitype,
is_feature_dependent,
supports_weights} end

ScientificTypes.scitype(measure, ::Val{:mlj}, ::Val{:measure}) =
ScientificTypes.scitype(measure, ::ScientificTypes.MLJ, ::Val{:measure}) =
MeasureScitype{target_scitype(measure),
prediction_type(measure),
orientation(measure),
Expand Down Expand Up @@ -140,5 +140,3 @@ end
function Base.show(io::IO, ::MIME"text/plain", M::MeasureScitype)
show(io, MIME("text/plain"), _as_named_tuple(M))
end


0 comments on commit a7084d2

Please sign in to comment.