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

@@ -3,7 +3,7 @@
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<# var toPredictType = Definition[ToPredict]; #>
using System;
using System.Text;
using Microsoft.ML.Data;
@@ -50,4 +50,33 @@ namespace DictionaryToObjectConverterNamespace
return null;
}
}
public class <#= ClassName #>Prediction: testML.IDictionaryToObjectConverter
{
[ColumnName("PredictedLabel")]
public <#= toPredictType.FullName #> <#= ToPredict #> { 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 "<#= ToPredict #>": <#= ToPredict #> = (<#= toPredictType.FullName #>)value; break;
}
}
public object GetValue(string propertyName)
{
switch(propertyName)
{
case "<#= ToPredict #>": return <#= ToPredict #>;
}
return null;
}
}
}