{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":24361,"path":"intelligent-experiences/predictive-intelligence/test-solution-prediction.md","title":"Test a classification solution prediction","bundle":null,"doc_type":null,"release":"australia","body":"\n# Test a classification 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 to test a classification solution prediction for incident categorization.\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 classification 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 similarity solution prediction.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Predictive Intelligence** &gt; **Classification** &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, use the **Name** field value in your ML Solution Definition Incident Categorization record, as illustrated in the following example.\n\n    \\[Omitted image \"predictive-intelligence-solution-name.png\"\\] Alt text: This image hows you where to find the Name field value in your ML Solution Definition Incident Categorization record.\n\n3.  Write down and save the **Input Fields** 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, as the prediction model has been trained to use this field to learn its category definition.\n\n    \\[Omitted image \"predictive-intelligence-solution-description.png\"\\] Alt text: Where to find the Input Fields that you want the REST API Explorer to use in its call to the Predictive Intelligence API\n\n4.  Navigate to **System Web Services** &gt; **REST** &gt; **REST API Explorer**.\n\n5.  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\n6.  In the solution-name **Value** field, type `ml_incident_categorization`.\n\n    **Note:** This is the Name value you captured in Step 1 of this procedure.\n\n7.  Click **Add query parameter**.\n\n    The Predictive Intelligence form refreshes to show the **Query parameters** section.\n\n8.  Type `short_description` in the first field.\n\n    **Note:** This is the input field you captured in Step 2 of this procedure.\n\n9.  Type a short description of an incident in the second field.\n\n    For instance, type `Unable to connect`.\n\n10. Click the **Send** button.\n\n    The REST API Explorer sends your request to the Predictive Intelligence API.\n\n    The system predicts the output value in the Response Body section of the API output. You can use other short descriptions to test what the solution is predicting.\n\n11. Send a different request to the Predictive Intelligence API so that you can test the prediction model again.\n\n    1.  Return to the **Query parameters** section of the Predictive Intelligence form.\n\n    2.  Type a short description that references a different kind of incident in the second field.\n\n        For example, type `Unable to connect to MSSQL`.\n\n    3.  Click the **Send** button.\n\n    The Response Body section may refresh to show a different outcome than what you saw in Step 9, depending on which incident categories you configured in your solution definition setup. In other words, changing the short description text can recategorize the incident as a different kind of issue.\n\n\n## Example\n\nYou can also test the Predictive Intelligence prediction model when you create a new incident record using the incident form.\n\n1.  Navigate to **Incident** &gt; **Create New**.\n2.  In the new Incident form that loads, set the fields as follows.\n    -   **User:** Enter the Caller name.\n    -   **Category:** Leave as default.\n    -   **Short description:** Enter a short description that you want to test.\n3.  Submit the incident form.\n\nResult: When the form refreshes, an information message appears with the incident category automatically set to a specific value.\n\n**Note:** For some short descriptions, the prediction might not process because the solution does not have enough confidence in predicting the value for this input.\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"}}