@@ -66,7 +66,7 @@ this list, do `LearnAPI.functions()`.
6666See also [`LearnAPI.Algorithm`](@ref).
6767
6868"""
69- functions (:: Type ) = ()
69+ functions (:: Any ) = ()
7070
7171
7272"""
@@ -104,13 +104,13 @@ Then we can declare
104104which is shorthand for
105105
106106```julia
107- LearnAPI.preferred_kind_of_proxy(::Type{<: MyNewAlgorithmType} ) = LearnAPI.Distribution()
107+ LearnAPI.preferred_kind_of_proxy(::MyNewAlgorithmType) = LearnAPI.Distribution()
108108```
109109
110110For more on target variables and target proxies, refer to the LearnAPI documentation.
111111
112112"""
113- preferred_kind_of_proxy (:: Type ) = nothing
113+ preferred_kind_of_proxy (:: Any ) = nothing
114114
115115"""
116116 LearnAPI.position_of_target(algorithm)
@@ -122,7 +122,7 @@ If this number is `0`, then no target is expected. If this number exceeds `lengt
122122then `data` is understood to exclude the target variable.
123123
124124"""
125- position_of_target (:: Type ) = 0
125+ position_of_target (:: Any ) = 0
126126
127127"""
128128 LearnAPI.position_of_weights(algorithm)
@@ -135,7 +135,7 @@ If this number is `0`, then no weights are expected. If this number exceeds
135135uniform.
136136
137137"""
138- position_of_weights (:: Type ) = 0
138+ position_of_weights (:: Any ) = 0
139139
140140descriptors () = [
141141 :regression ,
@@ -180,7 +180,7 @@ Lists one or more suggestive algorithm descriptors from this list: $DOC_DESCRIPT
180180This trait should return a tuple of symbols, as in `(:classifier, :probabilistic)`.
181181
182182"""
183- descriptors (:: Type ) = ()
183+ descriptors (:: Any ) = ()
184184
185185"""
186186 LearnAPI.is_pure_julia(algorithm)
@@ -192,7 +192,7 @@ Returns `true` if training `algorithm` requires evaluation of pure Julia code on
192192The fallback is `false`.
193193
194194"""
195- is_pure_julia (:: Type ) = false
195+ is_pure_julia (:: Any ) = false
196196
197197"""
198198 LearnAPI.pkg_name(algorithm)
@@ -208,7 +208,7 @@ $DOC_UNKNOWN
208208Must return a string, as in `"DecisionTree"`.
209209
210210"""
211- pkg_name (:: Type ) = " unknown"
211+ pkg_name (:: Any ) = " unknown"
212212
213213"""
214214 LearnAPI.pkg_license(algorithm)
@@ -217,7 +217,7 @@ Return the name of the software license, such as `"MIT"`, applying to the packag
217217core algorithm for `algorithm` is implemented.
218218
219219"""
220- pkg_license (:: Type ) = " unknown"
220+ pkg_license (:: Any ) = " unknown"
221221
222222"""
223223 LearnAPI.doc_url(algorithm)
@@ -231,7 +231,7 @@ $DOC_UNKNOWN
231231Must return a string, such as `"https://en.wikipedia.org/wiki/Decision_tree_learning"`.
232232
233233"""
234- doc_url (:: Type ) = " unknown"
234+ doc_url (:: Any ) = " unknown"
235235
236236"""
237237 LearnAPI.load_path(algorithm)
@@ -250,7 +250,7 @@ $DOC_UNKNOWN
250250
251251
252252"""
253- load_path (:: Type ) = " unknown"
253+ load_path (:: Any ) = " unknown"
254254
255255
256256"""
@@ -268,7 +268,7 @@ $DOC_ON_TYPE
268268
269269
270270"""
271- is_wrapper (:: Type ) = false
271+ is_wrapper (:: Any ) = false
272272
273273"""
274274 LearnAPI.human_name(algorithm)
@@ -284,7 +284,7 @@ to return `"K-nearest neighbors regressor"`. Ideally, this is a "concrete" noun
284284`"ridge regressor"` rather than an "abstract" noun like `"ridge regression"`.
285285
286286"""
287- human_name (M:: Type{} ) = snakecase (name (M), delim= ' ' ) # `name` defined below
287+ human_name (M) = snakecase (name (M), delim= ' ' ) # `name` defined below
288288
289289"""
290290 LearnAPI.iteration_parameter(algorithm)
@@ -297,7 +297,7 @@ iterative.
297297Implement if algorithm is iterative. Returns a symbol or `nothing`.
298298
299299"""
300- iteration_parameter (:: Type ) = nothing
300+ iteration_parameter (:: Any ) = nothing
301301
302302"""
303303 LearnAPI.fit_keywords(algorithm)
@@ -314,7 +314,7 @@ Here's a sample implementation for a classifier that implements a `LearnAPI.fit`
314314with signature `fit(algorithm::MyClassifier, verbosity, X, y; class_weights=nothing)`:
315315
316316```
317- LearnAPI.fit_keywords(::Type {<:MyClassifier}) = (:class_weights,)
317+ LearnAPI.fit_keywords(::Any {<:MyClassifier}) = (:class_weights,)
318318```
319319
320320or the shorthand
@@ -325,7 +325,7 @@ or the shorthand
325325
326326
327327"""
328- fit_keywords (:: Type ) = ()
328+ fit_keywords (:: Any ) = ()
329329
330330"""
331331 LearnAPI.fit_scitype(algorithm)
@@ -353,7 +353,7 @@ See also [`LearnAPI.fit_type`](@ref), [`LearnAPI.fit_observation_scitype`](@ref)
353353Optional. The fallback return value is `Union{}`. $DOC_ONLY_ONE
354354
355355"""
356- fit_scitype (:: Type ) = Union{}
356+ fit_scitype (:: Any ) = Union{}
357357
358358"""
359359 LearnAPI.fit_observation_scitype(algorithm)
@@ -386,7 +386,7 @@ See also See also [`LearnAPI.fit_type`](@ref), [`LearnAPI.fit_scitype`](@ref),
386386Optional. The fallback return value is `Union{}`. $DOC_ONLY_ONE
387387
388388"""
389- fit_observation_scitype (:: Type ) = Union{}
389+ fit_observation_scitype (:: Any ) = Union{}
390390
391391"""
392392 LearnAPI.fit_type(algorithm)
@@ -413,7 +413,7 @@ See also [`LearnAPI.fit_scitype`](@ref), [`LearnAPI.fit_observation_type`](@ref)
413413Optional. The fallback return value is `Union{}`. $DOC_ONLY_ONE
414414
415415"""
416- fit_type (:: Type ) = Union{}
416+ fit_type (:: Any ) = Union{}
417417
418418"""
419419 LearnAPI.fit_observation_type(algorithm)
@@ -446,7 +446,7 @@ See also See also [`LearnAPI.fit_type`](@ref), [`LearnAPI.fit_scitype`](@ref),
446446Optional. The fallback return value is `Union{}`. $DOC_ONLY_ONE
447447
448448"""
449- fit_observation_type (:: Type ) = Union{}
449+ fit_observation_type (:: Any ) = Union{}
450450
451451DOC_INPUT_SCITYPE (op) =
452452 """
@@ -543,22 +543,22 @@ DOC_OUTPUT_TYPE(op) =
543543 """
544544
545545" $(DOC_INPUT_SCITYPE (:predict )) "
546- predict_input_scitype (:: Type ) = Union{}
546+ predict_input_scitype (:: Any ) = Union{}
547547
548548" $(DOC_INPUT_TYPE (:predict )) "
549- predict_input_type (:: Type ) = Union{}
549+ predict_input_type (:: Any ) = Union{}
550550
551551" $(DOC_INPUT_SCITYPE (:transform )) "
552- transform_input_scitype (:: Type ) = Union{}
552+ transform_input_scitype (:: Any ) = Union{}
553553
554554" $(DOC_OUTPUT_SCITYPE (:transform )) "
555- transform_output_scitype (:: Type ) = Any
555+ transform_output_scitype (:: Any ) = Any
556556
557557" $(DOC_INPUT_TYPE (:transform )) "
558- transform_input_type (:: Type ) = Union{}
558+ transform_input_type (:: Any ) = Union{}
559559
560560" $(DOC_OUTPUT_TYPE (:transform )) "
561- transform_output_type (:: Type ) = Any
561+ transform_output_type (:: Any ) = Any
562562
563563
564564# # TWO-ARGUMENT TRAITS
@@ -591,7 +591,7 @@ const DOC_PREDICT_OUTPUT(s) =
591591 regressor type `MyRgs` that only predicts actual values of the target:
592592
593593 LearnAPI.predict(alogrithm::MyRgs, ::LearnAPI.LiteralTarget, data...) = ...
594- LearnAPI.predict_output_$(s) (::Type{<: MyRgs} , ::LearnAPI.LiteralTarget) =
594+ LearnAPI.predict_output_$(s) (::MyRgs, ::LearnAPI.LiteralTarget) =
595595 AbstractVector{ScientificTypesBase.Continuous}
596596
597597 The fallback method returns `Any`.
@@ -607,9 +607,9 @@ predict_output_type(algorithm, kind_of_proxy) = Any
607607
608608# # DERIVED TRAITS
609609
610- name (A:: Type ) = string (typename (A))
610+ name (A) = string (typename (A))
611611
612- is_algorithm (A:: Type ) = ! isempty (functions (A))
612+ is_algorithm (A) = ! isempty (functions (A))
613613
614614const DOC_PREDICT_OUTPUT2 (s) =
615615 """
@@ -651,11 +651,3 @@ predict_output_type(algorithm) =
651651 for T in CONCRETE_TARGET_PROXY_TYPES)
652652
653653
654- # # FALLBACK FOR INSTANCES
655-
656- for trait in TRAITS
657- ex = quote
658- $ trait (x) = $ trait (typeof (x))
659- end
660- eval (ex)
661- end
0 commit comments