# Weka - MultilayerPerceptron output in Excel Classic List Threaded 4 messages Open this post in threaded view
|

## Weka - MultilayerPerceptron output in Excel

 Hello again, I am using MultilayerPerceptron to create a NN, which is trained successfully according to WEKA. I am trying to replicate the results in Excel. I made a simple parser of the output, but I cannot get the results straight. The output does not make any sense. Any insight would be welcome. I suppose the sigmoid function is defined as sigmoid(w, x, b) = 1 / (1 + exp(-(-b))), with b being the threshold. I have tried with (+/-) b but to no avail. I also read somewhere that the sigmoid in WEKA is defined as    If (value < -45) Then {      value = 0;    }    ElseIf (value > 45) Then {      value = 1;    }    Else {      value = 1 / (1 + Math.Exp(-value));    }   Also, I translate the linear node as +b A simple example: Suppose I have 1 hidden layer of 5 nodes, the output I get is: === Run information === Scheme:       weka.classifiers.functions.MultilayerPerceptronCS -L 0.3 -M 0.2 -N 1000 -V 0 -S 0 -E 20 -H 5 Relation:     data Instances:    4026 Attributes:   6               Number of Storeys               Number of Spans               Length of Spans (m)               Opening percentage (%)               Masonry wall Stiffeness Et (x10^5 kN/m)               Period (Sec) Test mode:    10-fold cross-validation === Classifier model (full training set) === Linear Node 0     Inputs    Weights     Threshold    1.479515662214628     Node 1    -1.2500813145671659     Node 2    -1.1936223860947242     Node 3    -1.0322755928454377     Node 4    0.6873819829338501     Node 5    -0.8755940293144294 Sigmoid Node 1     Inputs    Weights     Threshold    -0.020779798699673828     Attrib Number of Storeys    -0.47751964434474686     Attrib Number of Spans    0.051982817435324694     Attrib Length of Spans (m)    0.11541540106371614     Attrib Opening percentage (%)    -2.1530097993944937     Attrib Masonry wall Stiffeness Et (x10^5 kN/m)    0.5824263986660082 Sigmoid Node 2     Inputs    Weights     Threshold    3.153528808536817     Attrib Number of Storeys    -1.274000354409299     Attrib Number of Spans    -0.2074191313850551     Attrib Length of Spans (m)    -0.8179982590889109     Attrib Opening percentage (%)    -1.356192955914052     Attrib Masonry wall Stiffeness Et (x10^5 kN/m)    -0.25363472958936506 Sigmoid Node 3     Inputs    Weights     Threshold    -1.7602140190613385     Attrib Number of Storeys    -0.8856009305882884     Attrib Number of Spans    0.27343819917084683     Attrib Length of Spans (m)    -0.4635294706291094     Attrib Opening percentage (%)    2.117897752537026     Attrib Masonry wall Stiffeness Et (x10^5 kN/m)    -0.6032425283206477 Sigmoid Node 4     Inputs    Weights     Threshold    -1.8548729118511484     Attrib Number of Storeys    1.1623791972607342     Attrib Number of Spans    -0.36297427587015374     Attrib Length of Spans (m)    0.5762798462081734     Attrib Opening percentage (%)    0.5488391987947177     Attrib Masonry wall Stiffeness Et (x10^5 kN/m)    -1.2120904391073823 Sigmoid Node 5     Inputs    Weights     Threshold    -2.381202855776649     Attrib Number of Storeys    -1.232612057937638     Attrib Number of Spans    -0.4122916890498481     Attrib Length of Spans (m)    0.5818135690013081     Attrib Opening percentage (%)    0.7440217904363292     Attrib Masonry wall Stiffeness Et (x10^5 kN/m)    -0.13724414628886286 Class     Input     Node 0 Time taken to build model: 4.44 seconds === Cross-validation === === Summary === Correlation coefficient                  0.9936 Mean absolute error                      0.0726 Root mean squared error                  0.0924 Relative absolute error                 11.2192 % Root relative squared error             11.7692 % Total Number of Instances             4026     The attributes are stored in Columns A to E:               Number of Storeys -> A2               Number of Spans -> B2               Length of Spans (m) -> C2               Opening percentage (%) -> D2               Masonry wall Stiffeness Et (x10^5 kN/m)->E2 Cells to hold the values of the nodes: Linear Node 0 (class) -> Z2 Sigmoid Node 1 -> AA2 Sigmoid Node 2 -> AB2 Sigmoid Node 3 -> AC2 Sigmoid Node 4 -> AD2 Sigmoid Node 5 -> AE2 In Z2 (Node 0):=+1.479515662214628-1.2500813145671659*AA2-1.1936223860947242*AB2-1.0322755928454377*AC2+0.6873819829338501*AD2-0.8755940293144294*AE2 In AA2 (Node 1): =IF(+0.020779798699673828-0.47751964434474686*A2+0.051982817435324694*B2+0.11541540106371614*C2-2.1530097993944937*D2+0.5824263986660082*E2<-45,0,IF(+0.020779798699673828-0.47751964434474686*A2+0.051982817435324694*B2+0.11541540106371614*C2-2.1530097993944937*D2+0.5824263986660082*E2>45,1,1/(1+EXP(-(+0.020779798699673828-0.47751964434474686*A2+0.051982817435324694*B2+0.11541540106371614*C2-2.1530097993944937*D2+0.5824263986660082*E2))))) In AB2(Node 2): =IF(-3.153528808536817-1.274000354409299*A2-0.2074191313850551*B2-0.8179982590889109*C2-1.356192955914052*D2-0.25363472958936506*E2<-45,0,IF(-3.153528808536817-1.274000354409299*A2-0.2074191313850551*B2-0.8179982590889109*C2-1.356192955914052*D2-0.25363472958936506*E2>45,1,1/(1+EXP(-(-3.153528808536817-1.274000354409299*A2-0.2074191313850551*B2-0.8179982590889109*C2-1.356192955914052*D2-0.25363472958936506*E2))))) In AC2(Node 3): =IF(+1.7602140190613385-0.8856009305882884*A2+0.27343819917084683*B2-0.4635294706291094*C2+2.117897752537026*D2-0.6032425283206477*E2<-45,0,IF(+1.7602140190613385-0.8856009305882884*A2+0.27343819917084683*B2-0.4635294706291094*C2+2.117897752537026*D2-0.6032425283206477*E2>45,1,1/(1+EXP(-(+1.7602140190613385-0.8856009305882884*A2+0.27343819917084683*B2-0.4635294706291094*C2+2.117897752537026*D2-0.6032425283206477*E2))))) In AD2(Node 4): =IF(+1.8548729118511484+1.1623791972607342*A2-0.36297427587015374*B2+0.5762798462081734*C2+0.5488391987947177*D2-1.2120904391073823*E2<-45,0,IF(+1.8548729118511484+1.1623791972607342*A2-0.36297427587015374*B2+0.5762798462081734*C2+0.5488391987947177*D2-1.2120904391073823*E2>45,1,1/(1+EXP(-(+1.8548729118511484+1.1623791972607342*A2-0.36297427587015374*B2+0.5762798462081734*C2+0.5488391987947177*D2-1.2120904391073823*E2))))) In AE2(Node 5): =IF(+2.381202855776649-1.232612057937638*A2-0.4122916890498481*B2+0.5818135690013081*C2+0.7440217904363292*D2-0.13724414628886286*E2<-45,0,IF(+2.381202855776649-1.232612057937638*A2-0.4122916890498481*B2+0.5818135690013081*C2+0.7440217904363292*D2-0.13724414628886286*E2>45,1,1/(1+EXP(-(+2.381202855776649-1.232612057937638*A2-0.4122916890498481*B2+0.5818135690013081*C2+0.7440217904363292*D2-0.13724414628886286*E2))))) TIA   -- Sent from: https://weka.8497.n7.nabble.com/_______________________________________________ Wekalist mailing list -- [hidden email] Send posts to: To unsubscribe send an email to [hidden email] To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nzList etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Open this post in threaded view
|