// save item features
for (Map.Entry<String, VectorWritable> feature : inpItemsFeatures.entrySet()) {
peer.write(new Text(OnlineCF.Settings.DFLT_MODEL_ITEM_FEATURES_DELIM+feature.getKey()), feature.getValue());
}
// item feature factorized values should be normalized
DoubleMatrix res = normalizeMatrix(peer, itemFeatureMatrix,
OnlineCF.Settings.MSG_ITEM_FEATURE_MATRIX, false);
if (res != null) {
Text key = new Text(OnlineCF.Settings.DFLT_MODEL_ITEM_MTX_FEATURES_DELIM +
OnlineCF.Settings.MSG_ITEM_FEATURE_MATRIX.toString());
peer.write(key, convertMatrixToVector(res));
}
}
if (userFeatureMatrix != null) {
// save user features
// save item features
for (Map.Entry<String, VectorWritable> feature : inpUsersFeatures.entrySet()) {
peer.write(new Text(OnlineCF.Settings.DFLT_MODEL_USER_FEATURES_DELIM+feature.getKey()), feature.getValue());
}
// user feature factorized values should be normalized
DoubleMatrix res = normalizeMatrix(peer, userFeatureMatrix,
OnlineCF.Settings.MSG_USER_FEATURE_MATRIX, false);
if (res != null) {
Text key = new Text(OnlineCF.Settings.DFLT_MODEL_USER_MTX_FEATURES_DELIM +
OnlineCF.Settings.MSG_USER_FEATURE_MATRIX.toString());