Ya hace predicciones y crea el ZIP
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user