80 references to PfaUtils
Microsoft.ML.Data (80)
Model\Pfa\BoundPfaContext.cs (1)
13
using T =
PfaUtils
.Type;
Prediction\Calibrator.cs (3)
1788
return
PfaUtils
.Call("m.link.logit",
1789
PfaUtils
.Call("+", -Offset,
PfaUtils
.Call("*", -Slope, input)));
Scorers\BinaryClassifierScorer.cs (4)
297
return
PfaUtils
.If(
PfaUtils
.Call(">", scoreToken, _threshold), trueVal,
298
PfaUtils
.If(
PfaUtils
.Call("<=", scoreToken, _threshold), falseVal, nullVal));
Scorers\ClusteringScorer.cs (1)
132
return
PfaUtils
.Call("a.argmax", mapperOutputs[0]);
Scorers\MulticlassClassificationScorer.cs (1)
600
return
PfaUtils
.Call("a.argmax", mapperOutputs[0]);
Transforms\ColumnConcatenatingTransformer.cs (2)
33
using PfaType =
PfaUtils
.Type;
850
result =
PfaUtils
.Call(srcPrimitive[i] ? "a.append" : "a.concat", result, srcTokens[i]);
Transforms\KeyToValue.cs (14)
466
var outType =
PfaUtils
.Type.PfaTypeOrNullForColumnType(TypeOutput);
473
var defaultToken =
PfaUtils
.Type.DefaultTokenOrNull(TypeOutput);
485
string cellName = ctx.DeclareCell("KeyToValueMap",
PfaUtils
.Type.Array(outType), jsonValues);
486
JObject cellRef =
PfaUtils
.Cell(cellName);
492
ctx.Pfa.AddFunc(funcName, new JArray(
PfaUtils
.Param("key",
PfaUtils
.Type.Int)),
493
outType,
PfaUtils
.If(
PfaUtils
.Call("<", "key", 0), defaultToken,
494
PfaUtils
.Index(cellRef, "key")));
495
var funcRef =
PfaUtils
.FuncRef("u." + funcName);
496
return
PfaUtils
.Call("a.map", srcToken, funcRef);
498
return
PfaUtils
.If(
PfaUtils
.Call("<", srcToken, 0), defaultToken,
PfaUtils
.Index(cellRef, srcToken));
Transforms\KeyToVector.cs (20)
674
return
PfaUtils
.Call("cast.fanoutDouble", srcToken, 0, keyCount, false);
676
JToken arrType =
PfaUtils
.Type.Array(
PfaUtils
.Type.Double);
680
return
PfaUtils
.Call("a.flatMap", srcToken,
681
PfaContext.CreateFuncBlock(new JArray() {
PfaUtils
.Param("k",
PfaUtils
.Type.Int) },
682
arrType,
PfaUtils
.Call("cast.fanoutDouble", "k", 0, keyCount, false)));
691
new JArray() {
PfaUtils
.Param("v",
PfaUtils
.Type.Double) },
PfaUtils
.Type.Double,
692
PfaUtils
.Call("+", "v", 1));
695
new JArray(
PfaUtils
.Param("a", arrType),
PfaUtils
.Param("i",
PfaUtils
.Type.Int)),
696
arrType,
PfaUtils
.If(
PfaUtils
.Call(">=", "i", 0),
697
PfaUtils
.Index("a", "i").AddReturn("to", toFunc), "a"));
700
return
PfaUtils
.Call("a.fold", srcToken,
701
PfaUtils
.Call("cast.fanoutDouble", -1, 0, keyCount, false),
PfaUtils
.FuncRef("u." + funcName));
Transforms\NormalizeColumnDbl.cs (10)
698
=>
PfaUtils
.Call("*",
PfaUtils
.Call("-", srcToken, Offset), Scale);
759
var itemType =
PfaUtils
.Type.Double;
760
var arrType =
PfaUtils
.Type.Array(itemType);
762
var scaleCell =
PfaUtils
.Cell(cellName);
766
var offsetCell =
PfaUtils
.Cell(cellName);
767
srcToken =
PfaUtils
.Call("a.zipmap", srcToken, offsetCell,
PfaUtils
.FuncRef(ctx.Pfa.EnsureSub(itemType)));
769
return
PfaUtils
.Call("a.zipmap", srcToken, scaleCell,
PfaUtils
.FuncRef(ctx.Pfa.EnsureMul(itemType)));
Transforms\NormalizeColumnSng.cs (10)
856
=>
PfaUtils
.Call("*",
PfaUtils
.Call("-", srcToken, Offset), Scale);
916
var itemType =
PfaUtils
.Type.Double;
917
var arrType =
PfaUtils
.Type.Array(itemType);
919
var scaleCell =
PfaUtils
.Cell(cellName);
923
var offsetCell =
PfaUtils
.Cell(cellName);
924
srcToken =
PfaUtils
.Call("a.zipmap", srcToken, offsetCell,
PfaUtils
.FuncRef(ctx.Pfa.EnsureSub(itemType)));
926
return
PfaUtils
.Call("a.zipmap", srcToken, scaleCell,
PfaUtils
.FuncRef(ctx.Pfa.EnsureMul(itemType)));
Transforms\ValueToKeyMappingTransformer.cs (14)
972
"TermMap",
PfaUtils
.Type.Map(
PfaUtils
.Type.Int), jsonMap);
973
JObject cellRef =
PfaUtils
.Cell(cellName);
978
ctx.Pfa.AddFunc(funcName, new JArray(
PfaUtils
.Param("term",
PfaUtils
.Type.String)),
979
PfaUtils
.Type.Int,
PfaUtils
.If(
PfaUtils
.Call("map.containsKey", cellRef, "term"),
PfaUtils
.Index(cellRef, "term"), -1));
980
var funcRef =
PfaUtils
.FuncRef("u." + funcName);
981
return
PfaUtils
.Call("a.map", srcToken, funcRef);
983
return
PfaUtils
.If(
PfaUtils
.Call("map.containsKey", cellRef, srcToken),
PfaUtils
.Index(cellRef, srcToken), -1);