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

Add affinity propagation #574

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.10'
- '1'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ StatisticalTraits = "3"
Statistics = "<0.0.1, 1"
StatsBase = "0.32,0.33, 0.34"
Tables = "0.2,1.0"
julia = "1.6"
julia = "1.10"

[extras]
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
Expand Down
1 change: 1 addition & 0 deletions src/MLJModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ include("metadata.jl")

# read in the metadata:
metadata_file = joinpath(srcdir, "registry", "Metadata.toml")
Base.include_dependency(metadata_file)
Yuan-Ru-Lin marked this conversation as resolved.
Show resolved Hide resolved
const INFO_GIVEN_HANDLE = info_given_handle(metadata_file)
const PKGS_GIVEN_NAME = pkgs_given_name(INFO_GIVEN_HANDLE)
const AMBIGUOUS_NAMES = ambiguous_names(INFO_GIVEN_HANDLE)
Expand Down
36 changes: 36 additions & 0 deletions src/registry/Metadata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5939,6 +5939,42 @@
":reporting_operations" = "`()`"
":constructor" = "`RecursiveFeatureElimination`"

[Clustering.AffinityPropagation]
":input_scitype" = "`ScientificTypesBase.Table{<:AbstractVector{<:ScientificTypesBase.Continuous}}`"
":output_scitype" = "`ScientificTypesBase.Unknown`"
":target_scitype" = "`ScientificTypesBase.Unknown`"
":fit_data_scitype" = "`Tuple{}`"
":predict_scitype" = "`ScientificTypesBase.Unknown`"
":transform_scitype" = "`ScientificTypesBase.Unknown`"
":inverse_transform_scitype" = "`ScientificTypesBase.Table{<:AbstractVector{<:ScientificTypesBase.Continuous}}`"
":target_in_fit" = "`false`"
":is_pure_julia" = "`true`"
":package_name" = "Clustering"
":package_license" = "MIT"
":load_path" = "MLJClusteringInterface.AffinityPropagation"
":package_uuid" = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
":package_url" = "https://github.com/JuliaStats/Clustering.jl"
":is_wrapper" = "`false`"
":supports_weights" = "`false`"
":supports_class_weights" = "`false`"
":supports_online" = "`false`"
":docstring" = "To be added"
":name" = "AffinityPropagation"
":human_name" = "affinity propagation clusterer"
":is_supervised" = "`false`"
":prediction_type" = ":unknown"
":abstract_type" = "`MLJModelInterface.Static`"
":implemented_methods" = [":clean!", ":predict"]
":hyperparameters" = "`(:damp, :maxiter, :tol, :preference, :metric)`"
":hyperparameter_types" = "`(\"Float64\", \"Int64\", \"Float64\", \"Union{Nothing, Float64}\", \"Distances.SemiMetric\")`"
":hyperparameter_ranges" = "`(nothing, nothing, nothing, nothing, nothing)`"
":iteration_parameter" = "`nothing`"
":supports_training_losses" = "`false`"
":reports_feature_importances" = "`false`"
":deep_properties" = "`()`"
":reporting_operations" = "`(:predict,)`"
":constructor" = "`nothing`"

[Clustering.HierarchicalClustering]
":input_scitype" = "`Tuple{ScientificTypesBase.Table{<:AbstractVector{<:ScientificTypesBase.Continuous}}}`"
":output_scitype" = "`ScientificTypesBase.Unknown`"
Expand Down
2 changes: 1 addition & 1 deletion src/registry/Models.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MLJBalancing = ["BalancedBaggingClassifier", "BalancedModel"]
Imbalance = ["RandomOversampler", "SMOTENC", "TomekUndersampler", "ClusterUndersampler", "SMOTE", "SMOTEN", "ROSE", "RandomUndersampler", "ENNUndersampler", "BorderlineSMOTE1", "RandomWalkOversampler"]
MLJTuning = ["TunedModel"]
FeatureSelection = ["FeatureSelector", "RecursiveFeatureElimination"]
Clustering = ["HierarchicalClustering", "DBSCAN", "KMeans", "KMedoids"]
Clustering = ["HierarchicalClustering", "DBSCAN", "KMeans", "KMedoids", "AffinityPropagation"]
EvoLinear = ["EvoSplineRegressor", "EvoLinearRegressor"]
MLJText = ["TfidfTransformer", "CountTransformer", "BM25Transformer"]
LightGBM = ["LGBMClassifier", "LGBMRegressor"]
Expand Down
11 changes: 8 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# The next two lines added as a workaround to
# https://github.com/JuliaLang/Pkg.jl/issues/3628 (Julia 1.6):
import Pkg
Pkg.add(name="Statistics", version=VERSION)

if Base.VERSION >= v"1.10-"
# The issue with stdlib versions being fixed to 0.0.0 has been fixed in new versions of Julia
else
# The next line added as a workaround to
# https://github.com/JuliaLang/Pkg.jl/issues/3628 (Julia 1.6):
Pkg.add(name="Statistics", version=VERSION, uuid="10745b16-79ce-11e8-11f9-7d13ad32a3b2")
end

using Test, MLJModels

Expand Down
Loading