@frontlinesystems/rason-mcp-server 2026.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +282 -0
  3. package/examples/EXAMPLES_REFERENCE.md +128 -0
  4. package/examples/Optimization/Conic/AirlineHubConic.json +112 -0
  5. package/examples/Optimization/Conic/AirlineHubConic2.json +109 -0
  6. package/examples/Optimization/Conic/AirlineHubConic3.json +112 -0
  7. package/examples/Optimization/Conic/AirlineHubConic4.json +100 -0
  8. package/examples/Optimization/Conic/AirlineHubConic5.json +102 -0
  9. package/examples/Optimization/DataBinding/ProductMixCsv.json +82 -0
  10. package/examples/Optimization/DataBinding/ProductMixCsv4.json +96 -0
  11. package/examples/Optimization/DataBinding/ProductMixExcel.json +74 -0
  12. package/examples/Optimization/DataBinding/ProductMixExcel1.json +87 -0
  13. package/examples/Optimization/DataBinding/ProductMixExcel11.json +109 -0
  14. package/examples/Optimization/DataBinding/ProductMixExcel2.json +78 -0
  15. package/examples/Optimization/DataBinding/ProductMixTab.json +90 -0
  16. package/examples/Optimization/DataBinding/ProductMixTab1.json +74 -0
  17. package/examples/Optimization/DataBinding/ProductMixTab2.json +78 -0
  18. package/examples/Optimization/Linear/Inventory.json +200 -0
  19. package/examples/Optimization/Linear/Matop.json +120 -0
  20. package/examples/Optimization/Linear/ProductMix.json +98 -0
  21. package/examples/Optimization/Linear/ProductMix2.json +73 -0
  22. package/examples/Optimization/Linear/ProductMix3.json +50 -0
  23. package/examples/Optimization/Linear/ProductMix4.json +57 -0
  24. package/examples/Optimization/Linear/ProductMixCsv1.json +106 -0
  25. package/examples/Optimization/Linear/ProductMixCsv2.json +106 -0
  26. package/examples/Optimization/Linear/ProductMixSQL11.json +82 -0
  27. package/examples/Optimization/Linear/Rowop.json +127 -0
  28. package/examples/Optimization/NonLinear/AirlineHub.json +64 -0
  29. package/examples/Optimization/NonLinear/AirlineHub2.json +48 -0
  30. package/examples/Optimization/NonLinear/AirlineHub3.json +48 -0
  31. package/examples/Optimization/NonSmooth/Inventory2.json +160 -0
  32. package/examples/Optimization/Quadratic/PortfolioOpt.json +56 -0
  33. package/examples/Optimization/Quadratic/PortfolioOpt2.json +66 -0
  34. package/examples/Optimization/WithUncertainty/GasCompanyChance.json +79 -0
  35. package/examples/Optimization/WithUncertainty/GasCompanyRecourse.json +79 -0
  36. package/examples/Optimization/WithUncertainty/ProjectSelect.json +78 -0
  37. package/examples/Optimization/WithUncertainty/ProjectSelect2.json +82 -0
  38. package/examples/Optimization/WithUncertainty/ProjectSelect3.json +85 -0
  39. package/examples/Optimization/WithUncertainty/ProjectSelect4.json +75 -0
  40. package/examples/Simulation/CandyStoreSalesUsingSIP.json +148 -0
  41. package/examples/Simulation/CollegeFundGrowth1.json +424 -0
  42. package/examples/Simulation/CollegeFundGrowth1SIPModel.json +28 -0
  43. package/examples/Simulation/CollegeFundGrowth2.json +416 -0
  44. package/examples/Simulation/CollegeFundGrowthSIP.json +402 -0
  45. package/examples/Simulation/GBMSimulationModel.json +237 -0
  46. package/examples/Simulation/YieldManagement(Sim).json +70 -0
  47. package/examples/Simulation/YieldManagement2(Sim).json +73 -0
  48. package/examples/calculation/DMNExamples/DMN Box Fun with typeDef result.json +54 -0
  49. package/examples/calculation/DMNExamples/DMN Context example.json +69 -0
  50. package/examples/calculation/DMNExamples/DMN DT with typeDef result.json +43 -0
  51. package/examples/calculation/DMNExamples/FEEL Date Time example.json +28 -0
  52. package/examples/calculation/DMNExamples/FEEL For iteration example.json +66 -0
  53. package/examples/calculation/DMNExamples/FEEL For with two indices.json +16 -0
  54. package/examples/calculation/DMNExamples/FEEL For with typeDef result.json +88 -0
  55. package/examples/calculation/DMNExamples/FEEL If Then Else example.json +26 -0
  56. package/examples/calculation/DMNExamples/FEEL List example.json +38 -0
  57. package/examples/calculation/DMNExamples/FEEL List operator.json +17 -0
  58. package/examples/calculation/DMNExamples/FEEL List with typeDef collection.json +37 -0
  59. package/examples/calculation/DMNExamples/FEEL Some or Every example.json +66 -0
  60. package/examples/calculation/DecisionTables/DT Datasource example.json +53 -0
  61. package/examples/calculation/DecisionTables/DT Date and Time examples.json +92 -0
  62. package/examples/calculation/DecisionTables/DT Expression example.json +32 -0
  63. package/examples/calculation/DecisionTables/DT Hit Policy examples.json +137 -0
  64. package/examples/calculation/DecisionTables/DT Loan Recommend model.json +82 -0
  65. package/examples/calculation/DecisionTables/DT Loan Strategy Model and Predictive CSV-XML.json +219 -0
  66. package/examples/calculation/DecisionTables/DT Loan Strategy model and Datasource.json +286 -0
  67. package/examples/calculation/DecisionTables/DT Loan Strategy model and Predictive.json +204 -0
  68. package/examples/calculation/DecisionTables/DT Loan Strategy model by scratch.json +214 -0
  69. package/examples/calculation/DecisionTables/DT Output Order example.json +40 -0
  70. package/examples/calculation/DecisionTables/DT Unique example.json +39 -0
  71. package/examples/calculation/TypeDefinitions/TypeDefCF.json +65 -0
  72. package/examples/calculation/TypeDefinitions/TypeDefDT.json +58 -0
  73. package/examples/datamining/AffinityAnalysis/AssociationRules.json +52 -0
  74. package/examples/datamining/Classification/DecisionTree.json +91 -0
  75. package/examples/datamining/Classification/DiscriminantAnalysis.json +82 -0
  76. package/examples/datamining/Classification/Ensembles/Bagging.json +67 -0
  77. package/examples/datamining/Classification/Ensembles/Boosting.json +68 -0
  78. package/examples/datamining/Classification/Ensembles/RandomTrees.json +92 -0
  79. package/examples/datamining/Classification/FindBestModel.json +87 -0
  80. package/examples/datamining/Classification/LogisticRegression.json +83 -0
  81. package/examples/datamining/Classification/NaiveBayes.json +79 -0
  82. package/examples/datamining/Classification/NearestNeighbors.json +85 -0
  83. package/examples/datamining/Classification/NeuralNetwork.json +93 -0
  84. package/examples/datamining/Clustering/Hierarchical.json +55 -0
  85. package/examples/datamining/Clustering/KMeans.json +72 -0
  86. package/examples/datamining/DataSources/DelimitedFile.json +50 -0
  87. package/examples/datamining/DataSources/JSONFile.json +50 -0
  88. package/examples/datamining/DataSources/MSAccessDatabase.json +50 -0
  89. package/examples/datamining/DataSources/MSExcelTable.json +51 -0
  90. package/examples/datamining/DataSources/MSSQLDatabase.json +50 -0
  91. package/examples/datamining/DataSources/ODATATable.json +50 -0
  92. package/examples/datamining/DataSources/ODBCDatabase.json +50 -0
  93. package/examples/datamining/FeatureSelection/LinearWrapping.json +54 -0
  94. package/examples/datamining/FeatureSelection/LogisticWrapping.json +57 -0
  95. package/examples/datamining/FeatureSelection/Univariate.json +79 -0
  96. package/examples/datamining/Regression/DecisionTree.json +82 -0
  97. package/examples/datamining/Regression/Ensembles/Bagging.json +63 -0
  98. package/examples/datamining/Regression/Ensembles/Boosting.json +63 -0
  99. package/examples/datamining/Regression/Ensembles/RandomTrees.json +79 -0
  100. package/examples/datamining/Regression/FindBestModel.json +87 -0
  101. package/examples/datamining/Regression/LinearRegression.json +125 -0
  102. package/examples/datamining/Regression/NearestNeighbors.json +78 -0
  103. package/examples/datamining/Regression/NeuralNetwork.json +83 -0
  104. package/examples/datamining/Scoring/JSONClassifier.json +63 -0
  105. package/examples/datamining/Scoring/JSONClassifierNN.json +63 -0
  106. package/examples/datamining/Scoring/JSONClusterizer.json +38 -0
  107. package/examples/datamining/Scoring/JSONForecaster.json +50 -0
  108. package/examples/datamining/Scoring/JSONLinearRegression.json +57 -0
  109. package/examples/datamining/Scoring/JSONPCA.json +42 -0
  110. package/examples/datamining/Scoring/JSONRegressor.json +57 -0
  111. package/examples/datamining/Scoring/JSONTransformer.json +39 -0
  112. package/examples/datamining/Scoring/PMMLClassifier.json +43 -0
  113. package/examples/datamining/Scoring/PMMLForecaster.json +44 -0
  114. package/examples/datamining/Scoring/PMMLRegressor.json +39 -0
  115. package/examples/datamining/Scoring/PMMLTransformer.json +39 -0
  116. package/examples/datamining/Simulation/LinearRegressionSimulation.json +118 -0
  117. package/examples/datamining/Simulation/SyntheticDataGeneration.json +109 -0
  118. package/examples/datamining/Simulation/pmml-risk-scoring.json +63 -0
  119. package/examples/datamining/Summarizer/Summarization.json +55 -0
  120. package/examples/datamining/TextMining/LatentSemanticAnalysis.json +52 -0
  121. package/examples/datamining/TextMining/TfIdf-FileData.json +66 -0
  122. package/examples/datamining/TextMining/TfIdf-InlineData.json +56 -0
  123. package/examples/datamining/TimeSeries/AddHoltWinters.json +80 -0
  124. package/examples/datamining/TimeSeries/Arima.json +75 -0
  125. package/examples/datamining/TimeSeries/DoubleExponential.json +66 -0
  126. package/examples/datamining/TimeSeries/Exponential.json +65 -0
  127. package/examples/datamining/TimeSeries/LagAnalysis.json +49 -0
  128. package/examples/datamining/TimeSeries/MovingAverage.json +66 -0
  129. package/examples/datamining/TimeSeries/MulHoltWinters.json +66 -0
  130. package/examples/datamining/TimeSeries/NoTrendHoltWinters.json +66 -0
  131. package/examples/datamining/Transformation/Binning.json +70 -0
  132. package/examples/datamining/Transformation/CanonicalVariateAnalysis.json +48 -0
  133. package/examples/datamining/Transformation/CategoryReduction.json +52 -0
  134. package/examples/datamining/Transformation/Factorization.json +51 -0
  135. package/examples/datamining/Transformation/MissingDataHandling.json +84 -0
  136. package/examples/datamining/Transformation/OneHotEncoding-DataInline.json +55 -0
  137. package/examples/datamining/Transformation/OneHotEncoding-DatainFile.json +49 -0
  138. package/examples/datamining/Transformation/PartitionTimeSeries.json +49 -0
  139. package/examples/datamining/Transformation/Partitioning-DF.json +73 -0
  140. package/examples/datamining/Transformation/Partitioning.json +47 -0
  141. package/examples/datamining/Transformation/PartitioningWithOversampling-DF.json +66 -0
  142. package/examples/datamining/Transformation/PartitioningWithOversampling.json +45 -0
  143. package/examples/datamining/Transformation/PrincipalComponentsAnalysis.json +53 -0
  144. package/examples/datamining/Transformation/Rescaling.json +68 -0
  145. package/examples/datamining/Transformation/Sampling.json +44 -0
  146. package/examples/datamining/Transformation/StratifiedSampling.json +47 -0
  147. package/examples/flow/SQLServerTransform.json +261 -0
  148. package/examples/flow/dm-calc-pipeline.json +278 -0
  149. package/examples/flow/dm-pipeline-simulation.json +114 -0
  150. package/examples/flow/opt-sim-pipeline.json +160 -0
  151. package/examples/flow/sim-dm-pipeline.json +107 -0
  152. package/examples/flow/sim-sim-pipeline.json +137 -0
  153. package/examples/index.json +4679 -0
  154. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/DataFiltering/ListwithFilter.json +53 -0
  155. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/ProductMix5.json +58 -0
  156. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/compoundWhileStatement.json +36 -0
  157. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/ifThenElseStatement.json +34 -0
  158. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/nestedLoop.json +26 -0
  159. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/ParallelArray.json +48 -0
  160. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/indexedArray.json +70 -0
  161. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/nonParallelArray.json +50 -0
  162. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/sumAggregateExample.json +338 -0
  163. package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/tsp.json +62 -0
  164. package/examples/rason-features/BoxIterators/Box_Fun_Loop_Iter_Sim_RASON.json +191 -0
  165. package/examples/rason-features/BoxIterators/Box_Fun_Loop_Sim_RASON.json +76 -0
  166. package/examples/rason-features/BoxIterators/Box_Fun_Sim_RASON.json +109 -0
  167. package/examples/rason-features/BoxIterators/Box_Iter_SIM_RASON.json +69 -0
  168. package/examples/rason-features/BoxIterators/Box_Iterator_Calc_Loop.json +183 -0
  169. package/examples/rason-features/BoxIterators/Box_Iterator_with_typeDef_partial.json +79 -0
  170. package/examples/rason-features/BoxLambdaExamples/BoxFunOptimize.json +155 -0
  171. package/examples/rason-features/BoxLambdaExamples/BoxFunSimulate.json +119 -0
  172. package/examples/rason-features/BoxLambdaExamples/LambdaFunOptimize.json +143 -0
  173. package/examples/rason-features/BoxLambdaExamples/LambdaFunSimulate.json +82 -0
  174. package/examples/rason-features/ReferenceGuide/RGFirehouseLocation.json +69 -0
  175. package/examples/rason-features/ReferenceGuide/RGFirehouseLocationConic.json +114 -0
  176. package/examples/rason-features/ReferenceGuide/RGProductMixCsv1.json +108 -0
  177. package/examples/rason-features/ReferenceGuide/RGProductMixExcel11.json +117 -0
  178. package/examples/rason-features/ReferenceGuide/RGProductMixSQL11.json +108 -0
  179. package/examples/rason-features/UserGuide/UGAirlineHubCSV.json +67 -0
  180. package/examples/rason-features/UserGuide/UGForecast.json +51 -0
  181. package/examples/rason-features/UserGuide/UGProductMix1.json +49 -0
  182. package/examples/rason-features/UserGuide/UGProductMix2.json +49 -0
  183. package/examples/rason-features/UserGuide/UGProductMixTab1.json +68 -0
  184. package/examples/rason-features/UserGuide/UGProductMixTab2.json +77 -0
  185. package/examples/rason-features/UserGuide/UGProductMixTab3.json +67 -0
  186. package/examples/rason-features/UserGuide/UGProductMixTab4.json +71 -0
  187. package/examples/rason-features/UserGuide/UGProductMixTab5.json +68 -0
  188. package/examples/rason-features/UserGuide/UGProjectSelect0.json +92 -0
  189. package/examples/rason-features/UserGuide/UGProjectSelect1.json +75 -0
  190. package/examples/rason-features/UserGuide/UGProjectSelect2.json +75 -0
  191. package/examples/rason-features/UserGuide/UGYieldManagement1.json +62 -0
  192. package/examples/rason-features/UserGuide/UGYieldManagement2.json +62 -0
  193. package/examples/rason-features/UserGuide/UGYieldManagement3.json +64 -0
  194. package/out/index.cjs +361 -0
  195. package/package.json +76 -0
