Oracle DV for Data Scientists – Part II: Modifying Advanced Analytic/R Scripts

Something I enjoy doing in software is opening the different components of a tool. Here’s an example of what I mean… Say I have a Data Visualization Desktop project that I have exported. I want to see what is in the export, so I unzip all the contents of the .dva to a folder.

1

Okay, cool. I have the project “guts”.

2

But what about other pieces that aren’t outputs, but pieces of the software puzzle? Since we proudly advertise that you can bring your own R scripts to DV, what should that file look like? The folder “script_repository” holds the key. Here you can see all the different Advanced Analytics and R scripts available to you for DV. Note that I have downloaded all possible R plugins from the Oracle BI Public Store, which is why I may have more scripts than you.

How about if you are just curious as to how the scripts work?

3

Taking “R.Correlation.xml” as an example, in your favorite text editor, you can see notes about the script as well as different options. Since there is more than one kind of correlation calculation, this particular script gives you the option to choose between Pearson, Kendall, and Spearman.

4

The default is Pearson.

5

In our custom calculation in DV, I am using R.CorrelationPlot.xml to calculate my data.

6

Here are the results from my correlation calculation. Note that also talked about this graph and how to use download plugins in a previous post.

7

Let’s say I wanted to use the Kendall calculation for correlation. Based on the script notes, I can change the option in this section for the script “R.CorrelationPlot.xml” that I referenced in my custom calculation.

8

I get the same results as before (based on the same dataset), but since it did not error out (ha), I can confirm that the script still works with the new option.

9

And for those R lovers out there, if you are curious as to the actual code used, it is at the bottom in the CDATA section.

10

All this to say… I encourage you to take a look at each of the XML scripts in the script_repository folder to see what options are available to you. You may not have to write a brand new script; perhaps you can modify one already available to you! Also, you can learn how DV processes advanced analytics and R scripts. You can even start your journey towards learning R by reverse engineering the code. 🙂 Each DVD installation comes with the option to install advanced analytics, and with this installation comes an installation of the R GUI. Take time to play with this if you are curious about data science…

More on using custom R scripts to come…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s