Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Geospatial Data Science Quick Start Guide

You're reading from   Geospatial Data Science Quick Start Guide Effective techniques for performing smarter geospatial analysis using location intelligence

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789809411
Length 170 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Abdishakur Hassan Abdishakur Hassan
Author Profile Icon Abdishakur Hassan
Abdishakur Hassan
Jayakrishnan Vijayaraghavan Jayakrishnan Vijayaraghavan
Author Profile Icon Jayakrishnan Vijayaraghavan
Jayakrishnan Vijayaraghavan
Arrow right icon
View More author details
Toc

Error metric

If we visit the evaluation section of the Kaggle competition, the evaluation metric is defined as the RMSLE. In the competition, the objective is to minimize this metric for the test data. An error is simply the difference between actual values and predicted values:

error = predicted value - actual value

The Root Mean Squared Error (RMSE) would literally be the square root applied over the mean of all the squared error terms for each observation.

However, our metric in the Kaggle competition needs to be a log error:

log_error = log(predicted value + 1) - log(actual value + 1)

Therefore, it is important to apply a log transform over the trip_duration column as we did earlier:

df["trip_duration"] = np.log(df["trip_duration"] + 1) 

Now, we can use a function that can calculate RMSE rather a function that calculates RMSLE:

import math 
def rmse(x,y...
You have been reading a chapter from
Geospatial Data Science Quick Start Guide
Published in: May 2019
Publisher: Packt
ISBN-13: 9781789809411
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime