Skip to content

Commit d07c2e0

Browse files
authored
Merge pull request #23 from JuliaAI/dev
For a 0.1.0 release take II
2 parents b397770 + 327f5a2 commit d07c2e0

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ version = "0.1.0"
77
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
88
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
99

10+
[compat]
11+
julia = "1.6"
12+
1013
[extras]
1114
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1215
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A base Julia interface for machine learning and statistics
1111
- [ ] Implement feedback and finish "To do" list (below)
1212
- [ ] Proof of concept implementation
1313
- [ ] Polish
14-
- [ ] Registration
14+
- [ ] **Register 0.2.0**
1515

1616
You can join a discussion on the LearnAPI proposal at [this](https://discourse.julialang.org/t/ann-learnapi-jl-proposal-for-a-basement-level-machine-learning-api/93048) Julia Discourse thread.
1717

docs/src/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ target appears in training (is supervised) or whether the model generalizes to n
112112
observations (learns) or not.
113113

114114
The target and the kind of predicted proxy are crucial features of ML/statistics
115-
performance measures and LearnAPI.jl provides a detailed list of proxy dispatch types (see
116-
[Target proxies](@ref)), as well as algorithm traits to articulate target type /scitype.
115+
performance measures (not provided by this package) and LearnAPI.jl provides a detailed
116+
list of proxy dispatch types (see [Target proxies](@ref)), as well as algorithm traits to
117+
articulate target type /scitype.
117118

118119

119120
## Optional data interface

src/tools.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ macro trait(algorithm_ex, exs...)
2121
end
2222

2323
"""
24+
typename(x)
2425
25-
typename(T::Type)
26+
Return a symbolic representation of the name of `type(x)`, stripped of any type-parameters
27+
and module qualifications. For example, if
2628
27-
Return a symbol corresponding to the name of the type `T`, stripped of
28-
any type-parameters and module qualifications. For example:
29+
typeof(x) = MLJBase.Machine{MLJAlgorithms.ConstantRegressor,true}
2930
30-
_typename(MLJBase.Machine{MLJAlgorithms.ConstantRegressor,true})
31-
32-
returns `:Machine`. Where this does not make sense (eg, instances of
33-
`Union`) `Symbol(string(M))` is returned.
31+
Then `typename(x)` returns `:Machine`.
3432
3533
"""
36-
function typename(M)
34+
function typename(x)
35+
M = typeof(x)
3736
if isdefined(M, :name)
3837
return M.name.name
3938
elseif isdefined(M, :body)

test/tools.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@ import .Fruit
1919
## HELPERS
2020

2121
@testset "typename" begin
22-
@test LearnAPI.typename(Fruit.RedApple) == :RedApple
23-
@test LearnAPI.typename(Fruit.RedApple{Int}) == :RedApple
24-
@test LearnAPI.typename(Nothing) == :Nothing
25-
@test LearnAPI.typename(UnionAll) == :UnionAll
26-
@test LearnAPI.typename(Union{Char,Int}) ==
27-
Symbol("Union{Char, Int64}")
28-
T = SparseArrays.sparse([1,2], [1,3], [0.5, 0.6]) |> typeof
29-
@test LearnAPI.typename(T) == :SparseMatrixCSC
22+
@test LearnAPI.typename(Fruit.RedApple(1)) == :RedApple
23+
@test LearnAPI.typename(nothing) == :Nothing
24+
m = SparseArrays.sparse([1,2], [1,3], [0.5, 0.6])
25+
@test LearnAPI.typename(m) == :SparseMatrixCSC
3026
end
3127

3228
@testset "snakecase" begin

0 commit comments

Comments
 (0)