Go to Post So your gearbox failed, and your first course of action was to post about it CD? This is an interesting failure recovery plan. :) - JVN [more]
Home
Go Back   Chief Delphi > Competition > Rules/Strategy > Scouting
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Old 18-10-2016, 01:41
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by sirwin View Post
my solution is posted at https://irwinsnet.github.io/opr.html.

My method requires 13 seconds on a Surface 4 with an i5 process and 8 Gb of memory.
Reps to you for all the fine work

Reps to the first person who can cut that time in half.


Reply With Quote
  #17   Spotlight this post!  
Old 19-10-2016, 06:36
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,362
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by Ether View Post
Reps to you for all the fine work

Reps to the first person who can cut that time in half.
Cut 13 seconds in half? I'm excited that sirwin got it to work at all on that data set! At 13 seconds, the WOPR rankings can be recalculated between matches before the first verse of "Cotton eye Joe" gets played.

Good job sirwin on the code, and an even better write up of how you did it.
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
Reply With Quote
  #18   Spotlight this post!  
Old 19-10-2016, 08:57
sirwin sirwin is offline
Registered User
AKA: Stacy Irwin
FRC #1318 (Issaquah Robotics Society)
Team Role: Mentor
 
Join Date: May 2016
Rookie Year: 2016
Location: Bellevue, WA
Posts: 9
sirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of light
Re: R Package for Downloading FIRST API Data

With respect to speeding up the calculation, I had a thought.

It takes my algorithm 9 seconds to produce the 2696 x 2696 A matrix -- but updating the A matrix with new match data should be nearly instantaneous. For every new match, we just have to add 1 to 18 different elements in the A matrix (all other A matrix elements will remain unchanged). Each element of the a matrix is directly accessible by team numbers. So it takes 13 seconds to calculate world OPR from scratch, but as long as we retain the A matrix, it should only take about 5 seconds to update world OPR with new match data. That's 2 seconds for updating the A and B matrices and 3 seconds for solving for OPR.

Of course, this is assuming that R's underlying C code doesn't do anything stupid, like extracting an array element by going through every array element until it gets to the right one. Also, the A matrix would need to be maintained in memory -- disk access would slow things down.
Reply With Quote
  #19   Spotlight this post!  
Old 19-10-2016, 12:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by sirwin View Post
It takes my algorithm 9 seconds to produce the 2696 x 2696 A matrix
I like to call that symmetric positive definite 2696x2696 normal equations matrix the N matrix... to distinguish it from the 17842x2696 dichotomous design matrix A.

Ax = b .. overdetermined system of linear equations (has no exact solution)

N = A'*A
d = A'*b

Nx = d .. linear system of normal equations (whose solution is the least squares solution for Ax=b)



Reply With Quote
  #20   Spotlight this post!  
Old 19-10-2016, 18:50
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by Foster View Post
Cut 13 seconds in half?
OK, I was being generous. Cut it by a factor of 10. Seriously.



Reply With Quote
  #21   Spotlight this post!  
Old 23-10-2016, 16:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by Ether View Post
Cut it by a factor of 10. Seriously.
If there is any interest in learning how to do this within the R community please let me know and we can work it out together.


Reply With Quote
  #22   Spotlight this post!  
Old 25-10-2016, 15:31
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 136
Joey1939 will become famous soon enoughJoey1939 will become famous soon enough
Re: R Package for Downloading FIRST API Data

I took the world OPR data and made a graph.

EDIT: I made a better graph.
Attached Thumbnails
Click image for larger version

Name:	OPR Distribution 2.png
Views:	42
Size:	206.1 KB
ID:	21211  
__________________



Last edited by Joey1939 : 25-10-2016 at 15:41.
Reply With Quote
  #23   Spotlight this post!  
Old 29-10-2016, 11:24
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by Ether View Post
If there is any interest in learning how to do this within the R community please let me know and we can work it out together.
https://www.chiefdelphi.com/forums/s...09#post1614009



Reply With Quote
  #24   Spotlight this post!  
