Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] (**Enhancement**) Overload `mean`, `mode` and `median` for `Nodes` (#288)
- Loading branch information
Showing
16 changed files
with
209 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Syntactic sugar for arrow syntax | ||
# we need version ≥ 1.3 in order to make use of multiple dispatch | ||
# over abstract types | ||
|
||
|
||
# This allows implicit: data |> machine | ||
(mach::AbstractMachine{<:Unsupervised})(data) = transform(mach, data) | ||
(mach::AbstractMachine{<:Supervised})(data) = predict(mach, data) | ||
(mach::AbstractMachine)(data::AbstractMatrix) = data |> table |> mach | ||
|
||
# This allows implicit: data |> Unsupervised | ||
(m::Unsupervised)(data::AbstractNode) = data |> machine(m, data) | ||
(m::Unsupervised)(data) = source(data) |> m | ||
(m::Unsupervised)(data::AbstractMatrix) = data |> table |> m | ||
|
||
# This allows implicit: data |> Supervised | ||
(m::Supervised)(data::NTuple{2,AbstractNode}) = data[1] |> machine(m, data...) | ||
(m::Supervised)(data::Tuple{AbstractNode,Any}) = (data[1], source(data[2], kind=:target)) |> m | ||
(m::Supervised)(data::Tuple) = (source(data[1]), data[2]) |> m | ||
(m::Supervised)(data::Tuple{AbstractMatrix,Any}) = (data[1] |> table, data[2]) |> m | ||
|
||
# This allows implicit: data |> inverse_transform(node) | ||
inverse_transform(node::Node{<:NodalMachine{<:Unsupervised}}) = | ||
data -> inverse_transform(node.machine, data) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1 comment
on commit f251001
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/5368
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:
git tag -a v0.5.3 -m "<description of version>" f251001a915731f28799567e054007d61e077d8c
git push origin v0.5.3
@JuliaRegistrator register
Release note:
mean
,mode
andmedian
forNodes
(#288)