trait Factor[T] extends AnyRef
Definition of Factor
A factor is associated with a set of variables and specifies a value for every combination of assignments to those variables.
Factors are parameterized by the type of the Variables they contain and contain a semiring that defines the mathematical operation to be performed on the values Parent variables are distinguished from the output variable.
Refactored by
 Alphabetic
 By Inheritance
 Factor
 AnyRef
 Any
 Hide All
 Show All
 Public
 All
Abstract Value Members

abstract
def
combination(that: Factor[T], op: (T, T) ⇒ T): Factor[T]
Combination function for factors.
Combination function for factors. By default, this is product, but other operations (such as divide that is a valid operation for some semirings) can use this

abstract
def
contentsContains(index: List[Int]): Boolean
Test whether a factor contains a value for a specific index

abstract
def
createFactor[T](parents: List[Variable[_]], output: List[Variable[_]], _semiring: Semiring[T] = semiring): Factor[T]
Creates a new factor of the same type

abstract
def
deDuplicate(): Factor[T]
Returns a new Factor with duplicate variable(s) removed

abstract
def
fillByRule(rule: (List[Extended[_]]) ⇒ T): Factor[T]
Fill the contents of this factor by applying a rule to every combination of values.

abstract
def
get(indices: List[Int]): T
Get the value associated with a row.
Get the value associated with a row. The row is identified by an list of indices into the ranges of the variables over which the factor is defined.

abstract
def
getContents(): Traversable[T]
Get the contents of a factor as a traversable (note: no indicies provided)

abstract
def
mapTo[U](fn: (T) ⇒ U, _semiring: Semiring[U] = semiring): Factor[U]
Fill the contents of the target by applying the given function to all elements of this factor.

abstract
def
marginalizeToWithSum(sum: (T, T) ⇒ T, targets: Variable[_]*): Factor[T]
Returns the marginalization of the factor to a variable according to the given addition function.
Returns the marginalization of the factor to a variable according to the given addition function. Unlike marginalizeTo, this uses the provided sum function. This is useful e.g. to easily switch between maxproduct and sumproduct operations when the data within are unchanged and the product operation is the same.
The returned factor uses the semiring associated with this factor; it does not override the sum function of the semiring with the function given here.
 abstract def output: List[Variable[_]]
 abstract def parents: List[Variable[_]]

abstract
def
product(that: Factor[T]): Factor[T]
Returns the product of this factor with another factor according to a given multiplication function.
Returns the product of this factor with another factor according to a given multiplication function. The product is associated with all variables in the two inputs, and the value associated with an assignment is the product of the values in the two inputs.

abstract
def
recordArgMax[U](variable: Variable[U], comparator: (T, T) ⇒ Boolean, _semiring: Semiring[U] = semiring.asInstanceOf[Semiring[U]]): Factor[U]
Returns a factor that maps values of the other variables to the value of the given variable that maximizes the entry associated with that value, according to some maximization function.
Returns a factor that maps values of the other variables to the value of the given variable that maximizes the entry associated with that value, according to some maximization function. comparator defines the maximization. It returns true iff its second argument is greater than its first.
 U
The type of element whose value is being recorded. The resulting factor maps values of other variables in this factor to this type.
 abstract def semiring: Semiring[T]

abstract
def
set(indices: List[Int], value: T): Factor[T]
Set the value associated with a row.
Set the value associated with a row. The row is identified by an list of indices into the ranges of the variables over which the factor is defined.

abstract
def
stringContents(): String
Return the contents of a factor as a string

abstract
def
sumOver(variable: Variable[_], sum: (T, T) ⇒ T = semiring.sum): Factor[T]
Returns the summation of the factor over a variable according to an addition function.
Returns the summation of the factor over a variable according to an addition function. The result is associated with all the variables in the input except for the summed over variable and the value for a set of assignments is the sum of the values of the corresponding assignments in the input.
If no funciton is provided, this defaults to the sum function in this factor's semiring.

abstract
def
toReadableString: String
Produce a readable string representation of the factor
Concrete Value Members

final
def
!=(arg0: Any): Boolean
 Definition Classes
 AnyRef → Any

final
def
##(): Int
 Definition Classes
 AnyRef → Any

final
def
==(arg0: Any): Boolean
 Definition Classes
 AnyRef → Any

final
def
asInstanceOf[T0]: T0
 Definition Classes
 Any

def
clone(): AnyRef
 Attributes
 protected[java.lang]
 Definition Classes
 AnyRef
 Annotations
 @throws( ... )
 def contains(index: List[Int]): Boolean
 def convertIndicesToValues(indices: List[Int]): List[Extended[_]]

final
def
eq(arg0: AnyRef): Boolean
 Definition Classes
 AnyRef

def
equals(arg0: Any): Boolean
 Definition Classes
 AnyRef → Any

def
finalize(): Unit
 Attributes
 protected[java.lang]
 Definition Classes
 AnyRef
 Annotations
 @throws( classOf[java.lang.Throwable] )

def
foldLeft(initial: T, fn: (T, T) ⇒ T): T
Fold the given function through the contents of the factor, beginning with the given initial values
 def generateIndices: Indices

final
def
getClass(): Class[_]
 Definition Classes
 AnyRef → Any
 def getIndices: Indices

def
hasStar: Boolean
Indicates if any of this Factor's variables has Star

def
hashCode(): Int
 Definition Classes
 AnyRef → Any

val
isConstraint: Boolean
Indicates if this Factor is condition/constrained

def
isEmpty: Boolean
Indicates if this Factor has any variables

final
def
isInstanceOf[T0]: Boolean
 Definition Classes
 Any

def
marginalizeTo(targets: Variable[_]*): Factor[T]
Returns the marginalization of the factor to a variable according to the addition function in this factor's semiring.
Returns the marginalization of the factor to a variable according to the addition function in this factor's semiring. This involves summing out all other variables.

final
def
ne(arg0: AnyRef): Boolean
 Definition Classes
 AnyRef

final
def
notify(): Unit
 Definition Classes
 AnyRef

final
def
notifyAll(): Unit
 Definition Classes
 AnyRef
 lazy val numVars: Int
 val size: Int

final
def
synchronized[T0](arg0: ⇒ T0): T0
 Definition Classes
 AnyRef

def
toString(): String
Description that includes the variable list and conditional probabilities
Description that includes the variable list and conditional probabilities
 Definition Classes
 Factor → AnyRef → Any
 def variables: List[Variable[_]]

final
def
wait(): Unit
 Definition Classes
 AnyRef
 Annotations
 @throws( ... )

final
def
wait(arg0: Long, arg1: Int): Unit
 Definition Classes
 AnyRef
 Annotations
 @throws( ... )

final
def
wait(arg0: Long): Unit
 Definition Classes
 AnyRef
 Annotations
 @throws( ... )