public Assignment outcomeToAssignment ( List < String > factorVariables , List < ? extends Object > outcome ) { assert factorVariables . size ( ) == outcome . size ( ) ; int [ ] varNums = new int [ factorVariables . size ( ) ] ; Object [ ] values = new Object [ factorVariables . size ( ) ] ; for ( int i = 0 ; i < factorVariables . size ( ) ; i ++ ) { int varInd = getVariables ( ) . getVariableByName ( factorVariables . get ( i ) ) ; varNums [ i ] = varInd ; values [ i ] = outcome . get ( i ) ; } return Assignment . fromUnsortedArrays ( varNums , values ) ; }
Gets an assignment for the named set of variables .