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

models("Outlier") not finding the OutlierDetectionPython models #453

Closed
ablaom opened this issue Apr 6, 2022 · 4 comments
Closed

models("Outlier") not finding the OutlierDetectionPython models #453

ablaom opened this issue Apr 6, 2022 · 4 comments
Assignees
Labels

Comments

@ablaom
Copy link
Member

ablaom commented Apr 6, 2022

As expected:

julia> models() do m m.package_name == "OutlierDetectionPython" end
17-element Vector{NamedTuple{(:name, :package_name, :is_supervised, :abstract_type, :deep_properties, :docstring, :fit_data_scitype, :human_name, :hyperparameter_ranges, :hyperparameter_types, :hyperparameters, :implemented_methods, :inverse_transform_scitype, :is_pure_julia, :is_wrapper, :iteration_parameter, :load_path, :package_license, :package_url, :package_uuid, :predict_scitype, :prediction_type, :supports_class_weights, :supports_online, :supports_training_losses, :supports_weights, :transform_scitype, :input_scitype, :target_scitype, :output_scitype), T} where T<:Tuple}:
 (name = ABODDetector, package_name = OutlierDetectionPython, ... )
 (name = CBLOFDetector, package_name = OutlierDetectionPython, ... )
 (name = COFDetector, package_name = OutlierDetectionPython, ... )
 (name = COPODDetector, package_name = OutlierDetectionPython, ... )
 (name = HBOSDetector, package_name = OutlierDetectionPython, ... )
 (name = IForestDetector, package_name = OutlierDetectionPython, ... )
 (name = KNNDetector, package_name = OutlierDetectionPython, ... )
 (name = LMDDDetector, package_name = OutlierDetectionPython, ... )
 (name = LOCIDetector, package_name = OutlierDetectionPython, ... )
 (name = LODADetector, package_name = OutlierDetectionPython, ... )
 (name = LOFDetector, package_name = OutlierDetectionPython, ... )
 (name = MCDDetector, package_name = OutlierDetectionPython, ... )
 (name = OCSVMDetector, package_name = OutlierDetectionPython, ... )
 (name = PCADetector, package_name = OutlierDetectionPython, ... )
 (name = RODDetector, package_name = OutlierDetectionPython, ... )
 (name = SODDetector, package_name = OutlierDetectionPython, ... )
 (name = SOSDetector, package_name = OutlierDetectionPython, ... )

But where are they below?

julia> models("Outlier")
9-element Vector{NamedTuple{(:name, :package_name, :is_supervised, :abstract_type, :deep_properties, :docstring, :fit_data_scitype, :human_name, :hyperparameter_ranges, :hyperparameter_types, :hyperparameters, :implemented_methods, :inverse_transform_scitype, :is_pure_julia, :is_wrapper, :iteration_parameter, :load_path, :package_license, :package_url, :package_uuid, :predict_scitype, :prediction_type, :supports_class_weights, :supports_online, :supports_training_losses, :supports_weights, :transform_scitype, :input_scitype, :target_scitype, :output_scitype), T} where T<:Tuple}:
 (name = ABODDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = AEDetector, package_name = OutlierDetectionNetworks, ... )
 (name = COFDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = DNNDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = DSADDetector, package_name = OutlierDetectionNetworks, ... )
 (name = ESADDetector, package_name = OutlierDetectionNetworks, ... )
 (name = KNNDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = LOFDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = OneClassSVM, package_name = LIBSVM, ... )
@ablaom ablaom added bug Something isn't working easy labels Apr 6, 2022
@Frank-III
Copy link

My Julia and MLJ version

Julia Version 1.7.2
MLJ v0.16.7

and this function seems work fine for me

