1. Home
  2. Sample Projects
  3. Detecting Breast Cancer

Detecting Breast Cancer

◷ Reading Time: 5 minutes

The example is about detecting breast cancer with a custom made algorithm using the PMML capability in FlexRule. In the end, the system will be able to determine the probability of breast cancer.

We have created a PMML file of a trained model using Python and connected that to make predictions. These predictions can be used as a part of a DRD to make decisions.

You can use Python, R or any other language to create the PMML file of your model.

The data model was trained using a dataset similar to the following.

Sample Data Set
PMML File

The flow has only two steps.

  • Input data
  • Predict

Run the project

1. Open the file, DRD.xml.

2. Click on “Logic Run Template”.

3. Select the Logic Run Template and click “Debug”.

You will see the loaded sample input data in the Parameters window

4. Click on “Next Step”

Project execution will be successful

The results will be shown under the Parameters window.
– PredictedValue – 1, if a cancer is detected, 0, otherwise
– Probabilities are also shown for each possible outcome

Steps to create the project

1. Create a new FlexRule project.

2. Install Analytics extension from the Extension Manager.

Tools --> Extensions Manager

3. Rename the PMML file extension to XML

4. Import the PMML file from the following:

Machine Learning --> PMML

Once the file is imported, the Fact Concept file will be created. You can provide a custom name for the Fact.

In Project Explorer, you can see both the PMML file and its Fact Concept file.

5. Create a DRD file.

6. Add an Input Node and edit its properties.

Properties

  • Name: Name of the input object
  • Assembly: Fact Concept file (Select from the drop-down menu)
  • Type: Fact name (Select from the window)

7. Add an output variable to copy the final prediction result.

8. Add a Decision node and edit its properties.

Properties

  • Copy Value To: Name of the variable we created in the previous step to copy the final prediction result
  • Uri: Path to the imported PMML file
  • Parameters: Add the input parameter name in the above step 6

9. Connect the two nodes.

Download Sample Project

The sample project can be downloaded using the attachment at the end of the page.

Updated on January 18, 2023

Article Attachments

Was this article helpful?

Related Articles