Exemple #1
0
 ///
 public override void SaveModel(string file)
 {
     using (StreamWriter writer = Recommender.GetWriter(file, this.GetType()))
     {
         IMatrixUtils.WriteMatrix(writer, user_factors);
         IMatrixUtils.WriteMatrix(writer, item_factors);
     }
 }
Exemple #2
0
 ///
 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);
     }
 }
Exemple #3
0
 ///
 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);
     }
 }
Exemple #4
0
 ///
 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);
     }
 }
Exemple #5
0
 ///
 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]);
         }
     }
 }
Exemple #6
0
 ///
 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));
         }
     }
 }
Exemple #7
0
        ///
        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);
            }
        }
Exemple #8
0
 ///
 public override void SaveModel(string filename)
 {
     using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType()))
         IMatrixUtils.WriteMatrix(writer, item_attribute_weight_by_user);
 }
Exemple #9
0
 ///
 public override void SaveModel(string filename)
 {
     // TODO extend
     using (StreamWriter writer = Recommender.GetWriter(filename, this.GetType()))
         correlation.Write(writer);
 }