Instance Constructors
-
new
CategoricalDomain(values: Iterable[C])
-
new
CategoricalDomain()
Type Members
-
-
type
CategoryType = C
-
-
class
Elements extends AbstractIterator[A] with BufferedIterator[A] with Serializable
-
-
-
class
WithFilter extends FilterMonadic[A, Repr]
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
++[B >: variable.CategoricalValue[C], That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
++:[B >: variable.CategoricalValue[C], That](that: Traversable[B])(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
++:[B >: variable.CategoricalValue[C], That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
-
-
def
+=(x: C): Unit
-
-
-
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
_append(elem: Int): CategoricalDomain.this.type
-
def
_appendAll(elts: TraversableOnce[Int]): Unit
-
def
_appendAll(elts: Array[Int]): Unit
-
final
def
_apply(index: Int): Int
-
def
_array: Array[Int]
-
final
def
_asArray: Array[Int]
-
def
_asIntSeq: IntSeq
-
def
_asSeq: IndexedSeq[Int]
-
def
_capacityGrowthFactor: Double
-
def
_clear(): Unit
-
def
_considerShrinkingCapacity(): Unit
-
def
_containsSorted(x: Int): Boolean
-
def
_copyToArray(a: Array[Int]): Unit
-
-
def
_elements: ArrayBuffer[Value]
-
final
def
_ensureCapacity(cap: Int): Unit
-
def
_fill(elt: Int): Unit
-
def
_foreach[U](f: (Int) ⇒ U): Unit
-
var
_frozen: Boolean
-
final
def
_increment(index: Int, incr: Int): Unit
-
def
_indexForInsertSorted(i: Int): Int
-
def
_indexForInsertSortedLinear(i: Int): Int
-
def
_indexOf(i: Int): Int
-
def
_indexOfSorted(i: Int): Int
-
def
_indices: Map[C, Value]
-
def
_initialCapacity: Int
-
def
_insert(index: Int, elt: Int): Unit
-
def
_insertAll(index: Int, seq: Traversable[Int]): Unit
-
def
_insertAllSorted(seq: Traversable[Int]): Unit
-
def
_insertSorted(elt: Int): Unit
-
def
_insertSortedNoDuplicates(elt: Int): Unit
-
final
def
_length: Int
-
def
_mapToArray[A](a: Array[A], f: (Int) ⇒ A): Unit
-
def
_prepend(elt: Int): Unit
-
def
_prependAll(elts: TraversableOnce[Int]): Unit
-
def
_reduceToSize(newSize: Int): Unit
-
def
_remove(index: Int): Unit
-
def
_remove(index: Int, count: Int): Unit
-
def
_set(elts: Seq[Int]): Unit
-
def
_set(elts: Array[Int]): Unit
-
final
def
_setCapacity(cap: Int): Unit
-
def
_sizeHint(len: Int): Unit
-
def
_sum: Int
-
def
_takeAsIntSeq(len: Int): IntSeq
-
def
_toArray: Array[Int]
-
def
_toSeq: IndexedSeq[Int]
-
def
_trimCapacity(): Unit
-
final
def
_update(index: Int, value: Int): Unit
-
-
-
def
addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
-
def
aggregate[B](z: B)(seqop: (B, variable.CategoricalValue[C]) ⇒ B, combop: (B, B) ⇒ B): B
-
def
andThen[C](k: (variable.CategoricalValue[C]) ⇒ C): PartialFunction[Int, C]
-
def
apply(i: Int): Value
-
def
applyOrElse[A1 <: Int, B1 >: variable.CategoricalValue[C]](x: A1, default: (A1) ⇒ B1): B1
-
final
def
asInstanceOf[T0]: T0
-
def
canEqual(that: Any): Boolean
-
def
categories: Seq[C]
-
def
category(i: Int): C
-
def
clear(): Unit
-
def
clone(): AnyRef
-
def
collect[B, That](pf: PartialFunction[variable.CategoricalValue[C], B])(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
collectFirst[B](pf: PartialFunction[variable.CategoricalValue[C], B]): Option[B]
-
def
combinations(n: Int): Iterator[IndexedSeq[variable.CategoricalValue[C]]]
-
def
companion: GenericCompanion[IndexedSeq]
-
-
def
contains(elem: Any): Boolean
-
def
containsSlice[B](that: GenSeq[B]): Boolean
-
def
copyToArray[B >: variable.CategoricalValue[C]](xs: Array[B], start: Int, len: Int): Unit
-
-
def
copyToArray[B >: variable.CategoricalValue[C]](xs: Array[B], start: Int): Unit
-
-
def
corresponds[B](that: GenSeq[B])(p: (variable.CategoricalValue[C], B) ⇒ Boolean): Boolean
-
def
count(category: C): Int
-
def
count(i: Int): Int
-
-
-
def
countsTotal: Int
-
-
-
def
dimensionName(i: Int): String
-
def
dimensionSize: Int
-
-
-
-
-
def
endsWith[B](that: GenSeq[B]): Boolean
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(that: Any): Boolean
-
-
-
-
def
finalize(): Unit
-
-
def
flatMap[B, That](f: (variable.CategoricalValue[C]) ⇒ GenTraversableOnce[B])(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
flatten[B](implicit asTraversable: (variable.CategoricalValue[C]) ⇒ GenTraversableOnce[B]): IndexedSeq[B]
-
-
-
-
-
-
def
freeze(): Unit
-
def
frozen: Boolean
-
var
gatherCounts: Boolean
-
def
genericBuilder[B]: Builder[B, IndexedSeq[B]]
-
def
getAll(c: Set[Int]): Set[Value]
-
def
getAll(c: Array[Int]): ArraySeq[Value]
-
def
getAll(c: List[Int]): List[Value]
-
def
getAll(c: Iterator[Int]): Iterator[Value]
-
final
def
getClass(): Class[_]
-
def
getIndex(category: C): Int
-
-
-
var
growPastMaxSize: Boolean
-
def
hasDefiniteSize: Boolean
-
def
hashCode(): Int
-
-
-
def
incrementCount(category: C): Unit
-
def
incrementCount(i: Int): Unit
-
def
index(category: C): Int
-
def
indexAll(c: Set[C]): Set[Int]
-
def
indexAll(c: Array[C]): Array[Int]
-
def
indexAll(c: List[C]): List[Int]
-
def
indexAll(c: Iterator[C]): Iterator[Int]
-
-
-
def
indexOfSlice[B >: variable.CategoricalValue[C]](that: GenSeq[B], from: Int): Int
-
-
def
indexOnly(category: C): Int
-
-
-
def
indices: Range
-
-
-
-
def
isDefinedAt(idx: Int): Boolean
-
def
isEmpty: Boolean
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
isTraversableAgain: Boolean
-
-
-
-
-
def
lastIndexOfSlice[B >: variable.CategoricalValue[C]](that: GenSeq[B], end: Int): Int
-
def
lastIndexOfSlice[B >: variable.CategoricalValue[C]](that: GenSeq[B]): Int
-
def
lastIndexWhere(p: (variable.CategoricalValue[C]) ⇒ Boolean, end: Int): Int
-
-
-
final
def
length: Int
-
def
lengthCompare(len: Int): Int
-
-
-
-
-
var
maxRequestedInt: Int
-
var
maxSize: Int
-
-
-
def
mkString: String
-
def
mkString(sep: String): String
-
def
mkString(start: String, sep: String, end: String): String
-
final
def
ne(arg0: AnyRef): Boolean
-
-
def
newCategoricalValue(i: Int, e: C): CategoricalValue
-
def
nonEmpty: Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
orElse[A1 <: Int, B1 >: variable.CategoricalValue[C]](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
-
def
padTo[B >: variable.CategoricalValue[C], That](len: Int, elem: B)(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
-
-
-
def
patch[B >: variable.CategoricalValue[C], That](from: Int, patch: GenSeq[B], replaced: Int)(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
-
-
-
-
-
-
def
reduceOption[A1 >: variable.CategoricalValue[C]](op: (A1, A1) ⇒ A1): Option[A1]
-
-
-
-
-
-
-
-
-
def
sameElements[B >: variable.CategoricalValue[C]](that: GenIterable[B]): Boolean
-
def
scan[B >: variable.CategoricalValue[C], That](z: B)(op: (B, B) ⇒ B)(implicit cbf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
scanLeft[B, That](z: B)(op: (B, variable.CategoricalValue[C]) ⇒ B)(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
scanRight[B, That](z: B)(op: (variable.CategoricalValue[C], B) ⇒ B)(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
segmentLength(p: (variable.CategoricalValue[C]) ⇒ Boolean, from: Int): Int
-
-
def
size: Int
-
def
sizeAtCount(c: Int): Int
-
def
sizeAtOrAboveCount(threshold: Int): Int
-
def
sizeBelowCount(threshold: Int): Int
-
-
def
sliding(size: Int, step: Int): Iterator[IndexedSeq[variable.CategoricalValue[C]]]
-
-
-
-
-
-
-
def
startsWith[B](that: GenSeq[B], offset: Int): Boolean
-
def
startsWith[B](that: GenSeq[B]): Boolean
-
def
stringPrefix: String
-
def
stringToCategory(s: String): C
-
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
-
-
-
-
-
-
-
def
toArray[B >: variable.CategoricalValue[C]](implicit arg0: ClassTag[B]): Array[B]
-
-
-
-
-
-
-
def
toMap[T, U](implicit ev: <:<[variable.CategoricalValue[C], (T, U)]): Map[T, U]
-
-
-
-
def
toString(): String
-
-
-
def
transpose[B](implicit asTraversable: (variable.CategoricalValue[C]) ⇒ GenTraversableOnce[B]): IndexedSeq[IndexedSeq[B]]
-
def
trimBelowCount(threshold: Int): Int
-
def
trimBelowSize(target: Int): Int
-
def
unapply(value: Value): Option[Int]
-
def
unfreeze(): Unit
-
-
def
unzip[A1, A2](implicit asPair: (variable.CategoricalValue[C]) ⇒ (A1, A2)): (IndexedSeq[A1], IndexedSeq[A2])
-
def
unzip3[A1, A2, A3](implicit asTriple: (variable.CategoricalValue[C]) ⇒ (A1, A2, A3)): (IndexedSeq[A1], IndexedSeq[A2], IndexedSeq[A3])
-
def
updated[B >: variable.CategoricalValue[C], That](index: Int, elem: B)(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], B, That]): That
-
def
value(category: C): Value
-
-
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
-
def
zip[A1 >: variable.CategoricalValue[C], B, That](that: GenIterable[B])(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], (A1, B), That]): That
-
def
zipAll[B, A1 >: variable.CategoricalValue[C], That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[IndexedSeq[variable.CategoricalValue[C]], (A1, B), That]): That
-
Inherited from Equals
Inherited from Any
A domain for categorical variables. It stores not only a size, but also the mapping from category values (of type T = this.CategoryType) to densely packed integers suitable for indices into parameter vectors. For example, a common use case is mapping words (from NLP or document classification) into indices, and back.
Furthermore if domain.gatherCounts = true, this domain will count the number of calls to 'index'. Then you can reduce the size of the Domain by calling 'trimBelowCount' or 'trimBelowSize', which will recreate the new mapping from categories to densely-packed non-negative integers (making the old mapping no longer valid). Thus, in typical usage you would (1) read in the data, (2) trim the domain, (3) re-read the data with the new mapping, creating variables.