/*------------------------------------------------------------ Copyright (C) 2000 SAS Institute, Inc. All rights reserved. Notice: The following permissions are granted provided that the above copyright and this notice appear in the code and any related documentation. Permission to copy, modify and distribute the C language source code generated using or distributed with SAS Enterprise Miner C Scoring software and any executables derived from such source code is limited to customers of SAS Institute with a valid license for SAS Enterprise Miner C Scoring software. Any distribution of such executables or source code shall be on an "AS IS" basis without warranty of any kind. SAS and all other SAS Institute. Inc. product and service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. Except as contained in this notice, the name of the SAS Institute, SAS Enterprise Miner and SAS Enterprise Miner C Scoring software shall not be used in the advertising or promotion of products or services without prior written authorization from SAS Institute Inc. ------------------------------------------------------------*/ /*--- start generated code ---*/ #include #include #include #include #include "cscore.h" #include "csparm.h" #define csAGE indata[0].data.fnum #define csBMI indata[1].data.fnum #define csBP indata[2].data.fnum #define csNPREG indata[3].data.fnum #define csH11 outdata[0].data.fnum #define csP_GLU outdata[1].data.fnum #define csS_AGE outdata[2].data.fnum #define csS_BMI outdata[3].data.fnum #define csS_BP outdata[4].data.fnum #define csS_NPREG outdata[5].data.fnum #define cs_WARN_ outdata[6].data.str SFDKeyWords void score ( PARM *indata, PARM *outdata ) { /*--- Auto Variables ---*/ double cs_DM_BAD; double cs_EPS; double cs_MAXP_; double cs_MAX_; double cs_NOCL_; double cs_NTRIALS; double cs_SUM_; strcpy(cs_WARN_," "); /*--- initialize stand alone formats library ---*/ #if FMTLIB == 1 xfinit(); #endif /*-------------------------------------------------------------**/ /* start_chunk 1458742801.2:t0829o1k **/ /*-------------------------------------------------------------**/ /* */ /* tool : input data source */ /* type : sampling */ /* node : rclib.diabtr [t0829o1k] */ /* */ /*-------------------------------------------------------------**/ /*-------------------------------------------------------------**/ /* end_chunk 1458742801.2:t0829o1k **/ /*-------------------------------------------------------------**/ /*-------------------------------------------------------------**/ /* start_chunk 1458743704:t3s5m6fg **/ /*-------------------------------------------------------------**/ /* */ /* tool : neural network */ /* type : model */ /* node : neural network [t3s5m6fg] */ /* */ /*-------------------------------------------------------------**/ /* */ /* model name : diabnn */ /* description : diabetic neural network */ /* */ /* target : glu */ /*-------------------------------------------------------------**/ /***********************************/ /** begin scoring code for neural*/ /***********************************/ cs_DM_BAD = 0; cs_NOCL_ = MISSING; cs_MAX_ = MISSING; cs_MAXP_ = MISSING; cs_SUM_ = MISSING; cs_NTRIALS = MISSING; cs_EPS = 1E-10; /** **************************/ /** checking missing input interval *** \ ********************** ****/ if ( nmiss( 4 , csAGE , csBMI , csBP , csNPREG)) { lsubstr(cs_WARN_, 1, 1, "M"); cs_DM_BAD = 1; } /** **************************/ /** writing the node interval */ /** **************************/ if ( cs_DM_BAD== 0) { csS_AGE = -3.09480671785996 + 0.09484544032669 * csAGE; csS_BMI = -5.32959881569554 + 0.16043343816061 * csBMI; csS_BP = -6.23186009075952 + 0.08732987795346 * csBP; csS_NPREG = -1.10577327481295 + 0.31325021949375 * csNPREG; } else { if ( missingn( csAGE)) csS_AGE = MISSING; else csS_AGE = -3.09480671785996 + 0.09484544032669 * csAGE; if ( missingn( csBMI)) csS_BMI = MISSING; else csS_BMI = -5.32959881569554 + 0.16043343816061 * csBMI; if ( missingn( csBP)) csS_BP = MISSING; else csS_BP = -6.23186009075952 + 0.08732987795346 * csBP; if ( missingn( csNPREG)) csS_NPREG = MISSING; else csS_NPREG = -1.10577327481295 + 0.31325021949375 * csNPREG; } /** **************************/ /** writing the node h1 */ /** **************************/ if ( cs_DM_BAD== 0) { csH11 = -0.91009647092622 * csS_AGE + -0.41076471871919 * csS_BMI + 0.26317138409365 * csS_BP + -1.00372961444388 * csS_NPREG; csH11 = -0.17174374263479 + csH11; csH11 = tanh(csH11); } else { csH11 = MISSING; } /** **************************/ /** writing the node t_intrvl */ /** **************************/ if ( cs_DM_BAD== 0) { csP_GLU = -12.0780897121097 * csH11; csP_GLU = 123.63885178718 + csP_GLU; } else { csP_GLU = MISSING; } if ( cs_DM_BAD== 1) { csP_GLU = 123.03; } /********************************/ /** end scoring code for neural*/ /********************************/ /*-------------------------------------------------------------**/ /* end_chunk 1458743704:t3s5m6fg **/ /*-------------------------------------------------------------**/ return; } usrNbucket usrnBuckets[]={ /* not used */ {0,0,0,NULL,NULL,' ',0.0} }; usrCbucket usrcBuckets[]={ /* not used */ {NULL, NULL, 0, NULL} }; usrFormat usrnFormats[] = { {"**unused**",0.0,0,0,0,-1,-1,0} }; usrFormat usrcFormats[] = { {"**unused**",0.0,0,0,0,-1,-1,0} }; int usrNumNfmts = 0; int usrNumCfmts = 0;