julia> models("Outlier")
25-element Vector{NamedTuple{(:name, :package_name, :is_supervised, :abstract_type, :deep_properties, :docstring, :fit_data_scitype, :hyperparameter_ranges, :hyperparameter_types, :hyperparameters, :implemented_methods, :inverse_transform_scitype, :is_pure_julia, :is_wrapper, :iteration_parameter, :load_path, :package_license, :package_url, :package_uuid, :predict_scitype, :prediction_type, :supports_class_weights, :supports_online, :supports_training_losses, :supports_weights, :transform_scitype, :input_scitype, :target_scitype, :output_scitype)}}:
 (name = ABODDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = ABODDetector, package_name = OutlierDetectionPython, ... )
 (name = AEDetector, package_name = OutlierDetectionNetworks, ... )
 (name = CBLOFDetector, package_name = OutlierDetectionPython, ... )
 (name = COFDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = COFDetector, package_name = OutlierDetectionPython, ... )
 (name = COPODDetector, package_name = OutlierDetectionPython, ... )
 (name = DNNDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = DSADDetector, package_name = OutlierDetectionNetworks, ... )
 (name = ESADDetector, package_name = OutlierDetectionNetworks, ... )
 (name = HBOSDetector, package_name = OutlierDetectionPython, ... )
 (name = IForestDetector, package_name = OutlierDetectionPython, ... )
 (name = KNNDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = KNNDetector, package_name = OutlierDetectionPython, ... )
 (name = LMDDDetector, package_name = OutlierDetectionPython, ... )
 (name = LOCIDetector, package_name = OutlierDetectionPython, ... )
 (name = LODADetector, package_name = OutlierDetectionPython, ... )
 (name = LOFDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = LOFDetector, package_name = OutlierDetectionPython, ... )
 (name = MCDDetector, package_name = OutlierDetectionPython, ... )
 (name = OCSVMDetector, package_name = OutlierDetectionPython, ... )
 (name = PCADetector, package_name = OutlierDetectionPython, ... )
 (name = RODDetector, package_name = OutlierDetectionPython, ... )
 (name = SODDetector, package_name = OutlierDetectionPython, ... )
 (name = SOSDetector, package_name = OutlierDetectionPython, ... )

@ablaom
Copy link
Member Author

ablaom commented May 6, 2022

Right, thanks @Frank-III . If I use MLJModels v0.14.14 I get the same as you. So the cause postdates that version of MLJModels.jl.

@ablaom ablaom self-assigned this May 6, 2022
@ablaom ablaom removed the bug Something isn't working label May 6, 2022
@ablaom
Copy link
Member Author

ablaom commented May 6, 2022

I have resolved that the new behaviour, while unexpected, is correct. For example, the doc-string for the OutlierDetectionPython model called KNNDetector does not contain the string "Outlier":

julia> v=models("KNNDetector")
2-element Vector{NamedTuple{(:name, :package_name, :is_supervised, :abstract_type, :deep_properties, :docstring, :fit_data_scitype, :human_name, :hyperparameter_ranges, :hyperparameter_types, :hyperparameters, :implemented_methods, :inverse_transform_scitype, :is_pure_julia, :is_wrapper, :iteration_parameter, :load_path, :package_license, :package_url, :package_uuid, :predict_scitype, :prediction_type, :supports_class_weights, :supports_online, :supports_training_losses, :supports_weights, :transform_scitype, :input_scitype, :target_scitype, :output_scitype), T} where T<:Tuple}:
 (name = KNNDetector, package_name = OutlierDetectionNeighbors, ... )
 (name = KNNDetector, package_name = OutlierDetectionPython, ... )

julia> knn2 = v[2];

julia> Markdown.parse(knn2.docstring)
  KNNDetector(n_neighbors = 5,
           method = "largest",
           radius = 1.0,
           algorithm = "auto",
           leaf_size = 30,
           metric = "minkowski",
           p = 2,
           metric_params = nothing,
           n_jobs = 1)

  https://pyod.readthedocs.io/en/latest/pyod.models.html#module-pyod.models.knn
  (https://pyod.readthedocs.io/en/latest/pyod.models.html#module-pyod.models.knn)

(while the other KNNDetector does). The change in the behaviour is either because of a change in the docstring (which I could not find) or quite possibly this MLJModelInterface change (last item). We had decided changes to docstrings should not be regarded as breaking.

@ablaom ablaom closed this as completed May 6, 2022
@ablaom
Copy link
Member Author

ablaom commented May 6, 2022

When the docstrings for OutlierDetection package are updated a more expected (and useful) behavior ought to return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants