The concept clustering method separates data instances into groups based on their similarity in multiple description spaces, i.e. sets of features.
- install via pip:
pip install .
Checkout the example scripts in ./examples/.
Basic usage:
import pandas as pd
from concept_clustering.concept_clustering import ConceptClustering
# define description spaces
features_per_space = [
["Investment costs"],
["Yearly total costs", "posResilience"],
]
list_of_features = [item for sublist in features_per_space for item in sublist]
# set number of clusters
num_clusters = 3
# get data
data = pd.read_csv("./energy.csv", usecols=list_of_features)
# initialize and fit ConceptClustering
ConClus = ConceptClustering(
description_spaces=features_per_space,
n_clusters=num_clusters,
max_iter=100,
).fit(X=data, centers="k")
print(ConClus.concepts_)