Skip to content

Commit

Permalink
Merge pull request #262 from JuliaStats/ast/fix_docs
Browse files Browse the repository at this point in the history
Fix documentation generation
  • Loading branch information
alyst authored Oct 7, 2023
2 parents 24dba09 + b227971 commit b920079
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/fuzzycmeans.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and ``m > 1`` is a user-defined fuzziness parameter.
```@docs
fuzzy_cmeans
FuzzyCMeansResult
wcounts(::FuzzyCMeansResult)
wcounts
```

## Examples
Expand Down
4 changes: 2 additions & 2 deletions src/cluster_distances.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
#===
Base type for efficient computation of average(mean) distances
from the cluster centers to a given point.
Expand All @@ -7,7 +7,7 @@ The descendant types should implement the following methods:
state of `dists` with point coordinates and their assignments to the clusters
* `sumdistances(dists, points, indices)`: compute the sum of
distances from all `dists` clusters to `points`
"""
===#
abstract type ClusterDistances{T} end

# create empty ClusterDistances object for a given metric
Expand Down
20 changes: 10 additions & 10 deletions src/hclust.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function hclust_n3(d::AbstractMatrix, linkage::Function)
return htre.merges
end

"""
#===
ReducibleMetric{T<:Real}
Base type for _reducible_ Lance–Williams cluster metrics.
Expand All @@ -235,20 +235,20 @@ d(A∪B, C) > ρ
If the cluster metrics belongs to Lance-Williams family, there is an efficient
formula that defines `d(A∪B, C)` using `d(A, C)`, `d(B, C)` and `d(A, B)`.
"""
===#
abstract type ReducibleMetric{T <: Real} end

# due to reducibility, new_dki=d[k,i∪j] distance should not be less than
# min(d[k,i], d[k,j]), enforce this property to workaround floating-point
# arithmetic errors in Lance-Williams formula
@inline clamp_reducible_metric(new_dki, dki, dkj) = max(new_dki, min(dki, dkj))

"""
#===
MinimalDistance <: ReducibleMetric
Distance between the clusters is the minimal distance between any pair of their
points.
"""
===#
struct MinimalDistance{T} <: ReducibleMetric{T}
MinimalDistance(d::AbstractMatrix{T}) where T<:Real = new{T}()
end
Expand All @@ -261,13 +261,13 @@ end
) where T =
(d[k, i] > d_kj) && (d[k, i] = d_kj)

"""
#===
WardDistance <: ReducibleMetric
Ward distance between the two clusters `A` and `B` is the amount by
which merging the two clusters into a single larger cluster `A∪B` would increase
the average squared distance of a point to its cluster centroid.
"""
===#
struct WardDistance{T} <: ReducibleMetric{T}
WardDistance(d::AbstractMatrix{T}) where T<:Real = new{typeof(one(T)/2)}()
end
Expand All @@ -283,11 +283,11 @@ end
d_ki, d_kj)
end

"""
#===
AverageDistance <: ReducibleMetric
Average distance between a pair of points from each clusters.
"""
===#
struct AverageDistance{T} <: ReducibleMetric{T}
AverageDistance(d::AbstractMatrix{T}) where T<:Real = new{typeof(one(T)/2)}()
end
Expand All @@ -303,11 +303,11 @@ end
d[k, i] = clamp_reducible_metric((ni * d_ki + nj * d_kj) / nij, d_ki, d_kj)
end

"""
#===
MaximumDistance <: ReducibleMetric
Maximum distance between a pair of points from each clusters.
"""
===#
struct MaximumDistance{T} <: ReducibleMetric{T}
MaximumDistance(d::AbstractMatrix{T}) where T<:Real = new{T}()
end
Expand Down

0 comments on commit b920079

Please sign in to comment.