1
0

Ya hace predicciones y crea el ZIP

This commit is contained in:
2023-01-18 14:20:53 +01:00
parent fe96cd41a4
commit 7f68e262f4
4 changed files with 281 additions and 117 deletions

View File

@@ -28,8 +28,14 @@ namespace testML
/// </summary>
public virtual string TransformText()
{
this.Write("\r\nusing System;\r\nusing System.Text;\r\nusing Microsoft.ML.Data;\r\n\r\nnamespace Dictio" +
"naryToObjectConverterNamespace\r\n{\r\n\tpublic class ");
#line 6 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
var toPredictType = Definition[ToPredict];
#line default
#line hidden
this.Write("using System;\r\nusing System.Text;\r\nusing Microsoft.ML.Data;\r\n\r\nnamespace Dictiona" +
"ryToObjectConverterNamespace\r\n{\r\n\tpublic class ");
#line 13 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ClassName));
@@ -141,7 +147,77 @@ namespace testML
#line default
#line hidden
this.Write("\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n}");
this.Write("\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic class ");
#line 54 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ClassName));
#line default
#line hidden
this.Write("Prediction: testML.IDictionaryToObjectConverter\r\n\t{\r\n\t\t[ColumnName(\"PredictedLabe" +
"l\")]\t\r\n\t\tpublic ");
#line 57 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(toPredictType.FullName));
#line default
#line hidden
this.Write(" ");
#line 57 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ToPredict));
#line default
#line hidden
this.Write(@" { get; set; }
public object this[string propertyName]
{
get { return GetValue(propertyName); }
set { SetValue(propertyName, value); }
}
public void SetValue(string propertyName, object value)
{
switch(propertyName)
{
case """);
#line 69 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ToPredict));
#line default
#line hidden
this.Write("\":\t");
#line 69 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ToPredict));
#line default
#line hidden
this.Write(" = (");
#line 69 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(toPredictType.FullName));
#line default
#line hidden
this.Write(")value;\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tpublic object GetValue(string propertyName)\r\n\t\t{\r\n" +
"\t\t\tswitch(propertyName)\r\n\t\t\t{\r\n\t\t\t\tcase \"");
#line 77 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ToPredict));
#line default
#line hidden
this.Write("\":\treturn ");
#line 77 "C:\Users\miguel.maldonado\Documents\Subversion\TestML\testML\DictionaryToObjectConverterClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(ToPredict));
#line default
#line hidden
this.Write(";\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n}");
return this.GenerationEnvironment.ToString();
}
}