Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up export of measure-related methods #892

Merged
merged 2 commits into from
Jan 19, 2022
Merged

Clean up export of measure-related methods #892

merged 2 commits into from
Jan 19, 2022

Conversation

ablaom
Copy link
Member

@ablaom ablaom commented Jan 19, 2022

This PR needs:

This PR does the following (which includes resolution of #890):

  • re-organizes src/MLJ.jl to have order: imports, definition of global constants, include files, exports

  • cleans up export of measure-related exports by using new constant MLJBase.MEASURE_TYPES_ALIASES_AND_INSTANCES and some meta-programming; some forgotten measure names are re-exported as a result (see below)

  • cleans up export of traits (for models and measures) by exporting almost all of MLJ.MLJBase.StatisticalTraits.TRAITS programatically. This results in a large number of new trait exports, which I don't think will do any harm, but will make things less confusing to users. The exceptions are listed in the following new global constant:

const TRAITS_NOT_EXPORTED = [
    :supports_online, # no models support this
    :name,            # likely conflict with other uses
    :abstract_type,   # for advanced development only
    :hyperparameter_ranges # not implemented and will probably be deprecated
                           # in favour of hyperparameter priors
]

All previously exported methods are exported - I have explicitly checked this with names(MLJ) (one exception was a name with no corresponding methods, rmsl1). The following are the new exports:

julia> setdiff(new, old)
32-element Vector{Symbol}:
 :CrossEntropy
 :LogScore
 :MNPV
 :RMSPV
 :RSQ
 :RSquared
 :SphericalScore
 :deep_properties
 :distribution_type
 :docstring
 :fit_data_scitype
 :hyperparameter_types
 :hyperparameters
 :inverse_transform_scitype
 :is_pure_julia
 :is_supervised
 :is_wrapper
 :iteration_parameter
 :log_score
 :package_license
 :package_name
 :package_url
 :package_uuid
 :precision
 :predict_scitype
 :rsq
 :rsquared
 :skipinvalid
 :spherical_score
 :supports_training_losses
 :supports_weights
 :transform_scitype

Copy link
Member

@OkonSamuel OkonSamuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ablaom ablaom merged commit c9ebc77 into dev Jan 19, 2022
@ablaom
Copy link
Member Author

ablaom commented Jan 19, 2022

cc @jbrea

This was referenced Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants