|
1 | 1 | module StatisticalTraits
|
2 | 2 |
|
3 |
| -using ScientificTypes |
| 3 | +using ScientificTypesBase |
4 | 4 | import Base.instances
|
5 | 5 |
|
6 | 6 | ## CONSTANTS
|
@@ -33,7 +33,8 @@ const TRAITS = [
|
33 | 33 | :is_feature_dependent,
|
34 | 34 | :distribution_type,
|
35 | 35 | :iteration_parameter,
|
36 |
| - :supports_training_losses |
| 36 | + :supports_training_losses, |
| 37 | + :deep_properties |
37 | 38 | ]
|
38 | 39 |
|
39 | 40 |
|
@@ -124,7 +125,7 @@ snakecase(s::Symbol) = Symbol(snakecase(string(s)))
|
124 | 125 | ## TRAITS
|
125 | 126 |
|
126 | 127 | # The following can return any scientific type, that is, any type
|
127 |
| -# defined in the package ScientificTypes.jl, and any ordinary type |
| 128 | +# defined in the package ScientificTypesBase.jl, and any ordinary type |
128 | 129 | # that functions as a scientific type (eg, `Missing`). Here "target"
|
129 | 130 | # is a synonym for "labels", as in supervised learning; "input" is a
|
130 | 131 | # synonym for "features":
|
@@ -168,6 +169,7 @@ reports_each_observation(::Type) = false
|
168 | 169 | distribution_type(::Type) = missing
|
169 | 170 | iteration_parameter(::Type) = nothing
|
170 | 171 | supports_training_losses(::Type) = false
|
| 172 | +deep_properties(::Type) = () |
171 | 173 |
|
172 | 174 | # Returns a tuple, with one entry per field of `T` (the type of some
|
173 | 175 | # statistical model, for example). Each entry is `nothing` or defines
|
@@ -205,11 +207,11 @@ traits that are meaninful for the object.
|
205 | 207 | *Note on overloading.* This method can be overloaded directly, as in
|
206 | 208 | `info(X::SomeAbstractType) = ...` or, using `info(X,
|
207 | 209 | ::Val{:some_trait}) = ...` where `:some_trait` is a key of
|
208 |
| -`ScientificTypes.TRAIT_FUNCTION_GIVEN_NAME` (such as `:is_measure` |
| 210 | +`ScientificTypesBase.TRAIT_FUNCTION_GIVEN_NAME` (such as `:is_measure` |
209 | 211 | with value `is_measure`).
|
210 | 212 |
|
211 | 213 | """
|
212 |
| -info(X) = info(X, Val(ScientificTypes.trait(X))) |
| 214 | +info(X) = info(X, Val(ScientificTypesBase.trait(X))) |
213 | 215 | info(X, ::Val{:other}) = NamedTuple()
|
214 | 216 |
|
215 | 217 | end # module
|
0 commit comments