anchor.diff:      |> Seq.map (fun t -> float t.Relevance)
       |> Seq.toArray
   
  -let target = MultipleLinearRegression(3, true)
  +let target = MultipleLinearRegression(6, true)
   let sumOfSquaredErrors = target.Regress(trainInput, trainOutput)
   let observationCount = trainInput |> Seq.length |> float
   let sme = sumOfSquaredErrors / observationCount
  
positive.code:     |> Map.ofSeq
  let inline productDescription uid = productDescMap |> Map.find uid
  
  let stem word =
      let stemmer = EnglishStemmer() // NOTE stemmer not thread-safe
      let stemmed = stemmer.Stem word
      if stemmed.Length < word.Length then stemmed // HACK workaround stemmer output like "vanity" -> "vaniti"
      else word
  
  let stemmedWordMatch (words:string) (title:string) (desc:string) =
      let isMatch input word =
          let word' = stem word |> Regex.Escape // TODO strip punctuation?
          Regex.IsMatch(input, sprintf @"\b%s" word', RegexOptions.IgnoreCase)
      let uniqueWords = words.Split([|' '|], StringSplitOptions.RemoveEmptyEntries) |> Array.distinct
      let numberInTitle = uniqueWords |> Array.filter (isMatch title) |> Array.length
      let numberInDescription = uniqueWords |> Array.filter (isMatch desc) |> Array.length
      numberInTitle, numberInDescription, uniqueWords.Length 
  
  let stringContainsMatch (words:string) (title:string) (desc:string) =
      let words' = words.Split(' ')
      let uniqueWords = words' |> Array.distinct
      let numberInTitle = uniqueWords |> Array.filter (fun w -> title.ToLower().Contains(w.ToLower())) |> Array.length
      let numberInDescription = uniqueWords |> Array.filter (fun w -> desc.ToLower().Contains(w.ToLower())) |> Array.length
      numberInTitle, numberInDescription, uniqueWords.Length 
  
  let inline toFloatArray (a,b,c) = [| float a; float b; float c |]
  
  let trainInput = 
      train.Rows
      |> Seq.map (fun w -> stemmedWordMatch w.Search_term w.Product_title (productDescription w.Product_uid) |> toFloatArray)
      |> Seq.toArray
  
  let trainOutput = 
  
negative.code: open Accord.Statistics.Models.Regression.Linear
  open Iveonik.Stemmers
  
  type Train = CsvProvider<"../data/train.csv">
  let train = Train.GetSample()
  
  type Test = CsvProvider<"../data/test.csv">
  let test = Test.GetSample()
  
  type Products = CsvProvider<"../data/product_descriptions.csv">
  let products = Products.GetSample()
  
  type Attributes = CsvProvider<"../data/attributes.csv">
  let attributes = Attributes.GetSample()
  
  let productDescMap =
      products.Rows
  