Skip to content

Commit

Permalink
Merge pull request #635 from luisheb/clustering_example_error
Browse files Browse the repository at this point in the history
Clustering example error fixed
  • Loading branch information
vnmabus authored Oct 23, 2024
2 parents d0bc82f + 2f48baa commit d39e009
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/plot_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@
print(kmeans.predict(fd))

##############################################################################
# To see the information in a graphic way, the method
# :func:`~skfda.exploratory.visualization.clustering_plots.plot_clusters` can
# be used.
# To see the information in a graphic way, we can use the class
# :class:`~skfda.exploratory.visualization.clustering.ClusterPlot`.

# Customization of cluster colors and labels in order to match the first image
# of raw data.
Expand All @@ -104,8 +103,8 @@
print(fuzzy_kmeans.predict_proba(fd))

##############################################################################
# To see the information in a graphic way, the method
# :func:`~skfda.exploratory.visualization.clustering_plots.plot_clusters` can
# To see the information in a graphic way, the class
# :class:`~skfda.exploratory.visualization.clustering.ClusterPlot` can
# be used. It assigns each sample to the cluster whose membership value is the
# greatest.

Expand All @@ -115,7 +114,7 @@
##############################################################################
# Another plot implemented to show the results in the class
# :class:`~skfda.ml.clustering.FuzzyCMeans` is
# :func:`~skfda.exploratory.visualization.clustering_plots.plot_cluster_lines`
# :class:`~skfda.exploratory.visualization.clustering.ClusterMembershipLinesPlot`.
# which is similar to parallel coordinates. It is recommended to assign colors
# to each of the samples in order to identify them. In this example, the
# colors are the ones of the first plot, dividing the samples by climate.
Expand All @@ -126,8 +125,9 @@
sample_colors=colors_by_climate).plot()

##############################################################################
# Finally, the function
# :func:`~skfda.exploratory.visualization.clustering_plots.plot_cluster_bars`
# Finally, the class
# :class:`~skfda.exploratory.visualization.clustering.ClusterMembershipPlot`
# has a plot method which
# returns a barplot. Each sample is designated with a bar which is filled
# proportionally to the membership values with the color of each cluster.

Expand Down

0 comments on commit d39e009

Please sign in to comment.