# Nomological Deductive Reasoning for Trustworthy, Human-Readable, and Actionable AI Outputs
## 5 Nomological Deductive Reasoning (NDR): A Proposed Solution
### Ontology Design
#### 5.3.3 Experimental Results  
To assess the effectiveness of the proposed Nomological Deductive Reasoning (NDR) framework, we conducted a series of experiments using the Statlog (German Credit Data) dataset [33]. Our evaluation focused on three key dimensions: predictive performance, quality of the rule-based explanations, and alignment with the domain-specific knowledge encoded in the Knowledge Base (KB). ```
1:Input: I (input data), KB (Knowledge Base), M (Model), F (Feature Extraction function), R (Reasoning function), E (Explanation Generation function)
2:Output: Explanation \(\mathbf{E_{i}}\) for each prediction \(\mathbf{h_{i}}\in\hat{y}\) set of predictions
3:Step 1: Preprocess the input data
4:\(I^{\prime}\leftarrow\) Preprocess(\(I\)) (Clean and format input data)
5:Step 2: Model prediction \(\sim\) Extract features from the preprocessed input
6:\(F\leftarrow\) ExtractFeatures (\(I^{\prime}\)) [Feature extraction using ML model]
7:Step 3: Retrieve relevant laws from the Knowledge Base
8:\(L\leftarrow\) GetLaws(\(KB\)) [Retrieve laws from Knowledge Base]
9:Step 4: Retrieve the conditions or antecedents for the relevant laws
10:\(C\leftarrow\) GetConditions(\(KB\)) [Retrieve conditions that must hold true for laws]
11:Step 5: Perform reasoning based on the extracted features and laws
12:\(C^{\prime}\leftarrow\) Reason(\(F\), \(L\), C) [Reason using features, laws and conditions]
13:Step 6: Perform prediction based on reasoning and extracted features
14:\(\hat{y}\leftarrow\) Predict(\(M\), \(C^{\prime}\)) [Model prediction based on reasoning output and features]
15:Step 7: Generate the explanation based on reasoning, features, and prediction
16:\(\mathbf{E_{i}}\leftarrow\) E(\(I^{\prime}\), \(C^{\prime}\), \(I^{\prime}\), \(\hat{y}\)) {Explanation generation based on laws, conditions, data, and prediction}
17:Step 8: Output the generated explanation
18: Return \(E_{i}\)
```  
**Algorithm 1**NDR Framework: SP Algorithm with Formal Inference  
The NDR-augmented model achieved a high prediction accuracy of 97%, correctly classifying individuals as either \"Good Credit\" or \"Bad Credit\". This demonstrates strong statistical performance on the credit-risk classification task. Rule-Based Explanation Generation  
For each prediction, the NDR framework applied relevant rules from the KB to generate structured explanations. These explanations link individual feature values to domain-specific rules grounded in banking regulations, ensuring that decisions are causally interpretable and auditable. Example (see Figure 9):  
* **Prediction Case 1**: \"Good Credit\"
* **Explanation**: \"The model predicts a 'Good credit' because based on banking laws, the applicant has a stable family or marital status, which is positive for creditworthiness; manageable installment rates, which indicate financial stability; and the loan duration is for more than 12 months, which indicates a positive sign of credit\". * **Model Reasoning**: (i) _Personal Status_: Stable marital/family status \(\rightarrow\) positively influences creditworthiness, (ii) _Installment Rate:_ Manageable installment amount \(\rightarrow\) indicates financial responsibility, and (iii) _Duration:_ Loan duration > 12 months \(\rightarrow\) considered favorable under domain rules. * **Prediction Case 2**: \"Bad Credit\". * **Explanation**: \"The model predicts a bad credit because based on banking laws, the person has multiple financial obligations which increases financial risk, and the credit purpose is considered risky, contributing to a negative credit prediction\". * **Model Reasoning**: (i) _Other Debtors:_ Multiple financial obligations \(\rightarrow\) higher perceived risk and (ii) _Purpose:_ Loan purpose considered high-risk \(\rightarrow\) contributes to a negative classification. ```
```
[5 rowsx25 columns] Accuracy:0.97 Explanationsforthefirstfewpredictions: Prediction:GoodCredit Explanation: Themodelpredictsa**GoodCredit** because,basedon**bankinglaws**, -Personalstatus:Stablefamilyor maritalstatus,whichispositiveforcreditworthiness.