refactor(trainer): use correct schema, though it shouldn't matter
This commit is contained in:
parent
1b8f7806f5
commit
753e0f710e
|
@ -95,6 +95,7 @@ namespace NoSoliciting.Interface {
|
|||
if (this.Category != null && weights.TryGetValue(this.Category, out var weight)) {
|
||||
output.Weight = weight;
|
||||
}
|
||||
|
||||
output.PartyFinder = this.Channel == 0;
|
||||
output.Shout = this.Channel == 11 || this.Channel == 30;
|
||||
output.ContainsWard = this.Message.ContainsIgnoreCase("ward") || WardRegex.IsMatch(this.Message);
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace NoSoliciting.Trainer {
|
|||
ctx.ComponentCatalog.RegisterAssembly(typeof(Data).Assembly);
|
||||
|
||||
var pipeline = ctx.Transforms.Conversion.MapValueToKey("Label", nameof(Data.Category))
|
||||
.Append(ctx.Transforms.CustomMapping((Action<Data, Data.Computed>) compute.Compute, "Compute"))
|
||||
.Append(ctx.Transforms.CustomMapping(compute.GetMapping(), "Compute"))
|
||||
.Append(ctx.Transforms.Text.NormalizeText("MsgNormal", nameof(Data.Message), keepPunctuations: false))
|
||||
.Append(ctx.Transforms.Text.TokenizeIntoWords("MsgTokens", "MsgNormal"))
|
||||
// .Append(ctx.Transforms.Text.RemoveStopWords("MsgNoStop", "MsgTokens",
|
||||
|
@ -95,7 +95,7 @@ namespace NoSoliciting.Trainer {
|
|||
|
||||
var model = pipeline.Fit(train);
|
||||
|
||||
ctx.Model.Save(model, df.Schema, @"../../../model.zip");
|
||||
ctx.Model.Save(model, train.Schema, @"../../../model.zip");
|
||||
|
||||
var testPredictions = model.Transform(ttd.TestSet);
|
||||
var eval = ctx.MulticlassClassification.Evaluate(testPredictions);
|
||||
|
|
Loading…
Reference in New Issue