Skip to content

Commit

Permalink
fix dimensions in TopNOneHotEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Apr 10, 2018
1 parent 87a82cd commit cad761a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ private class TopNOneHotEncoder(name: String,
b.result()
}

override def featureDimension(c: SortedMap[String, Int]): Int = c.size
override def featureDimension(c: SortedMap[String, Int]): Int =
if (encodeMissingValue) c.size + 1 else c.size

override def featureNames(c: SortedMap[String, Int]): Seq[String] = {
val names = c.map(name + '_' + _._1)(scala.collection.breakOut)
Expand Down

0 comments on commit cad761a

Please sign in to comment.