itsjhuang/watsonx-docs-document-type huggingface dataset:
Deploying models with Watson Machine Learning
Deploying models with Watson Machine Learning Using IBM Watson Machine Learning, you can deploy models, scripts, and functions, manage your deployments, and prepare your assets to put into production to generate predictions and insights. This graphic illustrates a typical process for a machine learning model. After you build and train a machine learning model, use Watson Machine Learning to deploy the model, manage the input data, and put your machine learning assets to use. ![Building a machine learning model](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/ml_overview.svg) IBM Watson Machine Learning architecture and services Watson Machine Learning is a service on IBM Cloud with features for training and deploying machine learning models and neural networks. Built on a scalable, open source platform based on Kubernetes and Docker components, Watson Machine Learning enables you to build, train, deploy, and manage machine learning and deep learning models. Deploying and managing models with Watson Machine Learning Watson Machine Learning supports popular frameworks, including: TensorFlow, Scikit-Learn, and PyTorch to build and deploy models. For a list of supported frameworks, refer to [Supported frameworks](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/pm_service_supported_frameworks.html). To build and train a model: * Use one of the tools that are listed in [Analyzing data and building models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/data-science.html). * [Import a model](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-importing-model.html) that you built and trained outside of Watson Studio. Deployment infrastructure * [Deploy trained models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-deploy-general.html) as a web service or for batch processing. * [Deploy Python functions](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-deploy-py-function.html) to simplify AI solutions. Programming Interfaces * Use [Python client library](https://ibm.github.io/watson-machine-learning-sdk/) to work with all of your Watson Machine Learning assets in a notebook. * Use [REST API](https://cloud.ibm.com/apidocs/machine-learning) to call methods from the base URLs for the Watson Machine Learning API endpoints. * When you call the API, use the URL and add the path for each method to form the complete API endpoint for your requests. For details on checking endpoints, refer to [Looking up a deployment endpoint](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/deploy-online.html). Parent topic:[Deploying and managing models](https://dataplatform.cloud.ibm.com/docs/content/wsj/wmls/wmls-deploy-overview.html)
Advanced linguistic settings (SPSS Modeler)
Advanced linguistic settings When you build categories, you can select from a number of advanced linguistic category building techniques such as concept inclusion and semantic networks (English text only). These techniques can be used individually or in combination with each other to create categories. Keep in mind that because every dataset is unique, the number of methods and the order in which you apply them may change over time. Since your text mining goals may be different from one set of data to the next, you may need to experiment with the different techniques to see which one produces the best results for the given text data. None of the automatic techniques will perfectly categorize your data; therefore we recommend finding and applying one or more automatic techniques that work well with your data. The following advanced settings are available for the Use linguistic techniques to build categories option in the category settings.
Managing hardware configurations
Managing hardware configurations When you deploy certain assets in Watson Machine Learning, you can choose the type, size, and power of the hardware configuration that matches your computing needs. Deployment types that require hardware specifications Selecting a hardware specification is available for all [batch deployment](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/deploy-batch-details.html) types. For [online deployments](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/deploy-online.html), you can select a specific hardware specification if you're deploying: * Python Functions * Tensorflow models * Models with custom software specifications Hardware configurations available for deploying assets * XS: 1x4 = 1 vCPU and 4 GB RAM * S: 2x8 = 2 vCPU and 8 GB RAM * M: 4x16 = 4 vCPU and 16 GB RAM * L: 8x32 = 8 vCPU and 32 GB RAM * XL: 16x64 = 16 vCPU and 64 GB RAM You can use the XS configuration to deploy: * Python functions * Python scripts * R scripts * Models based on custom libraries and custom images For Decision Optimization deployments, you can use these hardware specifications: * S * M * L * XL Learn more * [Monitoring account resource usage](https://dataplatform.cloud.ibm.com/docs/content/wsj/admin/monitor-resources.html) Parent topic:[Managing predictive deployments](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-deploy-general.html)
Supported data sources in Decision Optimization
Supported data sources in Decision Optimization Decision Optimization supports the following relational and nonrelational data sources on . watsonx.ai. * [IBM data sources](https://dataplatform.cloud.ibm.com/docs/content/DO/DODS_Introduction/DOconnections.html?context=cdpaas&locale=enDOConnections__ibm-data-src) * [Third-party data sources](https://dataplatform.cloud.ibm.com/docs/content/DO/DODS_Introduction/DOconnections.html?context=cdpaas&locale=enDOConnections__third-party-data-src)
applyautonumericnode properties
applyautonumericnode properties You can use Auto Numeric modeling nodes to generate an Auto Numeric model nugget. The scripting name of this model nugget is applyautonumericnode.For more information on scripting the modeling node itself, see [autonumericnode properties](https://dataplatform.cloud.ibm.com/docs/content/wsd/nodes/scripting_guide/clementine/rangepredictornodeslots.htmlrangepredictornodeslots). applyautonumericnode properties Table 1. applyautonumericnode properties applyautonumericnode Properties Values Property description calculate_standard_error flag
Enabling model tracking with AI factsheets
Enabling model tracking with AI factsheets If your organization is using AI Factsheets as part of an AI governance strategy, you can track models after adding them to a space. Tracking a model populates a factsheet in an associated model use case. The model use cases are maintained in a model inventory in a catalog, providing a way for all stakeholders to view the lifecyle details for a machine learning model. From the inventory, collaborators can view the details for a model as it moves through the model lifecycle, including the request, development, deployment, and evaluation of the model. To enable model tracking by using AI Factsheets: 1. From the asset list in your space, click a model name and then click the Model details tab. 2. Click Track this model. 3. Associate the model with an existing model use case in the inventory or create a new use case. 4. Specify the details for the new use case, including specifying a catalog if you have access to more than one, and save to register the model. A link to the model inventory is added to the model details page. 5. Click the link to open the model use case in the inventory. 6. Optional: update the model use case. For example, add tags, supporting documentation, or other details.
Report node (SPSS Modeler)
Report node You can use the Report node to create formatted reports containing fixed text, data, or other expressions derived from the data. Specify the format of the report by using text templates to define the fixed text and the data output constructions. You can provide custom text formatting using HTML tags in the template and by setting output options. Data values and other conditional output are included in the report using CLEM expressions in the template.
Scoring records (SPSS Modeler)
Scoring records Earlier, we scored the same records used to estimate the model so we could evaluate how accurate the model was. Now we'll score a different set of records from the ones used to create the model. This is the goal of modeling with a target field: Study records for which you know the outcome, to identify patterns that will allow you to predict outcomes you don't yet know. Figure 1. Attaching new data for scoring ![Attaching new data for scoring](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_intro_score.png) You could update the data asset Import node to point to a different data file, or you could add a new Import node that reads in the data you want to score. Either way, the new dataset must contain the same input fields used by the model (Age, Income level, Education and so on), but not the target field Credit rating. Alternatively, you could add the model nugget to any flow that includes the expected input fields. Whether read from a file or a database, the source type doesn't matter as long as the field names and types match those used by the model.
Decision Optimization notebook tutorial create new scenario
Create new scenario To solve with different versions of your model or data you can create new scenarios in the Decision Optimization experiment UI. Procedure To create a new scenario: 1. Click the Open scenario pane icon ![Open scenario pane button](https://dataplatform.cloud.ibm.com/docs/content/DO/DODS_Introduction/images/CPDscenariomanage.jpg) to open the Scenario panel. 2. Use the Create Scenario drop-down menu to create a new scenario from the current one. 3. Add a name for the duplicate scenario and click Create. 4. Working in your new scenario, in the Prepare data view, open the diet_food data table in full mode. 5. Locate the entry for Hotdog at row 9, and set the qmax value to 0 to exclude hot dog from possible solutions. 6. Switch to the Build model view and run the model again. 7. You can see the impact of your changes on the solution by switching from one scenario to the other.
Fields (SPSS Modeler)
Fields Names in CLEM expressions that aren’t names of functions are assumed to be field names. You can write these simply as Power, val27, state_flag, and so on, but if the name begins with a digit or includes non-alphabetic characters, such as spaces (with the exception of the underscore), place the name within single quotation marks (for example, 'Power Increase', '2nd answer', '101', '$P-NextField'). Note: Fields that are quoted but undefined in the data set will be misread as strings.
balancenode properties
balancenode properties ![Balance node icon](https://dataplatform.cloud.ibm.com/docs/content/wsd/nodes/scripting_guide/clementine/images/balancenodeicon.png) The Balance node corrects imbalances in a dataset, so it conforms to a specified condition. The balancing directive adjusts the proportion of records where a condition is true by the factor specified. balancenode properties Table 1. balancenode properties balancenode properties Data type Property description directives Structured property to balance proportion of field values based on number specified. training_data_only flag Specifies that only training data should be balanced. If no partition field is present in the stream, then this option is ignored. This node property uses the format: [[ number, string ] \ [ number, string] \ ... [number, string ]]. Note: If strings (using double quotation marks) are embedded in the expression, they must be preceded by the escape character " ". The " " character is also the line continuation character, which you can use to align the arguments for clarity.
Browsing a model (SPSS Modeler)
Browsing the model When the C5.0 node runs, its model nugget is added to the flow. To browse the model, right-click the model nugget and choose View Model. The Tree Diagram displays the set of rules generated by the C5.0 node in a tree format. Now you can see the missing pieces of the puzzle. For people with an Na-to-K ratio less than 14.829 and high blood pressure, age determines the choice of drug. For people with low blood pressure, cholesterol level seems to be the best predictor. Figure 1. Tree diagram ![Tree diagram](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_drug_browse_tree.png) You can hover over the nodes in the tree to see more details such as the number of cases for each blood pressure category and the confidence percentage of cases.
Caching options for nodes (SPSS Modeler)
Caching options for nodes To optimize the running of flows, you can set up a cache on any nonterminal node. When you set up a cache on a node, the cache is filled with the data that passes through the node the next time you run the data flow. From then on, the data is read from the cache (which is stored temporarily) rather than from the data source. Caching is most useful following a time-consuming operation such as a sort, merge, or aggregation. For example, suppose that you have an import node set to read sales data from a database and an Aggregate node that summarizes sales by location. You can set up a cache on the Aggregate node rather than on the import node because you want the cache to store the aggregated data rather than the entire data set. Note: Caching at import nodes, which simply stores a copy of the original data as it is read into SPSS Modeler, won't improve performance in most circumstances. Nodes with caching enabled are displayed with a special circle-backslash icon. When the data is cached at the node, the icon changes to a check mark. Figure 1. Node with empty cache vs. node with full cache ![Shows a node with an empty cache and a node with a full cache](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/cache_nodes.png) A circle-backslash icon by node indicates that its cache is empty. When the cache is full, the icon becomes a check mark. If you want to replace the contents of the cache, you must first flush the cache and then re-run the data flow to refill it. In your flow, right-click the node and select .
MultiLayerPerceptron-AS node (SPSS Modeler)
MultiLayerPerceptron-AS node Multilayer perceptron is a classifier based on the feedforward artificial neural network and consists of multiple layers. Each layer is fully connected to the next layer in the network. See [Multilayer Perceptron Classifier (MLPC)](https://spark.apache.org/docs/latest/ml-classification-regression.htmlmultilayer-perceptron-classifier) for details.^1^ The MultiLayerPerceptron-AS node in watsonx.ai is implemented in Spark. To use a this node, you must set up an upstream Type node. The MultiLayerPerceptron-AS node will read input values from the Type node (or from the Types of an upstream import node). ^1^ "Multilayer perceptron classifier." Apache Spark. MLlib: Main Guide. Web. 5 Oct 2018.
Expressions and conditions (SPSS Modeler)
Expressions and conditions CLEM expressions can return a result (used when deriving new values). For example: Weight * 2.2 Age + 1 sqrt(Signal-Echo) Or, they can evaluate true or false (used when selecting on a condition). For example: Drug = "drugA" Age < 16 not(PowerFlux) and Power > 2000 You can combine operators and functions arbitrarily in CLEM expressions. For example: sqrt(abs(Signal))* max(T1, T2) + Baseline Brackets and operator precedence determine the order in which the expression is evaluated. In this example, the order of evaluation is: * abs(Signal) is evaluated, and sqrt is applied to its result * max(T1, T2) is evaluated * The two results are multiplied: x has higher precedence than + * Finally, Baseline is added to the result The descending order of precedence (that is, operations that are performed first to operations that are performed last) is as follows: * Function arguments * Function calls * xx * x / mod div rem * + – * > < >= <= /== == = /= If you want to override precedence, or if you're in any doubt of the order of evaluation, you can use parentheses to make it explicit. For example: sqrt(abs(Signal))* (max(T1, T2) + Baseline)
Remarks
Remarks Remarks are comments that are introduced by the pound (or hash) sign (). All text that follows the pound sign on the same line is considered part of the remark and is ignored. A remark can start in any column. The following example demonstrates the use of remarks: The HelloWorld application is one of the most simple print 'Hello World' print the Hello World line
Integrating with Google Cloud Platform
Integrating with Google Cloud Platform You can configure an integration with the Google Cloud Platform (GCP) to allow IBM watsonx users to access data sources from GCP. Before proceeding, make sure you have proper permissions. After you configure an integration, you'll see it under Service instances. For example, you'll see a new GCP tab that lists your BigQuery data sets and Storage buckets. To configure an integration with GCP: 1. Log on to the Google Cloud Platform at [https://console.cloud.google.com](https://console.cloud.google.com). 2. Go to IAM & Admin > Service Accounts. 3. Open your project and then click CREATE SERVICE ACCOUNT.1. Specify a name and description for the new service account and click CREATE. Specify other options as desired and click DONE.1. Click the actions menu next to the service instance and select Create key. For key type, select JSON and then click CREATE. The JSON key file will be downloaded to your machine. Important: Write down your key ID and secret and store them in a sStore the key file in a secure location. 4. In IBM watsonx, under Administrator > Cloud integrations, go to the GCP tab, enable integration, and then paste the contents from the JSON key file into the text field. Only certain properties from the JSON will be stored, and the private_key property will be encrypted. 5. Go back to Google Cloud Platform and edit the service account you created previously. Add the following roles: 6. Confirm that you can see your GCP services. From the main menu, choose Administration > Services > Services instances. Click the GCP tab to see those services, for example, BigQuery data sets and Storage buckets. Now users who have credentials to your GCP services can can [create connections](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/create-conn.html) to them by selecting them on the Add connection page. Then they can access data from those connections by [creating connected data assets](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/connected-data.html). Next steps * [Set up a project](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/projects.html) * [Create connections in a project](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/create-conn.html) Parent topic:
Sim Gen node (SPSS Modeler)
Sim Gen node The Simulation Generate node provides an easy way to generate simulated data, either without historical data using user specified statistical distributions, or automatically using the distributions obtained from running a Simulation Fitting node on existing historical data. Generating simulated data is useful when you want to evaluate the outcome of a predictive model in the presence of uncertainty in the model inputs.
dataassetexport properties
dataassetexport properties ![Data Asset Export node icon](https://dataplatform.cloud.ibm.com/docs/content/wsd/nodes/scripting_guide/clementine/images/dataassetexportnode.png)You can use the Data Asset Export node to write to remove data sources using connections, write to a data file on your local computer, or write data to a project. dataassetexport properties Table 1. dataassetexport properties dataassetexport properties Data type Property description user_settings string Escaped JSON string containing the interaction properties for the connection. Contact IBM for details about available interaction points.<br><br>Example:<br><br>user_settings: "{"interactionProperties":{"write_mode":"write","file_name":"output.csv","file_format":"csv","quote_numerics":true,"encoding":"utf-8","first_line_header":true,"include_types":false}}"<br><br>Note that these values will change based on the type of connection you're using.
Using the Text Analytics Workbench (SPSS Modeler)
Using the Text Analytics Workbench The Text Analytics Workbench contains the extraction results and the category model contained in the text analytics package.
TwoStep-AS cluster node (SPSS Modeler)
TwoStep-AS cluster node TwoStep Cluster is an exploratory tool that is designed to reveal natural groupings (or clusters) within a data set that would otherwise not be apparent. The algorithm that is employed by this procedure has several desirable features that differentiate it from traditional clustering techniques. * Handling of categorical and continuous variables. By assuming variables to be independent, a joint multinomial-normal distribution can be placed on categorical and continuous variables. * Automatic selection of number of clusters. By comparing the values of a model-choice criterion across different clustering solutions, the procedure can automatically determine the optimal number of clusters. * Scalability. By constructing a cluster feature (CF) tree that summarizes the records, the TwoStep algorithm can analyze large data files. For example, retail and consumer product companies regularly apply clustering techniques to information that describes their customers' buying habits, gender, age, income level, and other attributes. These companies tailor their marketing and product development strategies to each consumer group to increase sales and build brand loyalty.
XGBoost-AS node (SPSS Modeler)
XGBoost-AS node XGBoost© is an advanced implementation of a gradient boosting algorithm. Boosting algorithms iteratively learn weak classifiers and then add them to a final strong classifier. XGBoost is very flexible and provides many parameters that can be overwhelming to most users, so the XGBoost-AS node in Watson Studio exposes the core features and commonly used parameters. The XGBoost-AS node is implemented in Spark. For more information about boosting algorithms, see the [XGBoost Tutorials](http://xgboost.readthedocs.io/en/latest/tutorials/index.html). ^1^ Note that the XGBoost cross-validation function is not supported in Watson Studio. You can use the Partition node for this functionality. Also note that XGBoost in Watson Studio performs one-hot encoding automatically for categorical variables. Notes: * On Mac, version 10.12.3 or higher is required for building XGBoost-AS models. * XGBoost isn't supported on IBM POWER. ^1^ "XGBoost Tutorials." Scalable and Flexible Gradient Boosting. Web. © 2015-2016 DMLC.
Automated modeling for a continuous target (SPSS Modeler)
Automated modeling for a continuous target You can use the Auto Numeric node to automatically create and compare different models for continuous (numeric range) outcomes, such as predicting the taxable value of a property. With a single node, you can estimate and compare a set of candidate models and generate a subset of models for further analysis. The node works in the same manner as the Auto Classifier node, but for continuous rather than flag or nominal targets.
Bubble charts
Bubble charts Bubble charts display categories in your groups as nonhierarchical packed circles. The size of each circle (bubble) is proportional to its value. Bubble charts are useful for comparing relationships in your data.
The scripting API
The scripting API The Scripting API provides access to a wide range of SPSS Modeler functionality. All the methods described so far are part of the API and can be accessed implicitly within the script without further imports. However, if you want to reference the API classes, you must import the API explicitly with the following statement: import modeler.api This import statement is required by many of the scripting API examples.
Ways to use Decision Optimization
Ways to use Decision Optimization To build Decision Optimization models, you can create Python notebooks with DOcplex, a native Python API for Decision Optimization, or use the Decision Optimization experiment UI that has more benefits and features.