Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language tags to code samples #27

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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