Exemplo n.º 1
0
 private static void write_about_rows(XmlWriter writer, c_samples_set samplesSet)
 {
     writer.WriteStartElement("Rows");
     writer.WriteAttributeString("Count", XmlConvert.ToString(samplesSet.Data_Rows.Count()));
     for (int i = 0; i < samplesSet.Data_Rows.Count; i++)
     {
         writer.WriteStartElement("Row");
         for (int j = 0; j < samplesSet.Count_Vars; j++)
         {
             if (samplesSet.Input_Attribute(j).labels_values.Count() > 0)
             {
                 writer.WriteElementString(samplesSet.Input_Attribute(j).Name,
                                           samplesSet.Data_Rows[i].Input_Attribute_String[j]);
             }
             else
             {
                 writer.WriteElementString(samplesSet.Input_Attribute(j).Name,
                                           XmlConvert.ToString(samplesSet.Data_Rows[i].Input_Attribute_Value[j]));
             }
         }
         writer.WriteElementString(samplesSet.Output_Attributes.Name, samplesSet.Data_Rows[i].Class_Label);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
Exemplo n.º 2
0
        private static void  write_about_table(XmlWriter writer, c_samples_set samplesSet, c_Fuzzy_System Classifier)
        {
            writer.WriteStartElement("Table");
            writer.WriteAttributeString("Name", samplesSet.File_Name.Remove(samplesSet.File_Name.Length - 4, 4));
            if (samplesSet == Classifier.Learn_Samples_set)
            {
                writer.WriteAttributeString("Type", "Training");
            }
            else
            {
                writer.WriteAttributeString("Type", "Testing");
            }
            writer.WriteAttributeString("Output", samplesSet.Output_Attributes.Name);
            writer.WriteStartElement("Attributes");
            writer.WriteAttributeString("Count", XmlConvert.ToString(samplesSet.Count_Vars));
            for (int i = 0; i < samplesSet.Count_Vars; i++)
            {
                write_about_attribute(writer, samplesSet.Input_Attribute(i));
            }
            write_about_attribute(writer, samplesSet.Output_Attributes);
            writer.WriteEndElement();
            write_about_rows(writer, samplesSet);


            writer.WriteEndElement();
        }