{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":24342,"path":"intelligent-experiences/predictive-intelligence/predictive-intel-only-top-n-labels.md","title":"Configure include only top N labels","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure include only top N labels\n\nLimit your classification model to use only the most common classes when training. You can specify the number of classes to use.\n\n## Before you begin\n\nRole required: ml\\_admin or admin\n\n## About this task\n\nRestricting the model to a fixed number of the most frequent labels improves focus and performance, especially with large datasets.\n\nYou can add this option in the solution definition form by using the following procedure. Alternatively, you can use a script to add this option.\n\nTo add this option using a script:\n\n```\nconfig.setTopNLabels(100);\n```\n\nIn JSON format:\n\n```\n{\n    \"include_top_n_labels\": 100\n    }\n```\n\n## Procedure\n\n1.  To add this option in the solution definition form, navigate to **All** &gt; **Predictive Intelligence** &gt; **Classification** &gt; **Solution Definitions**.\n\n2.  Open an existing classification solution or create a new one.\n\n3.  Select the **Advanced Solution Settings** tab in the **Related Links** section of the form.\n\n4.  Select **New** to open the **Advanced Solution Setting** \\(ml\\_advanced\\_solution\\_settings\\) form.\n\n5.  In the **Solution Parameters** field, search for `include only top n labels`.\n\n6.  In the **User Inputs** field, enter the number of classes you want as the limit, then select **Submit**.\n\n    \\[Omitted image \"predictive-intel-only-top-n-labelsZ1.png\"\\] Alt text: On the Advanced Solution Setting form, the Solution Parameters field and the User Inputs field are highlighted. The User Inputs field displays an example value of 100.\n\n\n## Result\n\nThe setting appears as a row on the **Advanced Solution Setting** tab on your solution's form.\n\n## What to do next\n\nRetrain your solution.\n\n**Parent Topic:**[Configuring advanced settings for your ML solutions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/predictive-intelligence/configuring-advanced-settings-ml-solutions.md)\n\n**Related topics**  \n\n\n[Using Machine Learning APIs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/predictive-intelligence/using-ml-apis.md)\n\n[Create and train a classification solution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/intelligent-experiences/predictive-intelligence/create-solution-definition.md)\n\n"}}