Training and testing

Another useful function in the SPSS modeler flow is the ability to easily divide data into training and testing sets. This can be accomplished using the Partition node. To train, test, and validate the stages of model building, the Partition nodes are used to produce a partition field that splits the data into separate subsets or samples.

Using a sample to generate the model and a separate sample to test it will get you a good hint of how well the model will generalize to larger datasets that are corresponding to the current data:

If we add a Partition node to our flow, open it and adjust the settings as shown in the preceding screenshot, we are instructing the modeler to add a new field (PartionMyData) to our data, which will designate the record split (based upon 75/25). To see the results of this node, we can add a Table node to the flow and provide the following settings:

The preceding screenshot indicates that we want to query our data and generate a table based upon the values in our derived field that are equal to 1_Training; in other words, all of the records that the Partition node has designated as members of our training data. Our flow now looks as follows:

Running the flow now generates the following table:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset