K-Medoids clustering using BetaML.jl package

Why does K-Medoids algorithm not work using BetaML.jl package? For example (from docs),

using BetaML

X = [1.1 10.1; 0.9 9.8; 10.0 1.1; 12.1 0.8; 0.8 9.8]
mod = KMedoidsClusterer(n_classes=2)

#Throws error: KMedoidsClusterer not defined

Am I using the wrong function? Thanks.

This works for me. What is your package status? In case you haven’t done it before, you can get this with

] st

at the REPL. I have BetaML v0.9.5, so if yours is outdated it might not have this functionality.

Surprisingly, when I add the package to my global environment, it adds the 0.7.0 version. Not sure what’s the reason for this. Here is the list of packages I have installed. Can you point out if this is due to some dependency conflict?

  [2e2ca445] BARON v0.8.0
  [6e4b80f9] BenchmarkTools v1.3.1
  [024491cd] BetaML v0.7.0
  [485130c0] BilevelJuMP v0.5.1
  [6cde8614] BlockDecomposition v1.8.0
  [a076750e] CPLEX v0.9.3
  [336ed68f] CSV v0.10.4
  [13f3f980] CairoMakie v0.8.12
  [aaaa29a8] Clustering v0.14.2
  [5ae59095] Colors v0.12.8
  [88b4ec78] Coluna v0.4.1
  [a81c6b42] Compose v0.9.4
  [717857b8] DSP v0.7.7
  [a93c6f00] DataFrames v1.3.6
  [31c24e10] Distributions v0.25.53
  [191a621a] Dualization v0.5.4
  [e9467ef8] GLMakie v0.6.12
  [1ecd5474] GraphMakie v0.4.1
  [a2cc645c] GraphPlot v0.5.2
  [bd48cda9] GraphRecipes v0.5.9
  [86223c79] Graphs v1.5.2
  [2e9cd046] Gurobi v0.11.3
  [b6b21f68] Ipopt v1.0.2
  [4076af6c] JuMP v1.0.0
  [98e50ef6] JuliaFormatter v1.0.3
  [b964fa9f] LaTeXStrings v1.3.0
  [093fc24a] LightGraphs v1.3.5
  [a4795742] NLPModels v0.18.4
  [792afdf1] NLPModelsJuMP v0.10.1
  [14b8a8f1] PkgTemplates v0.7.26
  [91a5bcdd] Plots v1.27.6
  [014a38d5] QuadraticToBinary v0.4.0
  [ce6b1742] RDatasets v0.7.7
  [189a3867] Reexport v1.2.2
  [47aef6b3] SimpleWeightedGraphs v1.1.1
  [2913bbd2] StatsBase v0.33.16
  [fdbf4ff8] XLSX v0.8.4
  [37e2e46d] LinearAlgebra

Thanks.

Try doing ] add BetaML@0.9.5. This probably won’t get the issue fixed, but should give a message indicating the package(s) that may be blocking the update.

From there, you can remove the packages that are causing issues and try again. Usually this happens with old packages that are no longer maintained.

1 Like