fslaborg / fslaborg.github.io

The fslab website
https://fslab.org
MIT License
11 stars 15 forks source link

Compilation error in k-Means clustering tutorial #26

Closed inputusernamehere closed 3 years ago

inputusernamehere commented 3 years ago

The tutorial in question: https://fslab.org/content/tutorials/002_clustering_kMeans.html

After downloading the notebook and running it locally, I get a compilation error in this code snippet:

clusteredIrisData
|> Seq.take 10
|> Seq.map (fun (a,b,c) -> sprintf "%i, %A, %A" a b c)
|> String.concat "\n"
|> String.concat "<br>"
|> fun x -> x + "<br> ... "

Error: input.fsx (5,4)-(5,24) typecheck error The type 'string' is not compatible with the type 'seq<string>'.

I suspect the two String.concats in a row are to blame.

bvenn commented 3 years ago

You're right, it should be:

clusteredIrisData
|> Seq.take 10
|> Seq.map (fun (a,b,c) -> sprintf "%i, %A, %A" a b c)
|> String.concat "\n"
|> fun x -> x + "\n... "

It'll be fixed in a moment