Skip to content

Commit

Permalink
Add MLJ.{un,}supervisedtask methods
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Apr 16, 2019
1 parent 19ea457 commit f13e0c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tasks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ function coerce(types::Dict{Symbol, Type}, X)
names = schema(X).names
NamedTuple{names}(coerce(types[name], selectcols(X, name)) for name in names)
end

supervisedtask(; data=nothing, types=nothing, kwargs...) =
SupervisedTask(; data = coerce(types, data), kwargs...)
unsupervisedtask(; data=nothing, types=nothing, kwargs...) =
UnsupervisedTask(; data = coerce(types, data), kwargs...)

0 comments on commit f13e0c1

Please sign in to comment.