
/*******************************************
****           Java example             ****
**** (c) 2017-2019, Alessandro Pedretti ****
*******************************************/


public class financial_service_test
{
  public static void main(String[] args)
  {
	financial_service Model = new financial_service();

    /**** Prediction example 1 ****/

    Model.LifeStyle = Model.C_LIFESTYLE_SPENDGGSAVING;
    Model.Type      = Model.C_TYPE_STUDENT;
    Model.Vacation  = 6.0f;
    Model.eCredit   = 40.0f;
    Model.property  = 3.2804f;
    Model.salary    = 13.62f;

    System.out.printf("\n* Example #1\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 0)\n", Model.Classify());

    /**** Prediction example 2 ****/

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

    System.out.printf("\n* Example #2\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 1)\n", Model.Classify());

    /**** Prediction example 3 ****/

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

    System.out.printf("\n* Example #3\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 2)\n", Model.Classify());

    /**** Prediction example 4 ****/

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

    System.out.printf("\n* Example #4\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 3)\n", Model.Classify());

    /**** Prediction example 5 ****/

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

    System.out.printf("\n* Example #5\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 4)\n", Model.Classify());
  }
}
