"""
EXAMPLE SCRIPT
Creating the Server object (for handling project directories, machine learning models, and data handling),
creating the folder hierarchy for your project (project name, number of build sets, and nodes/set, specified in config),
importing data from database (specified in config), fitting X machine learning models (where X is number of trials/node,
specified in config), selecting the best performing trial from each node for the final build set, testing for multiple 
errors, predicting values for the database and outputting them to an output file.
"""
import ecnet

server = ecnet.server.Server()			# Create server object
server.create_save_env()				# Create a folder structure for your project
server.import_data()					# Import data
server.create_mlp_model()				# Create a multilayer perceptron (neural network)
server.fit_mlp_model_validation()		# Fits the mlp using the input database (with a validation set)
server.select_best()					# Select best trial from each build node

rmse = server.test_model_rmse()			# Root-mean-square error
mae = server.test_model_mae()			# Mean average error
r2 = server.test_model_r2()				# Coeffecient of determination (r-squared)

results = server.use_mlp_model_all()	# Calculate results from data (all values, not just test set)
server.output_results(results, "all", "results_output.csv")		# Output results to specified file

print(rmse)
print(mae)
print(r2)

@@ -493,16 +493,33 @@
 %0D%0Aerrors
+ on your database
 , predic
@@ -596,54 +596,56 @@
 %22%22%0D%0A
-import
+from
  ecnet
-%0D%0A%0D%0A
+.
 server 
-= ecnet.server.
+import Server%0D%0A%0D%0Asv = 
 Server()
 %09%09%09#
@@ -640,16 +640,20 @@
 Server()
+%09%09%09%09
 %09%09%09# Cre
@@ -672,21 +672,17 @@
 bject%0D%0As
-erver
+v
 .create_
@@ -691,24 +691,25 @@
 ve_env()%09%09%09%09
+%09
 # Create a f
@@ -743,21 +743,17 @@
 oject%0D%0As
-erver
+v
 .import_
@@ -758,16 +758,17 @@
 t_data()
+%09
 %09%09%09%09%09# I
@@ -780,21 +780,17 @@
  data%0D%0As
-erver
+v
 .create_
@@ -800,16 +800,17 @@
 _model()
+%09
 %09%09%09%09# Cr
@@ -857,21 +857,17 @@
 work)%0D%0As
-erver
+v
 .fit_mlp
@@ -887,16 +887,17 @@
 tion()%09%09
+%09
 # Fits t
@@ -909,20 +909,16 @@
 p using 
-the 
 input da
@@ -930,13 +930,9 @@
 e (w
-ith a
+/
  val
@@ -946,21 +946,17 @@
  set)%0D%0As
-erver
+v
 .select_
@@ -961,16 +961,17 @@
 t_best()
+%09
 %09%09%09%09%09# S
@@ -1015,199 +1015,8 @@
 %0D%0A%0D%0A
-rmse = server.test_model_rmse()%09%09%09# Root-mean-square error%0D%0Amae = server.test_model_mae()%09%09%09# Mean average error%0D%0Ar2 = server.test_model_r2()%09%09%09%09# Coeffecient of determination (r-squared)%0D%0A%0D%0A
 resu
@@ -1022,21 +1022,17 @@
 ults = s
-erver
+v
 .use_mlp
@@ -1043,16 +1043,20 @@
 el_all()
+%09%09%09%09
 %09# Calcu
@@ -1087,42 +1087,17 @@
 all 
-values, not just test set)%0D%0Aserver
+sets)%0D%0Asv
 .out
@@ -1129,29 +1129,24 @@
 %22, %22
+cn_
 results
-_output
 .csv%22)
-%09
 %09# O
@@ -1184,39 +1184,128 @@
 %0D%0A%0D%0A
-print(rmse)%0D%0Aprint(mae)
+errors = sv.calc_error('rmse','r2','mean_abs_error','med_abs_error')%09# Calculates errors for dataset predictions
 %0D%0Aprint(
 r2)%0D
@@ -1300,13 +1300,17 @@
 %0D%0Aprint(
-r2
+errors
 )%0D%0A

update to syntax