Adding New Modules To Jython Scripting In IBM SPSS Modeler

IBM SPSS Modeler supports Python scripting using Jython, a Java[tm] implementation of the Python language. Modeler versions 16 and 17 use Jython 2.5.1 which includes a number of useful and popular modules. However, many other modules are available and customers often want to use their own so a frequent question is how to include them. There are two approaches: Copy the module to the “site-packages” folder under modeler-installation/lib/jython/Lib. This has the advantage of making modules available to anybody who uses that Modeler installation but usually requires someone with a level of administrative privileges to update the Modeler installation. Define a JYTHONPATH environment variable and […]

Using the find all() Function to search for nodes

Most SPSS Modeler scripts include code that locates an existing node e.g.: stream = typenode = stream.findByType(“type”, None) However, some scripts need to search for all nodes – maybe by node type but also matching some other criteria. The Modeler scripting API documentation (PDF) mentions a findAll() function: d.findAll(filter, recursive): Collection filter (NodeFilter) : the node filter recursive (boolean) : if True then composite nodes should be recursively searched Returns a collection of all nodes accepted by the specified filter. If the recursive flag is True then any SuperNodes within this diagram are also searched. Unfortunately, the NodeFilter definition is not specified. NodeFilter is a base class […]

How alternative interfaces can help you get more out of R

Contemporary analytical platforms like SPSS and SAS represent the some of the earliest and yet longest-lived examples of proprietary software in the industry. When we think of the tectonic shifts the technology landscape has witnessed in last four decades, through the mainframe era, the rise of the PC, browser wars, the dotcom bubble, the smartphone revolution to the age of the cloud and big data not to mention the number of once seemingly ubiquitous software tools that no longer dominate the marketplace, it’s incredible to think that the first versions of SPSS and SAS were developed as far back as […]

Why R can be hard to learn

Many of the analysts we speak to are being pushed over to R, primarily because it’s open source and therefore a free alternative to commercial data analytics packages for which the costs can sometimes run into tens of thousands of pounds (or more). However, even experienced analysts often find that getting to grips with R can be a difficult business. Many people view R as being notoriously difficult to learn. There are a number of reasons why this is the case. Lack of consistency In some ways the open source nature of R is its biggest weakness as well as […]

Supernode scripting in SPSS Modeler

This post describes how to use Python scripts to create and modify Modeler supernodes, and control the execution of the nodes within the supernode. If you’re after a basic overview of Python scripting in Modeler then this post may be of interest, and I’ve also written about how to write standalone Python scripts in Modeler here. As streams get larger and more complex, many users take advantage of supernodes in order to keep the structure of the stream understandable and maintainable. For example, a stream may contain multiple nodes for computing a summary of recent transactions (e.g. number of transactions over the […]

Writing a standalone Python script for Modeler

In my last post I gave a brief overview of the new Python-based scripting available in Modeler 16. In this post, I will cover Modeler 16 scripting in a little more detail. This assumes some familiarity with Python such as the Python module mechanism and exception handling. There are three types of script in Modeler: A stream script – this is the most common type of script and controls execution within a single stream A standalone or session script that can manage multiple streams A supernode script that manages the contents of the nodes within a supernode You may recall […]

An overview of Python scripting in Modeler 16

Modeler scripts are used to automate the creation of streams, construction and configuration of nodes, stream execution and managing the execution results such as saving models to file or a content repository. A major new feature in Modeler 16 is the introduction of Python as the default scripting language. Python replaces the original bespoke language Modeler has had for over 15 years. Although existing legacy scripts will continue to work in Modeler 16, moving to Python offers a number of advantages: It is popular language making it easier to find staff with relevant experience or training to improve existing skills It […]