--------------------------------------------
----            Lua example             ----
---- (c) 2017-2019, Alessandro Pedretti ----
--------------------------------------------


require 'financial_service'

Model = financial_service:New()


---- Prediction example 1 ----

Model.LifeStyle = Model.C_LIFESTYLE_SPENDGSAVING
Model.Type      = Model.C_TYPE_STUDENT
Model.Vacation  = 6.0
Model.eCredit   = 40.0
Model.property  = 3.2804
Model.salary    = 13.62

print("\n* Example #1")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 0)")



---- Prediction example 2 ----

Model.LifeStyle = Model.C_LIFESTYLE_SPENDGSAVING
Model.Type      = Model.C_TYPE_LIBRARIAN
Model.Vacation  = 7.0
Model.eCredit   = 10.0
Model.property  = 1.2225
Model.salary    = 18.1751

print("\n* Example #2")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 1)")


---- Prediction example 3 ----

Model.LifeStyle = Model.C_LIFESTYLE_SPENDLSAVING
Model.Type      = Model.C_TYPE_STUDENT
Model.Vacation  = 6.0
Model.eCredit   = 73.0
Model.property  = 4.8256
Model.salary    = 31.75

print("\n* Example #3")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 2)")


---- Prediction example 4 ----

Model.LifeStyle = Model.C_LIFESTYLE_SPENDLSAVING
Model.Type      = Model.C_TYPE_DOCTOR
Model.Vacation  = 47.0
Model.eCredit   = 51.0
Model.property  = 5.6494
Model.salary    = 18.45

print("\n* Example #4")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 3)")


---- Prediction example 5 ----

Model.LifeStyle = Model.C_LIFESTYLE_SPENDGSAVING
Model.Type      = Model.C_TYPE_PROFESSOR
Model.Vacation  = 48.0
Model.eCredit   = 5.0
Model.property  = 1.7536
Model.salary    = 20.39

print("\n* Example #5")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 4)")
