private List<Set<Integer>> getUserItemsSet(SequentialAccessSparseMatrix sparseMatrix) { List<Set<Integer>> userItemsSet = new ArrayList<>(); for (int userIdx = 0; userIdx < numUsers; ++userIdx) { int[] itemIndexes = sparseMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); userItemsSet.add(new HashSet(itemList)); } return userItemsSet; } }
private List<Set<Integer>> getUserPoisSet(SequentialAccessSparseMatrix sparseMatrix) { List<Set<Integer>> userPoisSet = new ArrayList<>(); for (int userIdx = 0; userIdx < numUsers; ++userIdx) { int[] itemIndexes = sparseMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); userPoisSet.add(new HashSet(itemList)); } return userPoisSet; } }
private List<Set<Integer>> getUserItemsSet(SequentialAccessSparseMatrix sparseMatrix) { List<Set<Integer>> userItemsSet = new ArrayList<>(); for (int userIdx = 0; userIdx < numUsers; ++userIdx) { int[] itemIndexes = sparseMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); userItemsSet.add(new HashSet(itemList)); } return userItemsSet; }
private List<Set<Integer>> getUserItemsSet(SequentialAccessSparseMatrix sparseMatrix) { List<Set<Integer>> userItemsSet = new ArrayList<>(); for (int userIdx = 0; userIdx < numUsers; ++userIdx) { int[] itemIndexes = sparseMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); userItemsSet.add(new HashSet(itemList)); } return userItemsSet; } }
private List<List<Integer>> getUserItemsList(SequentialAccessSparseMatrix sparseMatrix) { List<List<Integer>> userItemsList = new ArrayList<>(); for (int userIdx = 0; userIdx < numUsers; ++userIdx) { int[] itemIndexes = trainMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); userItemsList.add(itemList); } return userItemsList; } }
@Override public Set<Integer> load(Integer rowId) throws Exception { int[] itemIndexes = row(rowId).getIndices(); Integer[] inputBoxed = org.apache.commons.lang.ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); return new HashSet(itemList); } });
@Override public List<Integer> load(Integer colId) throws Exception { int[] userIndexes = column(colId).getIndices(); Integer[] inputBoxed = org.apache.commons.lang.ArrayUtils.toObject(userIndexes); List<Integer> userList = Arrays.asList(inputBoxed); return userList; } });
@Override public List<Integer> load(Integer rowId) throws Exception { int[] itemIndexes = row(rowId).getIndices(); Integer[] inputBoxed = org.apache.commons.lang.ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); return itemList; } });
@Override protected void setup() throws LibrecException { super.setup(); pSetSize = conf.getInt("rec.presence.size", 1); aSetSize = conf.getInt("rec.absence.size", 1); regBias = conf.getDouble("rec.bias.regularization", 0.01); itemBiases = new VectorBasedDenseVector(numItems); itemBiases.init(initMean, initStd); userItemsSet = new ArrayList<>(); for (int userIdx = 0; userIdx < numUsers; ++userIdx) { int[] itemIndexes = trainMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> itemList = Arrays.asList(inputBoxed); userItemsSet.add(new HashSet(itemList)); } }
query.append(tblValidWriteIdList.getInvalidWriteIds().length == 0 ? ") " : " OR ctc_writeid IN(" + StringUtils.join(",", Arrays.asList(ArrayUtils.toObject(tblValidWriteIdList.getInvalidWriteIds()))) + ") "); query.append(") "); i++; query.append(validTxnList.getInvalidTransactions().length == 0 ? " " : " AND ctc_txnid NOT IN(" + StringUtils.join(",", Arrays.asList(ArrayUtils.toObject(validTxnList.getInvalidTransactions()))) + ") ");
Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> unsortedItems = Arrays.asList(inputBoxed); int size = unsortedItems.size();
uexp = 0.0d; int[] itemIndexes = trainMatrix.row(userIdx).getIndices(); Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> items = Arrays.asList(inputBoxed); for (int itemIdx : items) {
Integer[] inputBoxed = ArrayUtils.toObject(itemIndexes); List<Integer> allPresenceItems = Arrays.asList(inputBoxed); if (allPresenceItems.size() < pSetSize || allPresenceItems.size() > numItems-aSetSize)
public ResultTable run() { ResultTable resultTable = new ResultTable(_columnList, _filteredDocIds.size()); resultTable.setResultType(ResultTable.ResultType.Selection); for (Pair pair : _columnList) { String column = (String) pair.getFirst(); if (!_mvColumns.contains(column)) { BlockSingleValIterator bvIter = (BlockSingleValIterator) _immutableSegment.getDataSource(column).nextBlock().getBlockValueSet().iterator(); int rowId = 0; for (Integer docId : _filteredDocIds) { bvIter.skipTo(docId); resultTable.add(rowId++, bvIter.nextIntVal()); } } else { BlockMultiValIterator bvIter = (BlockMultiValIterator) _immutableSegment.getDataSource(column).nextBlock().getBlockValueSet().iterator(); int rowId = 0; for (Integer docId : _filteredDocIds) { bvIter.skipTo(docId); int[] dictIds = _mvColumnArrayMap.get(column); int numMVValues = bvIter.nextIntVal(dictIds); dictIds = Arrays.copyOf(dictIds, numMVValues); resultTable.add(rowId++, ArrayUtils.toObject(dictIds)); } } } return transformFromIdToValues(resultTable, _dictionaryMap, _addCountStar); }
private double getMax(double[] values) { return Collections.max(Arrays.asList(ArrayUtils.toObject(values))); } }
public int[] callback(List<Map<String, Object>> params) { int[] affectNums = insertBatchOperate.batchProcess(params); Collections.addAll(records, ArrayUtils.toObject(affectNums)); return affectNums; }
List<Boolean> optional() { final RequiresService annotation = moduleClass.getAnnotation(RequiresService.class); if (annotation != null) { final Boolean[] optional = ArrayUtils.toObject(annotation.optional()); if (optional != null) { return Arrays.asList(optional); } } return Collections.emptyList(); }
public static Map<String, Double> calculate(Id2Outcome id2Outcome) { Map<String, Double> results = new HashMap<String, Double>(); Double[] goldstandard = ArrayUtils.toObject(id2Outcome.getGoldValues()); Double[] prediction = ArrayUtils.toObject(id2Outcome.getPredictions()); results.put(SpearmanCorrelation.class.getSimpleName(), SpearmansRankCorrelation.computeCorrelation(Arrays.asList(goldstandard), Arrays.asList(prediction))); return results; } }
/** * {@inheritDoc} */ @Transactional @Override public void unacknowledgeAlarms(int[] alarmIds, String user) { OnmsCriteria criteria = new OnmsCriteria(OnmsAlarm.class); criteria.add(Restrictions.in("id", Arrays.asList(ArrayUtils.toObject(alarmIds)))); unacknowledgeMatchingAlarms(criteria, user); }