richard pugh, commercial director [email protected] building applications in r 16 th july...
TRANSCRIPT
Richard Pugh, Commercial [email protected]
Building Applications in R16th July 2013, LondonR
Richard Pugh, Commercial Director, [email protected] Nicholls, Head of Consulting, [email protected]
Chris Campbell, Senior Consultant, [email protected]
Richard Pugh, Commercial [email protected]
Agenda
• Introduction
• Why Build Analytic Applications (with R)?
• Challenges, Learnings etc
• Some Case Studies
• Summary
Richard Pugh, Commercial [email protected]
Introduction
Richard Pugh, Commercial [email protected]
Mango a Nutshell
• Premier R training and services company• Private company founded in 2002• Headquartered in UK• Global Team of ~70 and expanding• Services: Training, Consulting,
Application Development, Support and Validation
Richard Pugh, Commercial [email protected]
This Presentation …
• Was a training course: How to build analytic applications using R
• Then was a 4 hour presentation: Themes for building analytic application using R with lots of examples
• Now a 20 minute (+/- 1.96*SE) presentation: Things we’ve learnt when building analytic applications using R
• Ask me later if you are interested in the earlier versions!
Richard Pugh, Commercial [email protected]
Caveats
• I’m a statistician who knows R, but am more of a “user” than a “developer”
• For some of this, you could swap “in R” with “in any analytic technology”
Richard Pugh, Commercial [email protected]
Why Build Analytic Applications?
Richard Pugh, Commercial [email protected]
Why Analytics?
• Analytics can help people answer all sorts of questions
• I believe there is no company in the world today who cannot benefit from analytics in some way
• More and more people are realising it
Richard Pugh, Commercial [email protected]
Why Build Analytic Applications?
• 3 key reasons we see:• To deploy analytical tools to decision makers
• To make an analysts life more efficient
• To add rigour to an analysts workflow
Richard Pugh, Commercial [email protected]
Deploying Analytics
• Complex analytics shouldn’t be attempted by non-analysts
• BUT, adding analytics into a business process can mean more informed decisions can be made
Richard Pugh, Commercial [email protected]
Deploying Analytics
• If we build an application which …
• is easy for the decision maker to use
• contains the correct analysis to apply
• communicates analytical results in suitable manner
• … this leads to some major benefits!
Richard Pugh, Commercial [email protected]
Benefits for the Analyst
Benefits for the Decision Maker
No need to wait for information
Can perform “what if” analysis
Decision not dependent on analyst availability
Less need to perform often-repetitive tasks
Comfortable that the “right” analysis is being run
Can get on with more strategic things?
Richard Pugh, Commercial [email protected]
Why build Analytic Apps with R?
• R is license free (^infrastructure)
• R’s open nature means it can be readily integrated
• R can be extended by the developer as needed
• R is rapidly developed
• R users are more “development-aware” (?)
Richard Pugh, Commercial [email protected]
Challenges, Learnings etc …
Richard Pugh, Commercial [email protected]
Challenges, Learnings etc …
• This section contains some distilled messages for building analytic apps using R
Richard Pugh, Commercial [email protected]
Engage with the End User
Richard Pugh, Commercial [email protected]
Balance the “funk” with the “funktional”
Richard Pugh, Commercial [email protected]
Don’t let the tail wag the dog
Richard Pugh, Commercial [email protected]
Set up an environment that supports multi-tech development
Richard Pugh, Commercial [email protected]
Project Mgment Requirements
Behaviour Driven
Code Review
Review board
StatET
testthatroxygen2
Continuous Integration
Issue TrackingQuality Manual
Dev Procedures
Coding Standards
mangoUtils
Knowledge Mgment
Richard Pugh, Commercial [email protected]
How will you test it?
Richard Pugh, Commercial [email protected]
Levels of Test
R Java/Other
System Test Via Target Interface
Unit Test Function level Class Level
Module Test Package Level Integration Test
Continuous Integration
Richard Pugh, Commercial [email protected]
Build a good “crossover” team
Richard Pugh, Commercial [email protected]
Design the Connections
Richard Pugh, Commercial [email protected]
Make the analytics “extensible”
Richard Pugh, Commercial [email protected]
Some Case Studies
Richard Pugh, Commercial [email protected]
Mondelēz Coffee Optimiser
• Requirement: Coffee Optimisation Desktop Tool based on previous S+ application
• Technology: R, GTK+, RODBC• What went well: GTK+ helped us to easily
recreate the previous UI, MSI Installer helped• What was tricky: Balancing conversion and
extensions, Integration with third party optimiser
Richard Pugh, Commercial [email protected]
Richard Pugh, Commercial [email protected]
Modelling Evaluation
• Requirement: Web app to evaluate “PKPD” models
• Technology: R, Java, JSF, JavaScript, Oracle, …• What went well: Clear API to R, R session
balancing• What was tricky: Performance of R based on
constraints
Richard Pugh, Commercial [email protected]
Backtesting Application
• Requirement: Backtesting app for hedge fund• Technology: R, MySql, C, VBA• What went well: Users loved R, UI dropped, PDF
reporting• What was tricky: Devil was in the detail, storing
data in .RData files
Richard Pugh, Commercial [email protected]
Non-Compartmental Analysis
• Requirement: “NCA” workflow tool• Technology: R, R.Net, XAML, Infragistics, .NET• What went well: Clear API between R and app, • What was tricky: R.Net session management,
amount of unit tests to write
Richard Pugh, Commercial [email protected]
Summary
Richard Pugh, Commercial [email protected]
Summary
• Building analytic applications can be highly valuable• Some challenges in working in a multi-tech (read “multi-
style-of-tech” and “multi-type-of-developer”) environment• Requires lots of up front thinking (design, dev
environment, training etc)• If you’re planning to build an analytic app using R, we’d be
happy to lend our experience …
Richard Pugh, Commercial [email protected]