@@ -0,0 +1,204 @@
1
+ {
2
+ "modelName": "DTLoanStrategyPredictive",
3
+ "modelDescription": "RASON Decision Table Example: Loan Strategy using a PMML predictive model inline: The difference between this example and the original DTLoanStrategy example is that this example expands on the DT Loan Strategy Model by adding an element to the formula, appRiskScore. The formula for appRiskScore returns the minimum of 2 outputs. The first output is produced from a linear regression model scoring new data contained in predictiveInput (within the data section). The second output is from the decision table, tblAppRiskScore, given the inputs: custAge (40), maritalStatus (single) and employmentStatus (selfemployed).",
4
+ "modelType": "calculation",
5
+ "decisionTables": {
6
+ "comment": "There are 8 decision tables in the decisionTables section. Outputs from some tables will be used as inputs for other tables.",
7
+ "tblAppRiskScore": {
8
+ "comment": "This decision table accepts 3 inputs, customer age, marital status and employment status, and returns a partial risk score. The collection of results will be added together to create the partial score. Note that the inputValues property limits the age to be 18 to 120, inclusive, the marital status to be s for single or m for married, the employment status as unemployed, employed, selfEmployed or student. A 40 yo single self employed person would be assigned a partialScore = 43 (rule 4) + 25 (rule 6) + 45 (rule 10) = 113.",
9
+ "inputs": [ "cust age", "marital status", "employment status" ],
10
+ "outputs": [ "partial score" ],
11
+ "refTypes": [ "", "", "", "" ],
12
+ "inputValues": [
13
+ [ "[18..120]", "s", "unemployed" ],
14
+ [ "", "m", "employed" ],
15
+ [ "", "", "selfemployed" ],
16
+ [ "", "", "student" ]
17
+ ],
18
+ "rules": [
19
+ [ "[18..21]", "-", "-", 32 ],
20
+ [ "(21..25]", "-", "-", 35 ],
21
+ [ "(25..35]", "-", "-", 40 ],
22
+ [ "(35..49]", "-", "-", 43 ],
23
+ [ ">49", "-", "-", 48 ],
24
+ [ "-", "s", "-", 25 ],
25
+ [ "-", "m", "-", 45 ],
26
+ [ "-", "-", "unemployed", 15 ],
27
+ [ "-", "-", "student", 18 ],
28
+ [ "-", "-", "employed", 45 ],
29
+ [ "-", "-", "selfemployed", 36 ]
30
+ ],
31
+ "hitPolicy": "C+"
32
+ },
33
+ "tblBureauRiskCat": {
34
+ "comment": "This decision table accepts 2 inputs, custExist (true if customer already has at least 1 more loans) and appRiskScore (partial score from tblAppRiskScore). With a hit policy of 'unique', only 1 rule, with a unique result, may be returned. ",
35
+ "inputs": [ "cust exist", "app risk score" ],
36
+ "outputs": [ "bureau risk cat" ],
37
+ "inputTypes": [ "", "" ],
38
+ "outputTypes": [ "" ],
39
+ "rules": [
40
+ [ false, "<100", "high" ],
41
+ [ false, "[100..120]", "medium" ],
42
+ [ false, "[120..130]", "low" ],
43
+ [ false, ">130", "veryLow" ],
44
+ [ true, "<80", "decline" ],
45
+ [ true, "[80..90]", "high" ],
46
+ [ true, "[90..110]", "medium" ],
47
+ [ true, ">110", "low" ]
48
+ ],
49
+ "hitPolicy": "U"
50
+ },
51
+ "tblBureauCallType": {
52
+ "comment": "This decision table accepts 1 input, bureauRiskCat, which is the output of the tblBureauRiskCat decision table.",
53
+ "inputs": [ "bureau risk cat" ],
54
+ "outputs": [ "bureau call type" ],
55
+ "rules": [
56
+ [ "high, medium", "full" ],
57
+ [ "low", "mini" ],
58
+ [ "veryLow, decline", "none" ]
59
+ ],
60
+ "hitPolicy": "U"
61
+ },
62
+ "tblEligibility": {
63
+ "comment": "This decision table accepts 3 inputs, bureauRiskCat (which is the output of the tblAppriskScore decision table), and the customer's age. The customer's eligibility will be returned in the result. Note that there are only two outputs: 'ineligible' or 'eligible' as given in the outputValues property.",
64
+ "inputs": [ "bureau risk cat", "bureau afford", "cust age" ],
65
+ "outputs": [ "eligibility" ],
66
+ "refTypes": [ "", "", "", "" ],
67
+ "outputValues": [ "ineligible", "eligible" ],
68
+ "rules": [
69
+ [ "decline", "-", "-", "ineligible" ],
70
+ [ "-", false, "-", "ineligible" ],
71
+ [ "-", "-", "<18", "ineligible" ],
72
+ [ "-", "-", "-", "eligible" ]
73
+ ],
74
+ "hitPolicy": "P"
75
+ },
76
+ "tblStrategy": {
77
+ "comment": "This decision table accepts 2 inputs, eligibility and bureauCallType. The strategy will be returned in the result.",
78
+ "inputs": [ "eligibility", "bureau call type" ],
79
+ "outputs": [ "strategy" ],
80
+ "rules": [
81
+ [ "ineligible", "-", "decline" ],
82
+ [ "eligible", "full, mini", "bureau" ],
83
+ [ "eligible", "none", "through" ]
84
+ ],
85
+ "hitPolicy": "U"
86
+ },
87
+ "tblCreditContFactor": {
88
+ "comment": "This decision table accepts 1 input, bureauRiskCat, and returns the creditContFactor.",
89
+ "inputs": [ "bureau risk cat" ],
90
+ "outputs": [ "credit cont factor" ],
91
+ "rules": [
92
+ [ "high, decline", 0.6 ],
93
+ [ "medium", 0.7 ],
94
+ [ "low, veryLow", 0.8 ]
95
+ ],
96
+ "hitPolicy": "U"
97
+ }
98
+ },
99
+ "data": {
100
+ "comment": "The datasection contains the input parameters to the model, i.e. all input parameters are constants. This includes the predictive model, PredictivePMMLModel.",
101
+ "PredictivePMMLModel": {
102
+ "value": [ "<?xml version='1.0' encoding='utf-8'?>", "<PMML version='4.2' xsi:schemaLocation='http://www.dmg.org/PMML-4_2 http://www.dmg.org/v4-2/pmml-4-2.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.dmg.org/PMML-4_2'>", "<Header copyright='Copyright (c) 2021 Frontline Systems Inc.' description='RegressionModel'>", "<Application name='XLMinerSDK' version='21.0.0.0'/>", "<Timestamp>2019-1-12 21:32:7</Timestamp>", "</Header>", "<DataDictionary numberOfFields='5'>", "<DataField optype='continuous' dataType='double' name='X1'/>", "<DataField optype='continuous' dataType='double' name='X2'/>", "<DataField optype='continuous' dataType='double' name='X3'/>", "<DataField optype='continuous' dataType='double' name='X4'/>", "<DataField optype='continuous' dataType='double' name='Score'/>", "</DataDictionary>", "<RegressionModel modelName='RegressionModel' functionName='regression' algorithmName='LinearRegression'>", "<MiningSchema>", "<MiningField name='Score' usageType='predicted'/>", "<MiningField name='X1' usageType='active'/>", "<MiningField name='X2' usageType='active'/>", "<MiningField name='X3' usageType='active'/>", "<MiningField name='X4' usageType='active'/>", "</MiningSchema>", "<Output>", "<OutputField optype='continuous' dataType='double' name='Predicted_Score' feature='predictedValue'/>", "</Output>", "<LocalTransformations/>", "<RegressionTable intercept='0'>", "<NumericPredictor name='X1' exponent='1' coefficient='-2.3617607737378745'/>", "<NumericPredictor name='X2' exponent='1' coefficient='1.4606586382766593'/>", "<NumericPredictor name='X3' exponent='1' coefficient='-1.0552806547103726'/>", "<NumericPredictor name='X4' exponent='1' coefficient='0.090913941664884437'/>", "</RegressionTable>", "</RegressionModel>", "</PMML>" ]
103
+ },
104
+ "PredictiveInput": {
105
+ "comment": "The data array, PredictveInput, contains the new data which will be scored by the predictive model, predictivePMMLModel (above). ",
106
+ "value": [
107
+ [ "X1", "X2", "X3", "X4" ],
108
+ [ 7, 26, 6, 60 ]
109
+ ]
110
+ },
111
+ "custAge": {
112
+ "value": 40,
113
+ "comment": "Age of the prospective customer."
114
+ },
115
+ "maritalStatus": {
116
+ "value": "s",
117
+ "comment": "maritalst"
118
+ },
119
+ "employmentStatus": {
120
+ "value": "selfemployed",
121
+ "comment": "Employment Status for the prospective customer."
122
+ },
123
+ "custExist": {
124
+ "value": false,
125
+ "comment": "Does the customer have an existing loan? Only true or false is accepted."
126
+ },
127
+ "monthIncome": {
128
+ "value": 2500,
129
+ "comment": "Monthly income of the prospective customer."
130
+ },
131
+ "loanRate": {
132
+ "value": 5,
133
+ "comment": "Interest rate for the loan."
134
+ },
135
+ "loanTerm": {
136
+ "value": 30,
137
+ "comment": "Term length in months for the loan."
138
+ },
139
+ "loanAmnt": {
140
+ "value": 100000,
141
+ "comment": "This is the loan amount for the prospective loan."
142
+ },
143
+ "monthExpenses": {
144
+ "value": 1000,
145
+ "comment": "These are the monthly expenses for the prospective customer."
146
+ },
147
+ "loanType": {
148
+ "value": "standard",
149
+ "comment": "This is the loan type."
150
+ }
151
+ },
152
+ "formulas": {
153
+ "monthFee": {
154
+ "comment": "Calculate the decision tables within the 'formulas' section. Note the presence of the finalValue property to report the output value of each formula in the result. This is an optional property.",
155
+ "formula": "IF(loanType = 'standard', 20, IF(loanType = 'special', 25, 0))"
156
+ },
157
+ "monthRepay": {
158
+ "formula": "-PMT(loanRate%/12, loanTerm*12, loanAmnt)",
159
+ "comment": "Calculate the monthly loan payment."
160
+ },
161
+ "appRiskScore": {
162
+ "formula": "MIN(PsiPredict(PredictivePMMLModel,PredictiveInput),tblAppRiskScore(,,custAge, maritalStatus, employmentStatus))",
163
+ "comment": "Calls the tblAppRiskScore decision table to compute the applicant's risk score.",
164
+ "finalValue": []
165
+ },
166
+ "monthInstall": {
167
+ "formula": "monthRepay + monthFee",
168
+ "comment": "Total monthly installment."
169
+ },
170
+ "disposIncome": {
171
+ "formula": "monthIncome - ( monthRepay + monthExpenses)",
172
+ "comment": "Applicant's disposable income."
173
+ },
174
+ "bureauRiskCat": {
175
+ "formula": "tblBureauRiskCat(,,custExist, appRiskScore)",
176
+ "comment": "Calls the tblBureauRiskCat decision table. Note that output from the tblAppRiskScore decision table, appRiskScore, is an input to this decision table.",
177
+ "finalValue": []
178
+ },
179
+ "bureauCallType": {
180
+ "formula": "tblBureauCallType(,,bureauRiskCat)",
181
+ "comment": "Calls the tblBureauCallType decision table to compute the bureau's risk category.",
182
+ "finalValue": []
183
+ },
184
+ "bureauAfford": {
185
+ "formula": "IF(disposIncome * creditContFactor > monthInstall, TRUE, FALSE)",
186
+ "comment": "Determines if the applicant will be able to afford the monthly installment payment."
187
+ },
188
+ "eligibility": {
189
+ "formula": "tblEligibility(,,bureauRiskCat, bureauAfford, custAge)",
190
+ "comment": "Determines if the applicant is eligible to receive the loan.",
191
+ "finalValue": []
192
+ },
193
+ "strategy": {
194
+ "formula": "tblStrategy(,,eligibility, bureauCallType)",
195
+ "comment": "Uses outputs from the tblEligibility and tblBureauCallType tables to determine the best strategy for the applicant.",
196
+ "finalValue": []
197
+ },
198
+ "creditContFactor": {
199
+ "formula": "tblCreditContFactor(,,bureauRiskCat)",
200
+ "comment": "Calls the tblCreditContFactor table using the output from the tblBureauRiskCat decision table. ",
201
+ "finalValue": []
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,214 @@
1
+ {
2
+ "modelName": "DTLoanStrategyFromScratch",
3
+ "modelDescription": "Loan Strategy model",
4
+ "modelType": "calculation",
5
+
6
+ "data": {
7
+
8
+ "comment": "use binding to feed dif. values",
9
+
10
+ "custExist": { "value": false },
11
+ "custAge": { "value": 40 },
12
+ "maritalStatus": { "value": "s" },
13
+ "employmentStatus": { "value": "selfEmployed" },
14
+ "creditScore": { "value": 610 },
15
+ "bankrupt": { "value": false },
16
+ "monthIncome": { "value": 2500 },
17
+ "monthExpenses": { "value": 1000 },
18
+
19
+ "loanType": { "value": "standard" },
20
+ "loanRate": { "value": 5.0 },
21
+ "loanTerm": { "value": 30 },
22
+ "loanAmnt": { "value": 100000.0 }
23
+ },
24
+
25
+ "decisionTables": {
26
+
27
+ "tblAppRiskScore": {
28
+
29
+ "inputs": [ "custAge", "maritalStatus", "employmentStatus" ],
30
+ "outputs": [ "partialScore" ],
31
+
32
+ "inputValues": [
33
+ [ "[18..120]", "s", "unemployed" ],
34
+ [ null, "m", "employed" ],
35
+ [ null, null, "selfEmployed" ],
36
+ [ null, null, "student" ]
37
+ ],
38
+
39
+ "rules": [
40
+ [ "[18..21]", "-", "-", 32 ],
41
+ [ "(21..25]", "-", "-", 35 ],
42
+ [ "(25..35]", "-", "-", 40 ],
43
+ [ "(35..49]", "-", "-", 43 ],
44
+ [ ">49", "-", "-", 48 ],
45
+ [ "-", "s", "-", 25 ],
46
+ [ "-", "m", "-", 45 ],
47
+ [ "-", "-", "unemployed", 15 ],
48
+ [ "-", "-", "student", 18 ],
49
+ [ "-", "-", "employed", 45 ],
50
+ [ "-", "-", "selfEmployed", 36 ]
51
+ ],
52
+
53
+ "hitPolicy": "collect+"
54
+ },
55
+
56
+ "tblBureauRiskCat": {
57
+
58
+ "inputs": [ "custExist", "appRiskScore" ],
59
+ "outputs": [ "bureauRiskCat" ],
60
+
61
+ "rules": [
62
+ [ false, "<100", "high" ],
63
+ [ false, "[100..120)", "medium" ],
64
+ [ false, "[120..130]", "low" ],
65
+ [ false, ">130", "veryLow" ],
66
+ [ true, "<80", "decline" ],
67
+ [ true, "[80..90)", "high" ],
68
+ [ true, "[90..110]", "medium" ],
69
+ [ true, ">110", "low" ]
70
+ ],
71
+
72
+ "hitPolicy": "unique"
73
+ },
74
+
75
+ "tblBureauCallType": {
76
+
77
+ "inputs": [ "bureauRiskCat" ],
78
+ "outputs": [ "bureauCallType" ],
79
+
80
+ "rules": [
81
+ [ "high,medium", "full" ],
82
+ [ "low", "mini" ],
83
+ [ "veryLow,decline", "none" ]
84
+ ],
85
+
86
+ "hitPolicy": "unique"
87
+ },
88
+
89
+ "tblEligibility": {
90
+
91
+ "inputs": [ "bureauRiskCat", "bureauAfford", "custAge" ],
92
+ "outputs": [ "eligibility" ],
93
+
94
+ "outputValues": [ "ineligible", "eligible" ],
95
+
96
+ "rules": [
97
+ [ "decline", "-", "-", "ineligible" ],
98
+ [ "-", false, "-", "ineligible" ],
99
+ [ "-", "-", "<18", "ineligible" ],
100
+ [ "-", "-", "-", "eligible" ]
101
+ ],
102
+
103
+ "hitPolicy": "priority"
104
+ },
105
+
106
+ "tblCreditContFactor": {
107
+
108
+ "inputs": [ "bureauRiskCat" ],
109
+ "outputs": [ "creditContFactor" ],
110
+
111
+ "rules": [
112
+ [ "high,decline", 0.6 ],
113
+ [ "medium", 0.7 ],
114
+ [ "low,veryLow", 0.8 ]
115
+ ],
116
+
117
+ "hitPolicy": "unique"
118
+ },
119
+
120
+ "tblStrategy": {
121
+
122
+ "inputs": [ "eligibility", "bureauCallType" ],
123
+ "outputs": [ "strategy" ],
124
+
125
+ "rules": [
126
+ [ "ineligible", "-", "decline" ],
127
+ [ "eligible", "full,mini", "bureau" ],
128
+ [ "eligible", "none", "through" ]
129
+ ],
130
+
131
+ "hitPolicy": "unique"
132
+ },
133
+
134
+ "tblPostBureauRiskCat": {
135
+
136
+ "inputs": [ "custExist", "appRiskScore", "creditScore" ],
137
+ "outputs": [ "postBureauRiskCat" ],
138
+
139
+ "rules": [
140
+ [ false, "<120", "<590", "high" ],
141
+ [ false, "<120", "[590..610]", "medium" ],
142
+ [ false, "<120", ">610", "low" ],
143
+ [ false, "[120..130]", "<600", "high" ],
144
+ [ false, "[120..130]", "[600..625]", "medium" ],
145
+ [ false, "[120..130]", ">625", "low" ],
146
+ [ false, ">130", "-", "veryLow" ],
147
+ [ true, "<=100", "<580", "high" ],
148
+ [ true, "<=100", "[580..600]", "medium" ],
149
+ [ true, "<=100", ">600", "low" ],
150
+ [ true, ">100", "<590", "high" ],
151
+ [ true, ">100", "[590..615]", "medium" ],
152
+ [ true, ">100", ">615", "low" ]
153
+ ],
154
+
155
+ "hitPolicy": "unique"
156
+ },
157
+
158
+ "tblRouting": {
159
+
160
+ "inputs": [ "postBureauRiskCat", "postBureauAfford", "bankrupt", "creditScore" ],
161
+ "outputs": [ "routing" ],
162
+
163
+ "inputValues": [
164
+ [ null, null, true, "[0..999]" ],
165
+ [ null, null, false, null ]
166
+ ],
167
+
168
+ "outputValues": [ "decline", "refer", "accept" ],
169
+
170
+ "rules": [
171
+ [ "-", false, "-", "-", "decline" ],
172
+ [ "-", "-", true, "-", "decline" ],
173
+ [ "high", "-", "-", "-", "refer" ],
174
+ [ "-", "-", "-", "<580", "refer" ],
175
+ [ "-", "-", "-", "-", "accept" ]
176
+ ],
177
+
178
+ "hitPolicy": "priority"
179
+ }
180
+ },
181
+
182
+ "formulas": {
183
+
184
+ "monthFee": { "formula": "IF(loanType = 'standard', 20, IF(loanType = 'special', 25, 0))" },
185
+
186
+ "monthRepay": { "formula": "-PMT(loanRate%/12, loanTerm*12, loanAmnt)" },
187
+
188
+ "monthInstall": { "formula": "monthRepay + monthFee" },
189
+
190
+ "disposIncome": { "formula": "monthIncome - (monthRepay + monthExpenses)" },
191
+
192
+ "appRiskScore": { "formula": "tblAppRiskScore(,,custAge, maritalStatus, employmentStatus)" },
193
+
194
+ "bureauRiskCat": { "formula": "tblBureauRiskCat(,,custExist, appRiskScore)" },
195
+
196
+ "bureauAfford": { "formula": "IF(disposIncome * tblCreditContFactor(,,bureauRiskCat) > monthInstall, true, false)" },
197
+
198
+ "strategy": {
199
+ "formula": "tblStrategy(,,tblEligibility(,,bureauRiskCat, bureauAfford, custAge), tblBureauCallType(,,bureauRiskCat))",
200
+ "finalValue": []
201
+ },
202
+
203
+ "comment": "additional stage follows",
204
+
205
+ "postBureauRiskCat": { "formula": "tblPostBureauRiskCat(,,custExist, appRiskScore, creditScore)" },
206
+
207
+ "postBureauAfford": { "formula": "IF(disposIncome * tblCreditContFactor(,,postBureauRiskCat) > monthInstall, true, false)" },
208
+
209
+ "routing": {
210
+ "formula": "tblRouting(,,postBureauRiskCat, postBureauAfford, bankrupt, creditScore)",
211
+ "finalValue": []
212
+ }
213
+ }
214
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "modelName": "DTOutputOrderExample",
3
+ "modelDescription": "RASON Decision Table Example using the ''O' policy: The example illustrates the sue of the Output Order hit policy which means that if multiple rules are hit, the collection of results is returned in the priority order as listed for outputValues. This decision table accepts two input parameters, age and service, and returns the number of vacation days that an employee is entitled to. ",
4
+ "modelType": "calculation",
5
+ "data": {
6
+ "comment": "use the data section to hold the constant input parameters: age and service.",
7
+ "age": {
8
+ "value": 58
9
+ },
10
+ "service": {
11
+ "value": 31
12
+ }
13
+ },
14
+ "decisionTables": {
15
+ "comment": "This decision table accepts two input parameters, age and service, and returns the number of vacation days that an employee is entitled to. A 58 year old employee with 31 years of service is entitled to 35 vacation days. 27 (rule 1) + 5 (rule 6) + 3 (rule 3). ",
16
+ "tblHolidays": {
17
+ "inputs": [ "age", "service" ],
18
+ "outputs": [ "holidays" ],
19
+ "rules": [
20
+ [ "-", "-", "age-service" ],
21
+ [ ">=60", "-", 3 ],
22
+ [ "-", ">=30", 3 ],
23
+ [ "<18", "-", 5 ],
24
+ [ ">=60", "-", 5 ],
25
+ [ "-", ">=30", 5 ],
26
+ [ "[18..60]", "[15..30]", 2 ],
27
+ [ "[45..60]", "<30", 2 ]
28
+ ],
29
+ "hitPolicy": "outputOrder",
30
+ "outputValues": [ 27, 5, 3, 2 ]
31
+ }
32
+ },
33
+ "formulas": {
34
+ "res": {
35
+ "comment": "The decision table is calculated from within the formulas section. Note the order in which the results are returned. A hit policy of Output Order specifies that results are returned in priority order. Since priority order is 27, 5, 3, 2 (as given in the outputValues property within the tblHolidays decision table, the results are returned as 27, 5, 3, rather than 27, 3, 5 which is the order in which they are triggered, i.e. rule 1, rule 3 and rule 6.",
36
+ "formula": "tblHolidays(,,age, service)",
37
+ "finalValue": []
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "modelName": "DTUniqueExample",
3
+ "modelDescription": "RASON Decision Table Example using the 'U' policy: This decision table in this model returns a patient's health risk rating based on their age and medical history. ",
4
+ "modelType": "calculation",
5
+ "data": {
6
+ "comment": "Use the data section to organize the constant data parameters in the model. In this case, the constant data INPUT parameters. These are the parameters that are fed into the decision table to produce a result.",
7
+ "age": {
8
+ "value": 54
9
+ },
10
+ "medHistory": {
11
+ "value": "good"
12
+ }
13
+ },
14
+ "decisionTables": {
15
+ "comment": "This decision table accepts two input parameters, age and medHisotry and returns a patient's medicatl risk rating and the rule that was triggered. The 'Unique' hit policy. With this hit policy in effect, a unique rule must be triggered evaluating to a unique result. If multiple rules are triggered, an error will be returned. In this example a 54 year old person with a good medical history will be assigned a risk rating of Medium.",
16
+ "tblRisk": {
17
+ "inputs": [ "age", "medHistory" ],
18
+ "outputs": [ "riskRating", "rule" ],
19
+ "rules": [
20
+ [ ">60,<25", "good", "Medium", "r1" ],
21
+ [ ">60", "bad", "High", "r2" ],
22
+ [ "[25..60]", "-", "Medium", "r3" ],
23
+ [ "<25", "bad", "Medium", "r4" ]
24
+ ],
25
+ "hitPolicy": "Unique",
26
+ "default": [
27
+ [ "High", "r0" ]
28
+ ]
29
+ }
30
+ },
31
+ "formulas": {
32
+ "comment": "Use the formulas section to calculate a decision table.",
33
+ "res": {
34
+ "comment": "The tblRisk decision table is called by passing the two input parameters, age and medHistory. The first argument [string ret_output] is an optional argument that, when passed, returns only the desired columns in the output. In this example, this argument is blank. The second argument [bool ret_header] is an optional argument that, when True, returns the column headings in the output. This is key if a function will be refereing this output using the PsiJoin function. (The PsiJoin function relies on the column headings in order to perform the combination of two tables.) The third and remaining arguments pass the input parameters to the decision table: reqObj, age and medHistory.",
35
+ "formula": "tblRisk(,,age, medHistory)",
36
+ "finalValue": []
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "modelName": "BoxFunTypeDefAllowedValues",
3
+ "modelType": "calculation",
4
+ "modelDescription": "RASON Example of Box function in FEEL with allowed values for box function inputs and input types passed as a JSON object. This example computes a loan payment based on customer input such as the loan principal amount, interest rate and the term in months.",
5
+ "typeDefs": {
6
+ "comment": "DMN CL3 introduces a way of formatting the results of decision tables and box functions through custom types. This approach allows users to reference the result more efficiently.",
7
+ "tLoan": {
8
+ "comment": "The tLoan typeDefs specifies the data types for three customer inputs: principal, rate and term.",
9
+ "components": {
10
+ "comment": "A typedefs definition is made up of components. In this example there are three components: principal, rate and termMonths.",
11
+ "principal": {
12
+ "comment": "Loan principal must be a positive number.",
13
+ "typeRef": "number",
14
+ "allowedValues": [ ">0" ]
15
+ },
16
+ "rate": {
17
+ "comment": "Interest rate must be a number between 0 and 1, inclusive.",
18
+ "typeRef": "number",
19
+ "allowedValues": [ "[0..1]" ]
20
+ },
21
+ "termMonths": {
22
+ "comment": "Loan term must be positive number.",
23
+ "typeRef": "number",
24
+ "allowedValues": [ ">0" ]
25
+ }
26
+ }
27
+ }
28
+ },
29
+ "boxFunctions": {
30
+ "comment": "The 'boxFunctions' section creates a custom, reusable function which can be used in a RASON model. ",
31
+ "funPMT": {
32
+ "comment": "This function accepts 3 inputs (principal, rate, and termMonths - all defined in tLoan) and computes a loan payment, wich is returned as the result",
33
+ "inputs": [ "loan" ],
34
+ "inputTypes": [ "tLoan" ],
35
+ "language": "FEEL",
36
+ "body": {
37
+ "payment": {
38
+ "formula": "(loan.principal*loan.rate/12) / (1 - (1 + loan.rate/12)**-loan.termMonths)"
39
+ },
40
+ "fee": {
41
+ "formula": "0.01 * payment"
42
+ }
43
+ },
44
+ "result": "payment + fee",
45
+ "resultType": "number"
46
+ }
47
+ },
48
+ "data": {
49
+ "comment": "The data for the loan is entered in the 'data' section.",
50
+ "loan": {
51
+ "comment": "Loan parameters as [principal, rate, termMonths]. Data types are defined as tLoan, defined in the 'typeDef' section above. The 'binding' property allows the loan data to be supplied outside of the model environment.",
52
+ "type": "tLoan",
53
+ "value": [ 600000, 0.0375, 360 ],
54
+ "binding": "get"
55
+ }
56
+ },
57
+ "formulas": {
58
+ "comment": "Calculate the box function in the 'formulas' section.",
59
+ "MonthlyPayment": {
60
+ "comment": "Calls funPMT function (defined within 'boxFunctions' section) with the given 'loan' (defined in data section) to calculate the loan payment. ",
61
+ "formula": "funPMT(loan)",
62
+ "finalValue": []
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "modelName": "DTUniqueExamplewTypeDefandAllowedValues",
3
+ "modelDescription": "RASON Decision Table 'U' policy example with Type Definition and Allowed Values: This example calculates the health risk of an adult given two inputs: age and a medical history.",
4
+ "modelType": "calculation",
5
+ "typeDefs": {
6
+ "comment": "DMN CL3 introduces a way of formatting the results of decision tables and box functions through custom types. This approach allows users to reference the result more efficiently.",
7
+ "tCustomer": {
8
+ "comment": "The tCustomer typeDefs, defines two input components: age and medHistory.",
9
+ "language": "FEEL",
10
+ "components": {
11
+ "age": {
12
+ "comment": "Age must be a positive number.",
13
+ "typeRef": "number",
14
+ "allowedValues": [ ">0" ]
15
+ },
16
+ "medHistory": {
17
+ "comment": "Medical history must either be 'bad' or 'good'.",
18
+ "typeRef": "string",
19
+ "allowedValues": [ "bad", "good" ]
20
+ }
21
+ }
22
+ }
23
+ },
24
+ "data": {
25
+ "comment": "Sample customer input, defined as tCustomer (within 'typeDefs' section). Both inputs are given, age = 54 and medical history = good. The 'binding' property allows the 'cust' inputs to be supplied outside of the model environment.",
26
+ "cust": {
27
+ "type": "tCustomer",
28
+ "value": [ 54, "good" ],
29
+ "binding": "get"
30
+ }
31
+ },
32
+ "decisionTables": {
33
+ "comment": "Create decision tables within decisionTables section.",
34
+ "tblRisk": {
35
+ "comment": "This decision table generates a patient's future medical risk based on two inputs, their age and medicatl history.",
36
+ "inputs": [ "age", "medHistory" ],
37
+ "outputs": [ "riskRating", "rule" ],
38
+ "rules": [
39
+ [ ">60,<25", "good", "Medium", "r1" ],
40
+ [ ">60", "bad", "High", "r2" ],
41
+ [ "[25..60]", "-", "Medium", "r3" ],
42
+ [ "<25", "good", "Low", "r4" ],
43
+ [ "<25", "bad", "Medium", "r5" ]
44
+ ],
45
+ "hitPolicy": "Unique",
46
+ "default": [
47
+ [ "High", "r0" ]
48
+ ]
49
+ }
50
+ },
51
+ "formulas": {
52
+ "comment": "Calculate the tblRisk box function (defined within the 'decisionTables' section) passing the two input parameters defined within the 'data' section: age and medHistory.",
53
+ "res": {
54
+ "formula": "tblRisk(,,cust.age, cust.medHistory)",
55
+ "finalValue": []
56
+ }
57
+ }
58
+ }