public override void ExitFeatureSparse(VowpalWabbitParser.FeatureSparseContext context) { var index = context.index.Text; var x = context.x.value; if (index == "const") { this.example.Constant = x; } else { this.example.Features.Add(new KeyValuePair <string, float>(index, x)); } }
public override void ExitFeatureSparse(VowpalWabbitParser.FeatureSparseContext context) { var index = context.index; var weight_index = index.Text; var x = context.x; if (x == null) { // hashed feature this.example.T = weight_index; } else { // sparse feature this.example.F.Add(new KeyValuePair <string, float>(weight_index, context.x.value)); } }