SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
KDB+ AND R INTEGRATIONRORY WINSTON
KDB+ AND R INTEGRATION
AGENDA
▸ Why integrate R/kdb+
▸ Basic R integration via CSV import/export
▸ R integration via qserver
▸ Integrating R math functionality into kdb+
▸ Generating kdb+ data with R
KDB+ AND R INTEGRATION
WHAT IS R?
▸ DSL For Statistical Techniques and
Data Analysis
▸ Integrated programming and EDA
(Exploratory Data Analysis)
environment
▸ Open-Source
▸ Thousands of contributed
packages
KDB+ AND R INTEGRATION
WHY USE R?
▸ Comprehensive Environment
▸ Tooling
▸ Command-Line
▸ IDE
▸ Web
▸ Thousands of Packages
▸ Rich Reporting/Graphing/Analysis Capabilities
KDB+ AND R INTEGRATION
PART ONE: CSV IMPORT/EXPORT
▸ CSV import/export
▸ In kdb+:
▸ save	`:table.csv	
▸ In R:
▸ read.csv(‘table.csv’,	header=TRUE)
EXAMPLE #1
CSV IMPORT/EXPORT
KDB+ AND R INTEGRATION
CSV IMPORT / EXPORT
▸ Simplest approach
▸ Interchange with any other system
▸ No type information
▸ Manual overhead
▸ Can be a slow/laborious process
KDB+ AND R INTEGRATION
PART TWO: THE QSERVER LIBRARY
▸ Available from
▸ http://code.kx.com/wsvn/code/cookbook_code/r/
▸ Consists of:
▸ A native library containing kdb+ connectivity
▸ An R wrapper
▸ Binaries for Windows/Linux/OSX
KDB+ AND R INTEGRATION
THE QSERVER LIBRARY
qserver
kdb+layer
Rlayer
KDB+ AND R INTEGRATION
BASIC QSERVER OPERATIONS
▸ Connect to a kdb+ instance:
▸ open_connection(	host,	port,	credentials	)	
▸ Returns a handle
▸ Execute a query:
▸ execute(	handle,	query	)	
▸ Close connection:
▸ close_connection(	handle	)
EXAMPLE #2
QSERVER
KDB+ AND R INTEGRATION
QSERVER INTEGRATION
▸ Most Efficient
▸ Can Manage Multiple Connections
▸ Can Be Wrapped Into An R Library
▸ Easy to Extend With Custom R Code
KDB+ AND R INTEGRATION
PART THREE: LEVERAGING THE R MATH LIBRARY
▸ R Comes With A Standalone Math Library
▸ Contains A Large Range Of Base Statistical/Math Routines
▸ E.g. Base Probability Functions/RNG
▸ Can Be Packaged Into a Library And Reused in kdb+
▸ I have packed a library and a set of routines on:
▸ https://github.com/rwinston/kdb-rmathlib
KDB+ AND R INTEGRATION
PART THREE: LEVERAGING THE R MATH LIBRARY
▸ Example In R:
▸ rnorm(1000,5,2)	
▸ Generates 1000 random variables with a mean of 5 and
standard deviation of 2
▸ In q, using the rmathlib integration:
▸ norm[1000;5;2]		
▸ R’s math library contains hundreds of useful base functions
EXAMPLE #3
RMATHLIB
KDB+ AND R INTEGRATION
USING R TO GENERATE Q CODE
▸ Generate q code from R
▸ Similar in principle to CSV export
▸ See
▸ http://www.theresearchkitchen.com/archives/776
EXAMPLE #4
Q CODE GENERATION
THANKS

Weitere ähnliche Inhalte

Was ist angesagt?

Mastering Hadoop Map Reduce - Custom Types and Other Optimizations
Mastering Hadoop Map Reduce - Custom Types and Other OptimizationsMastering Hadoop Map Reduce - Custom Types and Other Optimizations
Mastering Hadoop Map Reduce - Custom Types and Other Optimizationsscottcrespo
 
Managing large datasets in R – ff examples and concepts
Managing large datasets in R – ff examples and conceptsManaging large datasets in R – ff examples and concepts
Managing large datasets in R – ff examples and conceptsAjay Ohri
 
Python and R for quantitative finance
Python and R for quantitative financePython and R for quantitative finance
Python and R for quantitative financeLuca Sbardella
 
A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce
A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce
A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce Fabio Fumarola
 
Accumulo and the Convergence of Machine Learning, Big Data, and Supercomputing
Accumulo and the Convergence of Machine Learning, Big Data, and SupercomputingAccumulo and the Convergence of Machine Learning, Big Data, and Supercomputing
Accumulo and the Convergence of Machine Learning, Big Data, and SupercomputingAccumulo Summit
 
Frequent Itemset Mining(FIM) on BigData
Frequent Itemset Mining(FIM) on BigDataFrequent Itemset Mining(FIM) on BigData
Frequent Itemset Mining(FIM) on BigDataRaju Gupta
 
Ch 5: Introduction to heap overflows
Ch 5: Introduction to heap overflowsCh 5: Introduction to heap overflows
Ch 5: Introduction to heap overflowsSam Bowne
 
Mapreduce Algorithms
Mapreduce AlgorithmsMapreduce Algorithms
Mapreduce AlgorithmsAmund Tveit
 
pMatlab on BlueGene
pMatlab on BlueGenepMatlab on BlueGene
pMatlab on BlueGenevsachde
 
Implementation of p pic algorithm in map reduce to handle big data
Implementation of p pic algorithm in map reduce to handle big dataImplementation of p pic algorithm in map reduce to handle big data
Implementation of p pic algorithm in map reduce to handle big dataeSAT Publishing House
 
Introduction to Data Analtics with Pandas [PyCon Cz]
Introduction to Data Analtics with Pandas [PyCon Cz]Introduction to Data Analtics with Pandas [PyCon Cz]
Introduction to Data Analtics with Pandas [PyCon Cz]Alexander Hendorf
 
Data Stream Algorithms in Storm and R
Data Stream Algorithms in Storm and RData Stream Algorithms in Storm and R
Data Stream Algorithms in Storm and RRadek Maciaszek
 

Was ist angesagt? (18)

Mastering Hadoop Map Reduce - Custom Types and Other Optimizations
Mastering Hadoop Map Reduce - Custom Types and Other OptimizationsMastering Hadoop Map Reduce - Custom Types and Other Optimizations
Mastering Hadoop Map Reduce - Custom Types and Other Optimizations
 
Map and Reduce
Map and ReduceMap and Reduce
Map and Reduce
 
Managing large datasets in R – ff examples and concepts
Managing large datasets in R – ff examples and conceptsManaging large datasets in R – ff examples and concepts
Managing large datasets in R – ff examples and concepts
 
Python and R for quantitative finance
Python and R for quantitative financePython and R for quantitative finance
Python and R for quantitative finance
 
A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce
A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce
A Parallel Algorithm for Approximate Frequent Itemset Mining using MapReduce
 
Accumulo and the Convergence of Machine Learning, Big Data, and Supercomputing
Accumulo and the Convergence of Machine Learning, Big Data, and SupercomputingAccumulo and the Convergence of Machine Learning, Big Data, and Supercomputing
Accumulo and the Convergence of Machine Learning, Big Data, and Supercomputing
 
Frequent Itemset Mining(FIM) on BigData
Frequent Itemset Mining(FIM) on BigDataFrequent Itemset Mining(FIM) on BigData
Frequent Itemset Mining(FIM) on BigData
 
Ch 5: Introduction to heap overflows
Ch 5: Introduction to heap overflowsCh 5: Introduction to heap overflows
Ch 5: Introduction to heap overflows
 
Neo4j vs giraph
Neo4j vs giraphNeo4j vs giraph
Neo4j vs giraph
 
Hadoop map reduce concepts
Hadoop map reduce conceptsHadoop map reduce concepts
Hadoop map reduce concepts
 
Spark at-hackthon8jan2014
Spark at-hackthon8jan2014Spark at-hackthon8jan2014
Spark at-hackthon8jan2014
 
Mapreduce Algorithms
Mapreduce AlgorithmsMapreduce Algorithms
Mapreduce Algorithms
 
Big Data & Hadoop. Simone Leo (CRS4)
Big Data & Hadoop. Simone Leo (CRS4)Big Data & Hadoop. Simone Leo (CRS4)
Big Data & Hadoop. Simone Leo (CRS4)
 
pMatlab on BlueGene
pMatlab on BlueGenepMatlab on BlueGene
pMatlab on BlueGene
 
Implementation of p pic algorithm in map reduce to handle big data
Implementation of p pic algorithm in map reduce to handle big dataImplementation of p pic algorithm in map reduce to handle big data
Implementation of p pic algorithm in map reduce to handle big data
 
Introduction to Data Analtics with Pandas [PyCon Cz]
Introduction to Data Analtics with Pandas [PyCon Cz]Introduction to Data Analtics with Pandas [PyCon Cz]
Introduction to Data Analtics with Pandas [PyCon Cz]
 
Map Reduce
Map ReduceMap Reduce
Map Reduce
 
Data Stream Algorithms in Storm and R
Data Stream Algorithms in Storm and RData Stream Algorithms in Storm and R
Data Stream Algorithms in Storm and R
 

Andere mochten auch

Henyong Pinoy....
Henyong Pinoy.... Henyong Pinoy....
Henyong Pinoy.... rzurias
 
Konsep I/O pada Pemrograman Berorientasi Obyek
Konsep I/O pada Pemrograman Berorientasi ObyekKonsep I/O pada Pemrograman Berorientasi Obyek
Konsep I/O pada Pemrograman Berorientasi Obyekdrmjaya
 
Cantare E' D'amore
Cantare E' D'amoreCantare E' D'amore
Cantare E' D'amoreMakala (D)
 
La calidad de la salud en colombia
La calidad de la salud en colombiaLa calidad de la salud en colombia
La calidad de la salud en colombiaDiego Gaviria
 
Food for Orphans 2016 Results
Food for Orphans 2016 ResultsFood for Orphans 2016 Results
Food for Orphans 2016 ResultsSamuel Theagene
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017ElifTech
 
Power point tema 8 lengus
Power point tema 8 lengusPower point tema 8 lengus
Power point tema 8 lengusbelendr1993
 
Facts on Ebola Virus Outbreak: Symptoms and Prevention Tips
Facts on Ebola Virus Outbreak: Symptoms and Prevention TipsFacts on Ebola Virus Outbreak: Symptoms and Prevention Tips
Facts on Ebola Virus Outbreak: Symptoms and Prevention TipsOwich Ben
 
In their shoes: making guest experience great
In their shoes: making guest experience greatIn their shoes: making guest experience great
In their shoes: making guest experience greatRoger Hernandez
 
I Kiss Your Hand Madame
I Kiss Your Hand MadameI Kiss Your Hand Madame
I Kiss Your Hand MadameMakala (D)
 
How to-use-dropbox
How to-use-dropboxHow to-use-dropbox
How to-use-dropboxgacrisologo
 

Andere mochten auch (17)

Henyong Pinoy....
Henyong Pinoy.... Henyong Pinoy....
Henyong Pinoy....
 
Konsep I/O pada Pemrograman Berorientasi Obyek
Konsep I/O pada Pemrograman Berorientasi ObyekKonsep I/O pada Pemrograman Berorientasi Obyek
Konsep I/O pada Pemrograman Berorientasi Obyek
 
Cantare E' D'amore
Cantare E' D'amoreCantare E' D'amore
Cantare E' D'amore
 
La calidad de la salud en colombia
La calidad de la salud en colombiaLa calidad de la salud en colombia
La calidad de la salud en colombia
 
EDUCACIONPresentacion
EDUCACIONPresentacionEDUCACIONPresentacion
EDUCACIONPresentacion
 
Cálculo once
Cálculo onceCálculo once
Cálculo once
 
Food for Orphans 2016 Results
Food for Orphans 2016 ResultsFood for Orphans 2016 Results
Food for Orphans 2016 Results
 
Clase1
Clase1Clase1
Clase1
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017
 
Power point tema 8 lengus
Power point tema 8 lengusPower point tema 8 lengus
Power point tema 8 lengus
 
נראות נשים 2017
נראות נשים 2017נראות נשים 2017
נראות נשים 2017
 
Facts on Ebola Virus Outbreak: Symptoms and Prevention Tips
Facts on Ebola Virus Outbreak: Symptoms and Prevention TipsFacts on Ebola Virus Outbreak: Symptoms and Prevention Tips
Facts on Ebola Virus Outbreak: Symptoms and Prevention Tips
 
In their shoes: making guest experience great
In their shoes: making guest experience greatIn their shoes: making guest experience great
In their shoes: making guest experience great
 
Aula 02
Aula 02Aula 02
Aula 02
 
Gypsy Girl
Gypsy Girl Gypsy Girl
Gypsy Girl
 
I Kiss Your Hand Madame
I Kiss Your Hand MadameI Kiss Your Hand Madame
I Kiss Your Hand Madame
 
How to-use-dropbox
How to-use-dropboxHow to-use-dropbox
How to-use-dropbox
 

Ähnlich wie KDB+/R Integration

GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay ModernBrad Pillow
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay ModernBrad Pillow
 
The Powerful Marriage of Hadoop and R (David Champagne)
The Powerful Marriage of Hadoop and R (David Champagne)The Powerful Marriage of Hadoop and R (David Champagne)
The Powerful Marriage of Hadoop and R (David Champagne)Revolution Analytics
 
Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...
Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...
Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...Cloudera, Inc.
 
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKIntroduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKSkills Matter
 
Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014soujavajug
 
MADlib Architecture and Functional Demo on How to Use MADlib/PivotalR
MADlib Architecture and Functional Demo on How to Use MADlib/PivotalRMADlib Architecture and Functional Demo on How to Use MADlib/PivotalR
MADlib Architecture and Functional Demo on How to Use MADlib/PivotalRPivotalOpenSourceHub
 
Big Data - Lab A1 (SC 11 Tutorial)
Big Data - Lab A1 (SC 11 Tutorial)Big Data - Lab A1 (SC 11 Tutorial)
Big Data - Lab A1 (SC 11 Tutorial)Robert Grossman
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016Brad Pillow
 
Microsoft R Server for Data Sciencea
Microsoft R Server for Data ScienceaMicrosoft R Server for Data Sciencea
Microsoft R Server for Data ScienceaData Science Thailand
 
RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)Daniel Nüst
 
PyconJP: Building a data preparation pipeline with Pandas and AWS Lambda
PyconJP: Building a data preparation pipeline with Pandas and AWS LambdaPyconJP: Building a data preparation pipeline with Pandas and AWS Lambda
PyconJP: Building a data preparation pipeline with Pandas and AWS LambdaFabian Dubois
 
Pig - A Data Flow Language and Execution Environment for Exploring Very Large...
Pig - A Data Flow Language and Execution Environment for Exploring Very Large...Pig - A Data Flow Language and Execution Environment for Exploring Very Large...
Pig - A Data Flow Language and Execution Environment for Exploring Very Large...DrPDShebaKeziaMalarc
 
PostgreSQL and Redis - talk at pgcon 2013
PostgreSQL and Redis - talk at pgcon 2013PostgreSQL and Redis - talk at pgcon 2013
PostgreSQL and Redis - talk at pgcon 2013Andrew Dunstan
 
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightEnterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightPaco Nathan
 

Ähnlich wie KDB+/R Integration (20)

GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
 
GraphQL and Relay Modern
GraphQL and Relay ModernGraphQL and Relay Modern
GraphQL and Relay Modern
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
 
The Powerful Marriage of Hadoop and R (David Champagne)
The Powerful Marriage of Hadoop and R (David Champagne)The Powerful Marriage of Hadoop and R (David Champagne)
The Powerful Marriage of Hadoop and R (David Champagne)
 
Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...
Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...
Hadoop World 2011: The Powerful Marriage of R and Hadoop - David Champagne, R...
 
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKIntroduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
 
Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014
 
To AWS with Ansible
To AWS with AnsibleTo AWS with Ansible
To AWS with Ansible
 
MADlib Architecture and Functional Demo on How to Use MADlib/PivotalR
MADlib Architecture and Functional Demo on How to Use MADlib/PivotalRMADlib Architecture and Functional Demo on How to Use MADlib/PivotalR
MADlib Architecture and Functional Demo on How to Use MADlib/PivotalR
 
Big Data - Lab A1 (SC 11 Tutorial)
Big Data - Lab A1 (SC 11 Tutorial)Big Data - Lab A1 (SC 11 Tutorial)
Big Data - Lab A1 (SC 11 Tutorial)
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016
 
Spark core
Spark coreSpark core
Spark core
 
Microsoft R Server for Data Sciencea
Microsoft R Server for Data ScienceaMicrosoft R Server for Data Sciencea
Microsoft R Server for Data Sciencea
 
RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)
 
PyconJP: Building a data preparation pipeline with Pandas and AWS Lambda
PyconJP: Building a data preparation pipeline with Pandas and AWS LambdaPyconJP: Building a data preparation pipeline with Pandas and AWS Lambda
PyconJP: Building a data preparation pipeline with Pandas and AWS Lambda
 
R- Introduction
R- IntroductionR- Introduction
R- Introduction
 
Pig - A Data Flow Language and Execution Environment for Exploring Very Large...
Pig - A Data Flow Language and Execution Environment for Exploring Very Large...Pig - A Data Flow Language and Execution Environment for Exploring Very Large...
Pig - A Data Flow Language and Execution Environment for Exploring Very Large...
 
pig.ppt
pig.pptpig.ppt
pig.ppt
 
PostgreSQL and Redis - talk at pgcon 2013
PostgreSQL and Redis - talk at pgcon 2013PostgreSQL and Redis - talk at pgcon 2013
PostgreSQL and Redis - talk at pgcon 2013
 
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightEnterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
 

Mehr von Rory Winston

Building A Trading Desk On Analytics
Building A Trading Desk On AnalyticsBuilding A Trading Desk On Analytics
Building A Trading Desk On AnalyticsRory Winston
 
The Modern FX Desk
The Modern FX DeskThe Modern FX Desk
The Modern FX DeskRory Winston
 
An Analytics Toolkit Tour
An Analytics Toolkit TourAn Analytics Toolkit Tour
An Analytics Toolkit TourRory Winston
 
Creating R Packages
Creating R PackagesCreating R Packages
Creating R PackagesRory Winston
 
Streaming Data and Concurrency in R
Streaming Data and Concurrency in RStreaming Data and Concurrency in R
Streaming Data and Concurrency in RRory Winston
 
Real-TIme Market Data in R
Real-TIme Market Data in RReal-TIme Market Data in R
Real-TIme Market Data in RRory Winston
 

Mehr von Rory Winston (6)

Building A Trading Desk On Analytics
Building A Trading Desk On AnalyticsBuilding A Trading Desk On Analytics
Building A Trading Desk On Analytics
 
The Modern FX Desk
The Modern FX DeskThe Modern FX Desk
The Modern FX Desk
 
An Analytics Toolkit Tour
An Analytics Toolkit TourAn Analytics Toolkit Tour
An Analytics Toolkit Tour
 
Creating R Packages
Creating R PackagesCreating R Packages
Creating R Packages
 
Streaming Data and Concurrency in R
Streaming Data and Concurrency in RStreaming Data and Concurrency in R
Streaming Data and Concurrency in R
 
Real-TIme Market Data in R
Real-TIme Market Data in RReal-TIme Market Data in R
Real-TIme Market Data in R
 

Kürzlich hochgeladen

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 

Kürzlich hochgeladen (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 

KDB+/R Integration

  • 1. KDB+ AND R INTEGRATIONRORY WINSTON
  • 2. KDB+ AND R INTEGRATION AGENDA ▸ Why integrate R/kdb+ ▸ Basic R integration via CSV import/export ▸ R integration via qserver ▸ Integrating R math functionality into kdb+ ▸ Generating kdb+ data with R
  • 3. KDB+ AND R INTEGRATION WHAT IS R? ▸ DSL For Statistical Techniques and Data Analysis ▸ Integrated programming and EDA (Exploratory Data Analysis) environment ▸ Open-Source ▸ Thousands of contributed packages
  • 4. KDB+ AND R INTEGRATION WHY USE R? ▸ Comprehensive Environment ▸ Tooling ▸ Command-Line ▸ IDE ▸ Web ▸ Thousands of Packages ▸ Rich Reporting/Graphing/Analysis Capabilities
  • 5. KDB+ AND R INTEGRATION PART ONE: CSV IMPORT/EXPORT ▸ CSV import/export ▸ In kdb+: ▸ save `:table.csv ▸ In R: ▸ read.csv(‘table.csv’, header=TRUE)
  • 7. KDB+ AND R INTEGRATION CSV IMPORT / EXPORT ▸ Simplest approach ▸ Interchange with any other system ▸ No type information ▸ Manual overhead ▸ Can be a slow/laborious process
  • 8. KDB+ AND R INTEGRATION PART TWO: THE QSERVER LIBRARY ▸ Available from ▸ http://code.kx.com/wsvn/code/cookbook_code/r/ ▸ Consists of: ▸ A native library containing kdb+ connectivity ▸ An R wrapper ▸ Binaries for Windows/Linux/OSX
  • 9. KDB+ AND R INTEGRATION THE QSERVER LIBRARY qserver kdb+layer Rlayer
  • 10. KDB+ AND R INTEGRATION BASIC QSERVER OPERATIONS ▸ Connect to a kdb+ instance: ▸ open_connection( host, port, credentials ) ▸ Returns a handle ▸ Execute a query: ▸ execute( handle, query ) ▸ Close connection: ▸ close_connection( handle )
  • 12. KDB+ AND R INTEGRATION QSERVER INTEGRATION ▸ Most Efficient ▸ Can Manage Multiple Connections ▸ Can Be Wrapped Into An R Library ▸ Easy to Extend With Custom R Code
  • 13. KDB+ AND R INTEGRATION PART THREE: LEVERAGING THE R MATH LIBRARY ▸ R Comes With A Standalone Math Library ▸ Contains A Large Range Of Base Statistical/Math Routines ▸ E.g. Base Probability Functions/RNG ▸ Can Be Packaged Into a Library And Reused in kdb+ ▸ I have packed a library and a set of routines on: ▸ https://github.com/rwinston/kdb-rmathlib
  • 14. KDB+ AND R INTEGRATION PART THREE: LEVERAGING THE R MATH LIBRARY ▸ Example In R: ▸ rnorm(1000,5,2) ▸ Generates 1000 random variables with a mean of 5 and standard deviation of 2 ▸ In q, using the rmathlib integration: ▸ norm[1000;5;2] ▸ R’s math library contains hundreds of useful base functions
  • 16. KDB+ AND R INTEGRATION USING R TO GENERATE Q CODE ▸ Generate q code from R ▸ Similar in principle to CSV export ▸ See ▸ http://www.theresearchkitchen.com/archives/776
  • 17. EXAMPLE #4 Q CODE GENERATION