#!/usr/bin/env python3.5

#********************************************
#****           Python example           ****
#**** (c) 2017-2019, Alessandro Pedretti ****
#********************************************


# Import the module with the model

import random_forest

print()
print("************************")
print("**** Python example ****")
print("************************")


# Create the classification model

Model = random_forest.T2PY_RANDOM_FOREST()


# Prediction example 1

Model.Angles = 108
Model.Atoms = 60
Model.Bonds = 63
Model.Charge = 0
Model.ChiralAtms = 0
Model.Dipole = 2.54652
Model.EzBnds = 2
Model.FlexTorsions= 10
Model.Gyrrad= 7.528516
Model.HbAcc= 4
Model.HbDon= 2
Model.HeavyAtoms= 32
Model.Impropers= 21
Model.Lipole= 2.13308
Model.Mass= 448.5804
Model.Ovality= 1.894926
Model.Psa= 92.87458
Model.Rings= 4
Model.Sas= 809.6651
Model.Sav= 1316.951
Model.Sdiam= 12.73983
Model.Surface= 509.8912
Model.Torsions= 32
Model.Vdiam= 9.254815
Model.VirtualLogP= 4.190687
Model.Volume= 415.0514

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


# Prediction example 2

Model.Angles = 27
Model.Atoms = 18
Model.Bonds = 18
Model.Charge = 0
Model.ChiralAtms = 0
Model.Dipole = 0.245056
Model.EzBnds = 1
Model.FlexTorsions= 2
Model.Gyrrad= 2.415841
Model.HbAcc= 2
Model.HbDon= 4
Model.HeavyAtoms= 10
Model.Impropers= 9
Model.Lipole= 4.472592
Model.Mass= 156.2088
Model.Ovality= 1.382357
Model.Psa= 96.54134
Model.Rings= 1
Model.Sas= 330.8518
Model.Sav= 474.6761
Model.Sdiam= 7.461171
Model.Surface= 174.8896
Model.Torsions= 9
Model.Vdiam= 6.345953
Model.VirtualLogP= 0.500129
Model.Volume= 133.8102

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

