Permalink
Browse files

companion object for ContinuousFeature

  • Loading branch information...
1 parent 710de71 commit a04557c73782c39c7136328406921de52b16d451 @wfaler committed Apr 25, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/main/scala/org/scahal/classifier/Model.scala
@@ -1,5 +1,6 @@
package org.scahal.classifier
+import org.scahal.math._
/**
* Created by IntelliJ IDEA.
* User: wfaler
@@ -24,6 +25,13 @@ case object ZeroFeature extends Feature{
case class CategoricalFeature[T](name: String, category: T) extends Feature
+object ContinuousFeature{
+ def apply(name: String, value: Double): ContinuousFeature = ContinuousFeature(name, dec(value))
+ def apply(name: String, value: Int): ContinuousFeature = ContinuousFeature(name, dec(value))
+ def apply(name: String, value: Long): ContinuousFeature = ContinuousFeature(name, dec(value))
+ def apply(name: String, value: Float): ContinuousFeature = ContinuousFeature(name, dec(value))
+}
+
case class ContinuousFeature(name: String, value: BigDecimal) extends Feature
object BagOfWordsFeature{

0 comments on commit a04557c

Please sign in to comment.