MLSolutionUtil – Global
Die MLSolutionUtil Die Skripteinbindung stellt Methoden zum Abrufen bereit Predictive Intelligence Vorhersagen.
Diese Skripteinbindung erfordert Predictive Intelligence Plugin (com.glide.platform_ml) und wird in bereitgestellt sn_ml Namespace.
Weitere Informationen finden Sie unter Mit ML APIs .
MLSolutionUtil: MLSolutionUtil()
Instanziiert ein neues MLSolutionUtil-Objekt.
| Name | Typ | Beschreibung |
|---|---|---|
| Keine |
var mlSolutionUtil = new MLSolutionUtil();
MLSolutionUtil – getPredictions (Objekteingabe, Array-Lösungsnamen, Objektoptionen)
Ruft Vorhersagen für eine oder mehrere angegebene Lösungen ab.
| Name | Typ | Beschreibung |
|---|---|---|
| Eingabe | Objekt | GlideRecord oder Array von JSON-Objekten als Schlüssel-Wert-Paare. |
| Lösungsnamen | Array | Array von Lösungsnamen, aus denen Vorhersagen abgerufen werden sollen. |
| Optionen | Objekt | Optional. JSON-Objekt-Schlüssel-Wert-Paar mit den folgenden Eigenschaften:
|
| Typ | Beschreibung |
|---|---|
| Array | JSON-Schlüssel-Wert-Paar, das das Vorhersageergebnis enthält, gruppiert nach Lösungsname und sortiert nach sys_ID oder Record_number.
|
var solutionNames = ['soluton1', 'solution2'];
var input = new GlideRecord("incident");
input.get("0ef47232db801300864adfea5e961912");
// configure optional parameters
var options = {};
options.top_n = 3;
options.apply_threshold = false;
var mlSolutionUtil = new MLSolutionUtil();
var results = mlSolutionUtil.getPredictions(input, solutionNames, options);
// pretty print JSON results
gs.print(JSON.stringify(JSON.parse(results), null, 2));
Ausgabe:
{
solution1: {
input_gr_sys_id1: [
{
predictedValue : xxx,
predictedSysId : xx0,
confidence : xxx,
threshold : xxx
},
{
predictedValue : yyy,
predictedSysId : xx1,
confidence : xxx,
threshold : xxx
}
],
input_gr_sys_id2 : [
{
predictedValue : xxx,
predictedSysId : xx0,
confidence : xxx,
threshold : xxx
},
...
]
}
solution2: {
...
}