itsjhuang/watsonx-docs-document-type huggingface dataset:
Setting properties
Setting properties Nodes, flows, models, and outputs all have properties that can be accessed and, in most cases, set. Properties are typically used to modify the behavior or appearance of the object. The methods that are available for accessing and setting object properties are summarized in the following table. Methods for accessing and setting object properties Table 1. Methods for accessing and setting object properties Method Return type Description p.getPropertyValue(propertyName) Object Returns the value of the named property or None if no such property exists. p.setPropertyValue(propertyName, value) Not applicable Sets the value of the named property. p.setPropertyValues(properties) Not applicable Sets the values of the named properties. Each entry in the properties map consists of a key that represents the property name and the value that should be assigned to that property. p.getKeyedPropertyValue( propertyName, keyName) Object Returns the value of the named property and associated key or None if no such property or key exists. p.setKeyedPropertyValue( propertyName, keyName, value) Not applicable Sets the value of the named property and key. For example, the following script sets the value of a Derive node for a flow: stream = modeler.script.stream() node = stream.findByType("derive", None) node.setPropertyValue("name_extension", "new_derive") Alternatively, you might want to filter a field from a Filter node. In this case, the value is also keyed on the field name. For example: stream = modeler.script.stream() Locate the filter node ... node = stream.findByType("filter", None) ... and filter out the "Na" field node.setKeyedPropertyValue("include", "Na", False)
Running a flow
Running a flow The following example runs all executable nodes in the flow, and is the simplest type of flow script: modeler.script.stream().runAll(None) The following example also runs all executable nodes in the flow: stream = modeler.script.stream() stream.runAll(None) In this example, the flow is stored in a variable called stream. Storing the flow in a variable is useful because a script is typically used to modify either the flow or the nodes within a flow. Creating a variable that stores the flow results in a more concise script.
Building an deploying the model (SPSS Modeler)
Building and deploying the model 1. When your model is ready, click Generate a model to generate a text nugget. Figure 1. Generate a new model ![Generate a new model](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_build.png) Figure 2. Build a category model ![Build a category model](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_buildcat.png) 2. If you want to save the Text Analytics Workbench session, instead click Return to flow and then Save and exit. Figure 3. Saving your session ![Saving your session](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_build_save.png)The generated text nugget appears on your flow canvas. Figure 4. Generated text nugget ![Generated text nugget](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_build_nugget.png)After the category model has been validated and generated in the Text Analytics Workbench, you can deploy it in your flow and score the same data set or score a new one. Figure 5. Example flow with two modes for scoring ![Example flow with two modes for scoring](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_build_ex.png)This example flow illustrates the two modes for scoring: * Categories as fields. With this option, there are just as many output records as there were in the input. However, each record now contains one new field for every category that was selected on the Model tab. For each field, enter a flag value for true and for false, such as True/False, or 1/0. In this flow, values are set to 1 and 0 to aggregate results and count the number of positive, negative, mixed (both positive and negative), or no score (no opinion) answers. Figure 6. Model results - categories as fields ![Model results - categories as fields](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_build_excats.png) * Categories as records. With this option, a new record is created for each category, document pair. Typically, there are more records in the output than there were in the input. Along with the input fields, new fields are also added to the data depending on what kind of model it is. Figure 7. Model results - categories as records ![Model results - categories as records](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_build_exrecs.png) 3. You can add a Select node after the DeriveSentiment SuperNode, include Sentiments=Pos, and add a Charts node to gain quick insight about what guests appreciate about the hotel: Figure 8. Chart of positive opinions ![Chart of positive opinions](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tut_ta_hotel_positive.png)
applyglmmnode properties
applyglmmnode properties You can use GLMM modeling nodes to generate a GLMM model nugget. The scripting name of this model nugget is applyglmmnode. For more information on scripting the modeling node itself, see [glmmnode properties](https://dataplatform.cloud.ibm.com/docs/content/wsd/nodes/scripting_guide/clementine/glmmnodeslots.htmlglmmnodeslots). applyglmmnode properties Table 1. applyglmmnode properties applyglmmnode Properties Values Property description confidence onProbabilityonIncrease Basis for computing scoring confidence value: highest predicted probability, or difference between highest and second highest predicted probabilities. score_category_probabilities flag If set to True, produces the predicted probabilities for categorical targets. A field is created for each category. Default is False. max_categories integer Maximum number of categories for which to predict probabilities. Used only if score_category_probabilities is True. score_propensity flag If set to True, produces raw propensity scores (likelihood of "True" outcome) for models with flag targets. If partitions are in effect, also produces adjusted propensity scores based on the testing partition. Default is False. enable_sql_generation falsetruenative Used to set SQL generation options during flow execution. The options are to push back to the database, or to score within SPSS Modeler.
The Resource editor tab (SPSS Modeler)
The Resource editor tab Text Analytics rapidly and accurately captures key concepts from text data by using an extraction process. This process relies on linguistic resources to dictate how large amounts of unstructured, textual data should be analyzed and interpreted. You can use the Resource editor tab to view the linguistic resources used in the extraction process. These resources are stored in the form of templates and libraries, which are used to extract concepts, group them under types, discover patterns in the text data, and other processes. Text Analytics offers several preconfigured resource templates, and in some languages, you can also use the resources in text analysis packages. Figure 1. Resource editor tab ![Resource editor tab in the Text Analytics Workbench](https://dataplatform.cloud.ibm.com/docs/content/wsd/images/tmwb_resourceeditor.png)
Governing assets in AI use cases
Governing assets in AI use cases Create an AI use case to track and govern AI assets from request through production. Factsheets capture details about the asset for each stage of the AI lifecycle to help you meet governance and compliance goals. To learn about AI use cases, you can follow a tutorial in the Getting started with watsonx.governance sample project. Assets in the sample are prompt templates for a car insurance claim processing use case. The prompts use car insurance claims as input and then use large language models to help insurance agents process the claims. One prompt summarizes claims, another prompt extracts key information such as make and model, and the last prompt generates suggestions for the insurance agent. In Projects, start a new project, then choose to create a project from a sample. The project gallery includes the getting started sample. ![Getting started sample project](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/xgov-get-started-project.png) When your project is ready, open the Readme for a step-by-step tutorial. ![Getting started sample project](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/xgov-get-started-project-readme.png) Get started with AI use cases Set up or work with AI use cases: * [Create an inventory](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-inventory-manage.html) for storing AI use cases * [Set up an AI use case](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-use-cases.html) * [Track assets](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-tracking-overview.html) in an AI use case * [View factsheets](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-factsheet-viewing.html) for tracked assets Parent topic:[Governing AI assets](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-overview.html)
Modeling node properties
Modeling node properties Refer to this section for a list of available properties for Modeling nodes.
lsvmnode properties
lsvmnode properties ![LSVM node icon](https://dataplatform.cloud.ibm.com/docs/content/wsd/nodes/scripting_guide/clementine/images/lsvm_icon.png)With the Linear Support Vector Machine (LSVM) node, you can classify data into one of two groups without overfitting. LSVM is linear and works well with wide data sets, such as those with a very large number of records. lsvmnode properties Table 1. lsvmnode properties lsvmnode Properties Values Property description intercept flag Includes the intercept in the model. Default value is True. target_order AscendingDescending Specifies the sorting order for the categorical target. Ignored for continuous targets. Default is Ascending. precision number Used only if measurement level of target field is Continuous. Specifies the parameter related to the sensitiveness of the loss for regression. Minimum is 0 and there is no maximum. Default value is 0.1. exclude_missing_values flag When True, a record is excluded if any single value is missing. The default value is False. penalty_function L1L2 Specifies the type of penalty function used. The default value is L2. lambda number Penalty (regularization) parameter. calculate_variable_importance flag For models that produce an appropriate measure of importance, this option displays a chart that indicates the relative importance of each predictor in estimating the model. Note that variable importance may take longer to calculate for some models, particularly when working with large datasets, and is off by default for some models as a result. Variable importance is not available for decision list models.
Dendrogram charts
Dendrogram charts Dendrogram charts are similar to tree charts and are typically used to illustrate a network structure (for example, a hierarchical structure). Dendrogram charts consist of a root node that is connected to subordinate nodes through edges or branches. The last nodes in the hierarchy are called leaves.
Record Operations nodes (SPSS Modeler)
Record Operations Record Operations nodes are useful for making changes to data at the record level. These operations are important during the data understanding and data preparation phases of data mining because they allow you to tailor the data to your particular business need. For example, based on the results of a data audit conducted using the Data Audit node (Outputs palette), you might decide that you would like to merge customer purchase records for the past three months. Using a Merge node, you can merge records based on the values of a key field, such as Customer ID. Or you might discover that a database containing information about web site hits is unmanageable with over one million records. Using a Sample node, you can select a subset of data for use in modeling.
Generating a model nugget (SPSS Modeler)
Generating a model nugget When you're working in the Text Analytics Workbench, you may want to use the work you've done to generate a category model nugget. A model generated from a Text Analytics Workbench session is a category model nugget. You must first have at least one category before you can generate a category model nugget.
Accessing asset details
Accessing asset details Display details about an asset and preview data assets in a deployment space. To display details about the asset, click the asset name. For example, click a model name to view details such as the associated software and hardware specifications, the model creation date, and more. Some details, such as the model name, description, and tags, are editable. For data assets, you can also preview the data. Previewing data assets To preview a data asset, click the data asset name. * User's access to the data is based on the API layer. This means that if user's bearer token allows for viewing data, the data preview is displayed. * For tabular data, only a subset of the data is displayed. Also, column names are displayed but their data types are not inferred. * For data in XLS files, only the first worksheet is displayed for preview. * All data from Cloud Object Storage connectors is assumed to be tabular data. MIME types supported for preview: Format Mime types Image image/bmp, image/cmu-raster, image/fif, image/florian, image/g3fax, image/gif, image/ief, image/jpeg, image/jutvision, image/naplps, image/pict, image/png, image/svg+xml, image/vnd.net-fpx, image/vnd.rn-realflash, image/vnd.rn-realpix, image/vnd.wap.wbmp, image/vnd.xiff, image/x-cmu-raster, image/x-dwg, image/x-icon, image/x-jg, image/x-jps, image/x-niff, image/x-pcx, image/x-pict, image/x-portable-anymap, image/x-portable-bitmap, image/x-portable-greymap, image/x-portable-pixmap, image/x-quicktime, image/x-rgb, image/x-tiff, image/x-windows-bmp, image/x-xwindowdump, image/xbm, image/xpm Text application/json, text/asp, text/css, text/csv, text/html, text/mcf, text/pascal, text/plain, text/richtext, text/scriplet, text/tab-separated-values, text/tab-separated-values, text/uri-list, text/vnd.abc, text/vnd.fmi.flexstor, text/vnd.rn-realtext, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/webviewhtml, text/x-asm, text/x-audiosoft-intra, text/x-c, text/x-component, text/x-fortran, text/x-h, text/x-java-source, text/x-la-asf, text/x-m, text/x-pascal, text/x-script, text/x-script.csh, text/x-script.elisp, text/x-script.ksh, text/x-script.lisp, text/x-script.perl, text/x-script.perl-module, text/x-script.python, text/x-script.rexx, text/x-script.tcl, text/x-script.tcsh, text/x-script.zsh, text/x-server-parsed-html, text/x-setext, text/x-sgml, text/x-speech, text/x-uil, text/x-uuencode, text/x-vcalendar, text/xml Tabular data text/csv, application/excel, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, data from connections Parent topic:[Assets in deployment spaces](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-space-add-assets-all.html)
IBM Cloud services status
IBM Cloud services status If you're having a problem with one of your services, go to the IBM Cloud Status page. The Status page shows unplanned incidents, planned maintenance, announcements, and security bulletin notifications about key events that affect the IBM Cloud platform, infrastructure, and major services. You can find the Status page by logging in to the IBM Cloud console. Click Support from the menu bar, and then click View cloud status from the Support Center. Or, you can access the page directly at [IBM Cloud - Status](https://cloud.ibm.com/status?type=incident&component=ibm-cloud-platform&selected=status). Search for the service to view its status. Learn more [Viewing cloud status](https://cloud.ibm.com/docs/get-support?topic=get-support-viewing-cloud-status)
{{ document.title.text }}
Harmful code generation ![icon for harmful code generation risk](https://dataplatform.cloud.ibm.com/docs/content/wsj/ai-risk-atlas/images/risk-harmful-code-generation.svg)Risks associated with outputHarmful code generationNew Description Models might generate code that causes harm or unintentionally affects other systems. Why is harmful code generation a concern for foundation models? Without human review and testing of generated code, its use might cause unintentional behavior and open new system vulnerabilities. Business entities could face fines, reputational harms, and other legal consequences. Example Undisclosed AI Interaction According to their paper, researchers at Stanford University have investigated the impact of code-generation tools on code quality and found that programmers tend to include more bugs in their final code when using AI assistants. These bugs could increase the code's security vulnerabilities, yet the programmers believed their code to be more secure. Sources: [Neil Perry, Megha Srivastava, Deepak Kumar, and Dan Boneh. 2023. Do Users Write More Insecure Code with AI Assistants?. In Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security (CCS '23), November 26-30, 2023, Copenhagen, Denmark. ACM, New York, NY, USA, 15 pages.](https://dl.acm.org/doi/10.1145/3576915.3623157) Parent topic:[AI risk atlas](https://dataplatform.cloud.ibm.com/docs/content/wsj/ai-risk-atlas/ai-risk-atlas.html)
Creating nodes and modifying flows
Creating nodes and modifying flows In some situations, you might want to add new nodes to existing flows. Adding nodes to existing flows typically involves the following tasks: 1. Creating the nodes. 2. Linking the nodes into the existing flow.
Creating and managing IBM Cloud services
Creating and managing IBM Cloud services You can create IBM Cloud service instances within IBM watsonx from the Services catalog. Prerequisite : You must be [signed up for watsonx](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/signup-wx.html). Required permissions : For creating or managing a service instance, you must have Administrator or Editor platform access roles in the IBM Cloud account for IBM watsonx. If you signed up for IBM watsonx with your own IBM Cloud account, you are the owner of the account. Otherwise, you can [check your IBM Cloud account roles and permissions](https://dataplatform.cloud.ibm.com/docs/content/wsj/admin/your-roles.html). Creating a service To view the Services catalog, select Administration > Services > Services catalog from the main menu. For a description of each service, see [Services](https://dataplatform.cloud.ibm.com/docs/content/svc-welcome/cloud-services.html). To check which service instances you have, select Administration > Services > Service instances from the main menu. You can filter which services you see by resource group, organization, and region. To create a service: 1. Log in to IBM watsonx. 2. Select Administration > Services > Services catalog from the main menu. 3. Click the service you want to create. 4. Specify the IBM Cloud service region. 5. Select a plan. 6. If necessary, select the resource group or organization. 7. Click Create. Managing services To manage a service: 1. Select Administration > Services > Services instances from the main menu. 2. Click the Action menu next to the service name and select Manage in IBM Cloud. The service page in IBM Cloud opens in a separate browser tab. 3. To change pricing plans, select Plan and choose the desired plan. Learn more * [Associate a service with a project](https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/assoc-services.html) * [Managing the platform](https://dataplatform.cloud.ibm.com/docs/content/wsj/console/wdp_admin_console.html) Parent topic:[IBM Cloud services](https://dataplatform.cloud.ibm.com/docs/content/svc-welcome/cloud-services.html)
SQL optimization (SPSS Modeler)
How does SQL pushback work? The initial fragments of a flow leading from the data import nodes are the main targets for SQL generation. When a node is encountered that can't be compiled to SQL, the data is extracted from the database and subsequent processing is performed. During flow preparation and prior to running, the SQL generation process happens as follows: * The software reorders flows to move downstream nodes into the “SQL zone” where it can be proven safe to do so. * Working from the import nodes toward the terminal nodes, SQL expressions are constructed incrementally. This phase stops when a node is encountered that can't be converted to SQL or when the terminal node (for example, a Table node or a Graph node) is converted to SQL. At the end of this phase, each node is labeled with an SQL statement if the node and its predecessors have an SQL equivalent. * Working from the nodes with the most complicated SQL equivalents back toward the import nodes, the SQL is checked for validity. The SQL that was successfully validated is chosen for execution. * Nodes for which all operations have generated SQL are highlighted with a SQL icon next to the node on the flow canvas. Based on the results, you may want to further reorganize your flow where appropriate to take full advantage of database execution.
Automated modeling for a flag target (SPSS Modeler)
Automated modeling for a flag target With the Auto Classifier node, you can automatically create and compare a number of different models for either flag (such as whether or not a given customer is likely to default on a loan or respond to a particular offer) or nominal (set) targets.
Exporting synthetic data
Exporting synthetic data Using Synthetic Data Generator, you can export synthetic data to remote data sources using connections or write data to a project (Delimited or SAV). Double-click the node to open its properties. Various options are available, described as follows. After running the node, you can find the data at the export location you specified. Exporting to a project Under Export to, select This project and then select the project path. For File type, select either Delimited or SAV. Exporting to a connection Under Export to, select Save to a connection to open the Asset Browser and then select the connection to export to. For a list of supported data sources, see [Creating synthetic data from imported data](https://dataplatform.cloud.ibm.com/docs/content/wsj/synthetic/import_data_sd.html). Setting the field delimiter, quote character, and decimal symbol Different countries use different symbols to separate the integer part from the fractional part of a number and to separate fields in data. For example, you might use a comma instead of a period to separate the integer part from the fractional part of numbers. And, rather than using commas to separate fields in your data, you might use colons or tabs. With a Data Asset import or export node, you can specify these symbols and other options. Double-click the node to open its properties and specify data formats as desired. ![Export data field delimiters](https://dataplatform.cloud.ibm.com/docs/content/wsj/synthetic/images/sd-export-data-field-delimiters.png)