Skip to content

Commit

Permalink
Merge pull request #27 from abhro/patch-1
Browse files Browse the repository at this point in the history
Add language tags to code samples
  • Loading branch information
ablaom authored Nov 28, 2024
2 parents 3d8548b + 63a9c1b commit 0be6b1a
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/MLJClusteringInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,17 @@ algorithm that solves the following optimization problem:
```math
\\text{minimize} \\ \\sum_{i=1}^n \\| \\mathbf{x}_i - \\boldsymbol{\\mu}_{z_i} \\|^2 \\ \\text{w.r.t.} \\ (\\boldsymbol{\\mu}, z)
```
Here, ``\\boldsymbol{\\mu}_k`` is the center of the ``k``-th cluster, and
``z_i`` is an index of the cluster for ``i``-th point ``\\mathbf{x}_i``.
# Training data
In MLJ or MLJBase, bind an instance `model` to data with
mach = machine(model, X)
```
mach = machine(model, X)
```
Here:
Expand Down Expand Up @@ -322,7 +324,7 @@ The fields of `report(mach)` are:
# Examples
```
```julia
using MLJ
KMeans = @load KMeans pkg=Clustering
Expand Down Expand Up @@ -359,8 +361,9 @@ point and the closest *medoid* is minimal.
# Training data
In MLJ or MLJBase, bind an instance `model` to data with
mach = machine(model, X)
```
mach = machine(model, X)
```
Here:
Expand Down Expand Up @@ -410,7 +413,7 @@ The fields of `report(mach)` are:
# Examples
```
```julia
using MLJ
KMedoids = @load KMedoids pkg=Clustering
Expand Down Expand Up @@ -453,8 +456,9 @@ there is no training data. For clusterers that do generalize, see [`KMeans`](@re
[`KMedoids`](@ref).
In MLJ or MLJBase, create a machine with
mach = machine(model)
```
mach = machine(model)
```
# Hyper-parameters
Expand Down Expand Up @@ -500,7 +504,7 @@ After calling `predict(mach)`, the fields of `report(mach)` are:
# Examples
```
```julia
using MLJ
X, labels = make_moons(400, noise=0.09, rng=1) # synthetic data with 2 clusters; X
Expand Down Expand Up @@ -556,9 +560,9 @@ there is no training data. For clusterers that do generalize, see [`KMeans`](@re
[`KMedoids`](@ref).
In MLJ or MLJBase, create a machine with
mach = machine(model)
```
mach = machine(model)
```
# Hyper-parameters
- `linkage = :single`: linkage method (:single, :average, :complete, :ward, :ward_presquared)
Expand Down Expand Up @@ -591,7 +595,7 @@ After calling `predict(mach)`, the fields of `report(mach)` are:
# Examples
```
```julia
using MLJ
X, labels = make_moons(400, noise=0.09, rng=1) # synthetic data with 2 clusters; X
Expand Down

0 comments on commit 0be6b1a

Please sign in to comment.