anchor.diff:                  yield words }
   
                   
  -let lable,data =
  +let lables,data =
       fromFileWithSep ',' (__SOURCE_DIRECTORY__ + "/data/irisData.csv")
       |> Seq.skip 1
       |> Seq.map (fun arr -> arr.[4], [| float arr.[0]; float arr.[1]; float arr.[2]; float arr.[3]; |])
       |> Seq.toArray
  +    |> fun x -> Array.init 3 (fun _ -> x) |> Array.concat
       |> Array.shuffleFisherYates
  +    |> Array.mapi (fun i (lable,data) -> sprintf "%s_%i" lable i, data)
       |> Array.unzip
      
   (*** hide ***)
  
positive.code: (**
  ##Hierarchical clustering
  
  
  
  *)
  
  //let htmp = HierarchicalClustering.generate' DistanceMetrics.euclidean Linker.wardLwLinker data
  // slower
  
  let htmp = 
      HierarchicalClustering.generate DistanceMetrics.euclidean Linker.wardLwLinker data
      |> HierarchicalClustering.flattenHClust
  
  let hlable =    
      htmp
      |> Seq.map (fun c -> lable.[HierarchicalClustering.getClusterId c])
  
  let hdata =    
      htmp
      |> Seq.choose (fun c -> HierarchicalClustering.tryGetLeafValue c)
  
  
  let hierClusteredData = 
      let labels = hlable |> Seq.mapi (fun i s -> sprintf "%s%i" s i)
      Chart.Heatmap(hdata,ColNames=colnames,RowNames=labels,Colorscale=colorscaleValue,Showscale=true)
      |> Chart.withMarginSize(Left=250.)
      |> Chart.withTitle "clustered iris data (hierarchical Clustering)"
  (*** include-value:hierClusteredData ***)
  
  
  
  (**
  
  
negative.code: (**
  #Clustering
  
  
  For demonstration of several clustering methods, the classic iris data set is used, which consists of 150 records, each of which contains four measurements and a species identifier.
  Since the species identifier occur several times (_Iris-irginica_, _Iris-versicolor_, and _Iris-setosa_), the first step is to generate unique labels:
  
    - The data is shuffled and an index is appended to the data label, such that each label is unique.
  *)
  
  open FSharp.Stats
  