Old 31-12-2016, 12:30
sirwin sirwin is offline
Registered User
AKA: Stacy Irwin
FRC #1318 (Issaquah Robotics Society)
Team Role: Mentor
 
Join Date: May 2016
Rookie Year: 2016
Location: Bellevue, WA
Posts: 9
sirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of lightsirwin is a glorious beacon of light
Re: R Package for Downloading FIRST API Data

I created version 2.0.0 of the firstapiR package for downloading and manipulating FIRST API scouting data using the R language.

Here's a link:

http://irwinsnet.github.io

Once I started using the package to do OPR calculations, I realized it needed some improvements, specifically in how the data frames are shaped.

Stacy Irwin
Reply With Quote
  #25   Spotlight this post!  
Old 31-12-2016, 16:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data


@ Stacy: thanks for posting this. I just send you a PM.


Reply With Quote
  #26   Spotlight this post!  
Old 31-12-2016, 20:45
Skyehawk's Avatar
Skyehawk Skyehawk is offline
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 198
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by sirwin View Post
My method requires 13 seconds on a Surface 4 with an i5 process and 8 Gb of memory. It actually takes more time to create the A matrix (9 seconds) than it does to solve for the OPRs once the A and B matrices are prepared (3 seconds). The remaining second is required for reading the data and preparing the B matrix.
Stacy
I am aware I am beating a dead horse here , but using unmodified Sirwin's code I am getting ~12 seconds with an i7-6560U (2.2GHz) and 8gb of RAM, memory usage is low so we can eliminate that as a factor. The bottleneck is (unsurprisingly) CPU clock cycle speed.

I'm using firstapiR v2.0.0

Skye Leake
__________________
My time in FIRST has made me a better person, frankly I don't know where I'd be without it.



2011 Lake Superior Regional Champs
2015 Central Illinois Regional Engineering Inspiration Award recipients
2016 Central Illinois Regional Champs
Reply With Quote
  #27   Spotlight this post!  
Old 31-12-2016, 21:11
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by Skyehawk View Post
I am getting ~12 seconds with an i7-6560U (2.2GHz) and 8gb of RAM, memory usage is low so we can eliminate that as a factor. The bottleneck is (unsurprisingly) CPU clock cycle speed.
I am getting ~0.93 seconds on a 10-year-old Pentium D desktop running 32-bit XP with 1G RAM.


Reply With Quote
  #28   Spotlight this post!  
Old 31-12-2016, 21:24
Skyehawk's Avatar
Skyehawk Skyehawk is offline
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 198
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: R Package for Downloading FIRST API Data

I obviously am doing something not quite right...
__________________
My time in FIRST has made me a better person, frankly I don't know where I'd be without it.



2011 Lake Superior Regional Champs
2015 Central Illinois Regional Engineering Inspiration Award recipients
2016 Central Illinois Regional Champs
Reply With Quote
  #29   Spotlight this post!  
Old 31-12-2016, 21:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

Quote:
Originally Posted by Skyehawk View Post
I obviously am doing something not quite right...
Your results look about right for R code that uses dense matrix technology.

https://www.chiefdelphi.com/forums/s....php?p=1612297

https://www.chiefdelphi.com/forums/s....php?p=1612581

https://www.chiefdelphi.com/forums/s....php?p=1613118

https://www.chiefdelphi.com/forums/s....php?p=1614125



Last edited by Ether : 31-12-2016 at 22:09. Reason: added links
Reply With Quote
  #30   Spotlight this post!  
Old 01-01-2017, 11:50
Conor Ryan Conor Ryan is offline
I'm parking robot yacht club.
FRC #4571 (Robot Yacht Club)
Team Role: Mentor
 
Join Date: Nov 2004
Rookie Year: 2004
Location: Midtown, NYC
Posts: 1,888
Conor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond reputeConor Ryan has a reputation beyond repute
Re: R Package for Downloading FIRST API Data

In case anybody wants to learn R, here is a great way to get introduced http://swirlstats.com

Last edited by Conor Ryan : 01-01-2017 at 11:51. Reason: It's what we use when building models!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi