The Logistic Regression block enables you to apply a logistic regression predictive model to a dataset.
The following demonstrates how to use the Logistic Regression block to create a logistic regression model for an input dataset ExamResults.csv (which contains observations that describe a range of test scores from a schoo) that predicts the likelihood of a student passing an exam based on their hours of study.
- Import the ExamResults.csv dataset onto a Workflow canvas using the Text File Import block.
- Expand the Model Training group in the Workflow palette, then click and drag a Logistic Regression block onto the Workflow canvas.
- Click the Output port of the ExamResults dataset block and drag a connection towards the Input port of the Logistic Regression block.
- Double-click the Logistic Regression block to display the Configure Logistic Regression dialog box.
- In the Logistic Regression dialog box:
- In the Dependent variable drop-down list, select Pass?.
- From the Event drop-down list, select 1 (one).
- In the Unselected Effect Variables list, select HoursStudy.
- Click Select to move the variable to the Selected Effect Variables list.
- Clear the Class checkbox for the variable.
- Click OK to save the configuration and close the Configure Logistic Regression dialog box.
A green execution status is displayed in the Output ports of the Logistic Regression block and the new Logistic Regression Model. The Logistic Regression block output can be used with a Score block to make predictions on a dataset.