anchor.diff:      <| data <| 4
   
   let clusteredIrisData =
  -    Array.zip lable data
  +    Array.zip lables data
       |> Array.sortBy (fun (l,dataPoint) -> fst (kmeansResult.Classifier dataPoint)) 
       |> Array.unzip
  -    |> fun (l,d) -> 
  -        let labels = l |> Seq.mapi (fun i x -> x + string i)
  +    |> fun (labels,d) -> 
           Chart.Heatmap(d,ColNames=colnames,RowNames=labels,Colorscale=colorscaleValue,Showscale=true)
           |> Chart.withMarginSize(Left=250.)
           |> Chart.withTitle "clustered iris data (k-means clustering)"
  
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
  