Showing
1 changed file
with
3 additions
and
3 deletions
| ... | @@ -135,7 +135,7 @@ if __name__ == "__main__": | ... | @@ -135,7 +135,7 @@ if __name__ == "__main__": |
| 135 | elif options.classifier == "DecisionTree": | 135 | elif options.classifier == "DecisionTree": |
| 136 | classifier = DecisionTreeClassifier() | 136 | classifier = DecisionTreeClassifier() |
| 137 | elif options.classifier == "MLPClassifier": | 137 | elif options.classifier == "MLPClassifier": |
| 138 | - classifier = MLPClassifier(solver='lbfgs') | 138 | + classifier = MLPClassifier(solver='lbfgs', hidden_layer_sizes=(3)) |
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | print(" Training...") | 141 | print(" Training...") |
| ... | @@ -163,10 +163,10 @@ if __name__ == "__main__": | ... | @@ -163,10 +163,10 @@ if __name__ == "__main__": |
| 163 | oFile.write(str(confusion_matrix(trueEvaluationClasses, y_pred)) + '\n') | 163 | oFile.write(str(confusion_matrix(trueEvaluationClasses, y_pred)) + '\n') |
| 164 | oFile.write('Classification report: \n') | 164 | oFile.write('Classification report: \n') |
| 165 | oFile.write(classification_report(trueEvaluationClasses, y_pred) + '\n') | 165 | oFile.write(classification_report(trueEvaluationClasses, y_pred) + '\n') |
| 166 | - oFile.write("Weight matrices:\n") | ||
| 167 | if options.classifier == "MLPClassifier": | 166 | if options.classifier == "MLPClassifier": |
| 167 | + oFile.write("Weight matrices\n") | ||
| 168 | for coef in classifier.coefs_: | 168 | for coef in classifier.coefs_: |
| 169 | - oFile.write("{}".format(coef)) | 169 | + oFile.write("coef.shape: {}".format(coef.shape)) |
| 170 | print(" Saving test report done!") | 170 | print(" Saving test report done!") |
| 171 | 171 | ||
| 172 | print("Training and test done in: %fs" % (time() - t0)) | 172 | print("Training and test done in: %fs" % (time() - t0)) | ... | ... |
-
Please register or login to post a comment