/// public override void SaveModel(string file) { using (StreamWriter writer = Recommender.GetWriter(file, this.GetType())) { IMatrixUtils.WriteMatrix(writer, user_factors); IMatrixUtils.WriteMatrix(writer, item_factors); } }
/// public override void SaveModel(string filename) { using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType())) { writer.WriteLine(global_average.ToString(CultureInfo.InvariantCulture)); VectorUtils.WriteVector(writer, entity_averages); } }
/// public override void SaveModel(string filename) { using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType())) { writer.WriteLine(global_bias.ToString(CultureInfo.InvariantCulture)); IMatrixUtils.WriteMatrix(writer, user_factors); IMatrixUtils.WriteMatrix(writer, item_factors); } }
/// public override void SaveModel(string file) { using (StreamWriter writer = Recommender.GetWriter(file, this.GetType())) { writer.WriteLine(global_average.ToString(CultureInfo.InvariantCulture)); IMatrixUtils.WriteSparseMatrix(writer, diff_matrix); IMatrixUtils.WriteSparseMatrix(writer, freq_matrix); } }
/// public override void SaveModel(string filename) { using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType())) { writer.WriteLine(MaxItemID + 1); for (int i = 0; i <= MaxItemID; i++) { writer.WriteLine(i + " " + view_count[i]); } } }
/// public override void SaveModel(string file) { using (StreamWriter writer = Recommender.GetWriter(file, this.GetType())) { writer.WriteLine(recommenders.Count); for (int i = 0; i < recommenders.Count; i++) { recommenders[i].SaveModel("model-" + i + ".txt"); writer.WriteLine(recommenders[i].GetType() + " " + weights[i].ToString(CultureInfo.InvariantCulture)); } } }
/// public override void SaveModel(string filename) { using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType())) { writer.WriteLine(nearest_neighbors.Length); foreach (int[] nn in nearest_neighbors) { writer.Write(nn[0]); for (int i = 1; i < nn.Length; i++) { writer.Write(" {0}", nn[i]); } writer.WriteLine(); } correlation.Write(writer); } }
/// public override void SaveModel(string filename) { using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType())) IMatrixUtils.WriteMatrix(writer, item_attribute_weight_by_user); }
/// public override void SaveModel(string filename) { // TODO extend using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType())) correlation.Write(writer); }