I have a dataset that contains both categorical (nominal and ordinal) and numerical attributes. I want to calculate the (dis)similarity matrix across my observations using these mixed attributes. Using the daisy() function of the cluster package in R, I can easily get a dissimilarity matrix as follows:
if(!require("cluster")) { install.packages("cluster"); require("cluster") }
data(flower)
as.matrix(daisy(flower, metric = "gower"))
This uses the gower metric to deal with the nominal variables. Is there a Python equivalent of the daisy()
function in R?
Or maybe any other module function that allows using the Gower metric or something similar to calculate the (dis)similarity matrix for a dataset with mixed (nominal, numeric) attributes?