{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":846,"path":"api-reference/server-api-reference/MLSolutionFactoryAPI.md","title":"MLSolutionFactory - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# MLSolutionFactory - Global\n\nThe MLSolutionFactory API is a factory class to get an MLSolution scriptable object.\n\nThis API requires the Predictive Intelligence plugin \\(com.glide.platform\\_ml\\) and is provided within the `sn_ml` namespace. For more information, see [Predictive Intelligence](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/predictive-intelligence.md).\n\nFor usage guidelines, refer to [MLSolutionFactory scriptable objects](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/using-ml-apis-mlsolutionfactory.md).\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n**Related topics**  \n\n\n[MLSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/MLSolutionAPI.md)\n\n[MLSolutionUtil](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/MLSolutionUtilAPI.md)\n\n[REST API: Get predictions for multiple solutions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/agent-intelligence-api.md)\n\n## MLSolutionFactory - getSolution\\(String solutionName, Object options\\)\n\nGets an MLSolution object for a specified solution name.\n\n|Name|Type|Description|\n|----|----|-----------|\n|solutionName|String|Name of the solution.|\n|options|Object|Optional. options.version: If provided, creates MLSolution instance for provided version of solutionName.|\n\n|Type|Description|\n|----|-----------|\n|Object|[MLSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/MLSolutionAPI.md) object of the specified solution.|\n\n```\n// basic usage\nvar mlSolution = sn_ml.MLSolutionFactory.getSolution(\"ml_incident_categorization\");\n        \n```\n\n```\n// using options.version parameter\nvar options = {};\noptions.version = 1;\nvar mlSolution = sn_ml.MLSolutionFactory.getSolution(\"ml_incident_categorization\", options);\n```\n\n"}}