#CrossCompute
vehicle_table_path = 'monthly_FHV_count.csv'
target_folder = '/tmp'
import pandas as pd
vehicle_table = pd.read_csv(vehicle_table_path)
vehicle_table[:2]
len(vehicle_table)
vehicle_table['Predicted Bus Ride Count'] = [23,34,34,23,20,45,34,56,55,67,88,12]
vehicle_table['Actual Bus Ride Count'] = [25,54,74,83,28,49,34,56,57,69,68,72]
# Save table
target_path = target_folder + '/a.csv'
vehicle_table.to_csv(target_path, index=False)
print('a_table_path = %s' % target_path)
# Save plot
%matplotlib inline
target_path = target_folder + '/b.png'
plot_table = vehicle_table.copy()
plot_table = plot_table.set_index('Month Number')
axes = plot_table.plot(kind='line')
figure = axes.get_figure()
figure.savefig(target_path)
print(f'b_image_path = {target_path}')
# Save number
error_table = vehicle_table.copy()
error_table['Absolute Error'] = (error_table[
'Predicted Bus Ride Count'
] - error_table[
'Actual Bus Ride Count'
]).abs()
error_table
print('mean_absolute_error = %s' % error_table['Absolute Error'].mean())