{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":24360,"path":"intelligent-experiences/predictive-intelligence/test-similarity-solution-prediction.md","title":"Test a similarity solution prediction","bundle":null,"doc_type":null,"release":"australia","body":"\n# Test a similarity solution prediction\n\nOnce your machine-learning \\(ML\\) solutions are trained, you can call on the Predictive Intelligence API to make a solution prediction. In this example procedure, we use the REST API Explorer application to test a similarity solution prediction for resolved incident recommendations.\n\n## Before you begin\n\nTrain your ML solution prior to testing a prediction.\n\nRole required: web\\_service\\_admin, rest\\_api\\_explorer, or admin or ml\\_admin\n\n## About this task\n\nThis procedure uses sample data to illustrate what you can do in your instance, and may not represent data or records that are actually in your instance.\n\nThis scenario illustrates a similarity solution prediction for a hypothetical ML solution that you have previously created and trained. You can also use the REST API Explorer to test a classification solution prediction.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Predictive Intelligence** &gt; **Similarity** &gt; **Solution Definitions**.\n\n2.  Locate the ML solution definition whose prediction you want to test, and copy its **Name** value to your clipboard or a Notepad file.\n\n    In this case, we use the **Name** field value in your ML Solution Definition Recommended Resolved Incidents record, as illustrated in the following example.\n\n    \\[Omitted image \"predict-intel-similarity-soldef-name.png\"\\] Alt text: Show the user where to find the ML solution definition name\n\n3.  Copy the **Input Fields** value\\(s\\) used in your ML Solution Definition record that you want the REST API Explorer to use in its call to the Predictive Intelligence API.\n\n    In this case, we use the **Short description** field type, as the prediction model has been trained to use this field to learn, pair, and recommend similar records for your review.\n\n    \\[Omitted image \"predict-intel-similarity-soldef-inputfields.png\"\\] Alt text: Show the user where to find the Input Field types.\n\n4.  Right-click the browser tab you're using to view your instance, and select **Duplicate**.\n\n5.  In the duplicate browser tab, navigate to **System Web Services** &gt; **REST** &gt; **REST API Explorer**.\n\n6.  Click **Explore**.\n\n7.  Set these choice fields as follows.\n\n    |Field|Value|\n    |-----|-----|\n    |**Namespace**|now \\(leave as default\\)|\n    |**API Name**|Predictive Intelligence|\n    |**API Version**|latest \\(leave as default\\)|\n\n    The Predictive Intelligence form appears. You use this form to prepare your call request to the Predictive Intelligence API.\n\n8.  In the solution-name **Value** field, enter `ml_x_snc_global_recommended_resolved_incidents`.\n\n    **Note:** This is the Name value you captured in Step 2 of this procedure.\n\n9.  Click **Add query parameter**.\n\n10. In the Query parameters section, enter the value of one of the Input Fields from the solution you're testing.\n\n    1.  In the first field, paste `short_description`.\n\n        **Note:** This is one of the input fields you captured in Step 2 of this procedure.\n\n        You can use other field types, such as **Description** or **Resolution notes** to test what the solution is predicting.\n\n    2.  In the second field, enter some text that you might find in an incident record.\n\n        For instance, enter `Discovery errors`.\n\n11. Click the \\[+\\] button to create a second query condition that defines the number of results you want to query.\n\n    1.  In the first field, enter `top_n`.\n\n    2.  In the second field, enter `3`.\n\n    These conditions set the query to retrieve the top three most similar incident records.\n\n12. Click **Send**.\n\n    The REST API Explorer sends your request to the Predictive Intelligence API.\n\n13. In the Response body section, copy the three outcome values that your API call returned, as illustrated in the image below.\n\n    \\[Omitted image \"predict-intel-simtest-soldef-outcomes.png\"\\] Alt text: Shows the user the top 3 REST API Explorer response body outcomes.\n\n14. In your original browser tab, navigate to **Servicedesk** &gt; **Incidents**.\n\n15. As shown in the image below, set filter conditions for the three REST API outcomes to the Incidents table list view.\n\n    1.  Add the Active and Sys ID conditions below to the Incidents list view Filter icon.\n\n    2.  Paste the three REST API outcomes into the **Input value** field of the Sys ID condition that you created.\n\n    3.  Click **Run**.\n\n    \\[Omitted image \"predict-intel-simtest-soldef-outcomeconditions.png\"\\] Alt text: Shows the user the filter conditions to set on the Incident list view and where to paste the REST API outcomes.\n\n16. Per the image below, compare the returned list of incidents with the input for the prediction output in the REST API Explorer.\n\n    1.  Click the Incident Number to open the Incident record.\n\n        \\[Omitted image \"predict-intel-simtest-soldef-top3incidents.png\"\\] Alt text: Shows the user the 3 Incident records that share the text from the input field.\n\n    2.  Per the image below, review the Resolution notes text in the Incident record.\n\n        \\[Omitted image \"predict-intel-simtest-soldef-recommendation.png\"\\] Alt text: Shows the user the Resolution notes in one of the Incident records.\n\n\n**Parent Topic:**[Testing and monitoring predictions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/predictive-intelligence/testing-reviewing-ml-solutions.md)\n\n**Related topics**  \n\n\n[Predictive Intelligence API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/agent-intelligence-api.md)\n\n[MLPredictor - Global](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/c_MLPredictorAPI.md)\n\n"}}