Is it possible to download graph of scalars in TensorBoard? - r

I'm using Tensorboard to visualize the training of a neural network in R. Tensorboard gives really nice graphs of the accuracy, the loss, validation accuracy etcetera. I would like to download these graphs (including smoothing and legend) just like one can download the graph of the nodes. Is this possible? I know that you can download the data one by one, but then you would have to make the graph manually including the smoothing and legend. This would be a lot of work, while you already have such a nice looking graph. I have tried using SVG Crowbar, but I don't know which one to download (if this even works...). I do not know what to do. The best solution thus far seems to be using printscreen and paint.
Thanks in advance for helping me!

Related

Visualisation for hierarchically clustered graph on map in python

I am starting a new project in python (to be used through jupyter-notebooks), where I'll need to visualise some hierarchically clustered graphs.
I have looked for existing packages, but so far I am not convinced by what I have seen.
I am not interested in the clustering process in itself, because this will be another part of the project and I know (roughly) how the graphs will be built up progressivelly.
What I am looking for are:
an appropriate data structure for storing hierarchically clustered graphs,
visualisation tools that would allow to represent the graph on a map (based on X and Y coordinates of the nodes) and either represent the subparts of the clusters, or simplify the clusters depending on their type or depth in the graph structure,
ideally, bring some interactivity, for example the ability to zoom-in or-out, or click on some clustered nodes to expand the nodes that were hidden in the cluster.
It looks pretty specific and despite some cool packages I have seen I am not sure which one would help without having too much to reimplement. So far, NetworkX looks like a cool starting point, especially with some D3.js (as shown here), but it is still far from what I have in mind.
Any advice about where to start digging?
Thanks a lot.
Gautier
For Python, Seaborn's clustermaps are nice. Seaborn is mainly meant to be used with Pandas dataframes; however, the documentation for clustermap says it can be rectangular data, and so I think it means other arrays will wor.
See also:
Dendrogram with heat map
SciPy Hierarchical Clustering and Dendrogram Tutorial
Hierarchical Clustering in Python

Plot 3D graphs in R-studio

Sorry for the question, but I have a variable that I would like to plot like this:
I am a newby on R, so I am having some difficulties. I appreciate any kind of help.
Thanks!
Since you're looking to plot what appears to be a 3d surface, I'd suggest starting with the persp function, from the graphics package. This blog post (http://www.r-bloggers.com/3d-plots-in-r/) gives a good treatment of several options for 3D plotting:
the generic function persp() in the base graphics package draws perspective plots of a surface over the x–y plane. Typing demo(persp) at the console will give you an idea of what this function can do.
And running demo(persp) gives you a number of examples, including this one:
There are also some more suggestions for going further:
The plot3D package from Karline Soetaert builds on on persp()to provide functions for both 2D and 3D plotting. [...] Load the package and type the following commands at the console: example(persp3D), example(surf3D) and example(scatter3D) to see examples of 3D surface and scatter plots.
As a side note, #rawr's comment is spot on - I found all this in less than a minute, using two google searches - one of which was the title of your post. I'm putting this answer up anyway, since StackOverflow posts frequently become the top google result for many topics. But the best advice I can give you going forward is that R is one of the most aggressively well-documented languages out there, both in terms of formal and informal documentation, and you can find a lot just by googling what you want to do.

How do I visualise an arbitrary directed acyclic graph?

I'm looking for an algorithm to automatically visualise a large DAG. It needs to scale well to hundreds or even thousands of nodes and connections (without turning unreadable). Connections should avoid crossing over each other where possible, and should especially avoid crossing over nodes that they aren't connected to.
Is there any standard algorithm I can adapt for this purpose?
You could check out the scalable force-directed placement algorithm. Graphviz implements this, so if you'd like to preview it before implementing, create a Graphviz file and run sfdp my_dag.gv (or fdp which might be easier to implement).
If that doesn't work for you, you might want something like Circos or Hive Plots. Hive Plots work really well for thousands of nodes for both directed and undirected graphs. The algorithm is described at a high level on the homepage, but there's an accompanying journal article too.
You can try Gephi a graph viz software.
You can feed it with different file type (.gexf, .gdf).
As this is a open source software, you can look inside spatialization algorithms.
url: http://gephi.org/

Plotting large numbers with R, but not all numbers are being shown

I am trying to render 739455 data point on a graph using R, but on the x-axis I can not view all those numbers, is there a way I can do that?
I am new to R.
Thank you
As others suggested, try hist, hexbin, plot(density(node)), as these are standard methods for dealing with more points than pixels. (I like to set hist with the parameter breaks = "FD" - it tends to have better breakpoints than the default setting.)
Where you may find some joy is in using the iplots package, an interactive plotting package. The corresponding commands include ihist, iplot, and more. As you have a Mac, the more recent Acinonyx package may be even more fun. You can zoom in and out quite easily. I recommend starting with the iplots package as it has more documentation and a nice site.
If you have a data frame with several variables, not just node, then being able to link the different plots such that brushing points in one plot highlights them in another will make the whole process more stimulating and efficient.
That's not to say that you should ignore hexbin and the other ideas - those are still very useful. Be sure to check out the options for hexbin, e.g. ?hexbin.

Visualizing a DAG

I have a large directed acyclic graph that I would like to visualize in a bitmap image.
Ideally I'd like to have all the root nodes at the top of the image, and all of the leaf nodes at the bottom, i.e. the graph edges are all pointing in a downwards direction.
Is there a good algorithm for working out the coordinates of all the nodes that meets these constraints and will produce a good visualization?
I advise you to use Gephi.
This soft is able to do all the things you want to, especially graph layouts !
Look at the Graphviz software collection. It contains several programs to render graphs.
The most simple way is to write your graph to disk, in one of Graphviz's text formats. Then execute one of the render programs, and load the resulting image into your application.
Bayesian Networks have similar requirements. You might look for algorithms for Bayesian Networks. This paper for example might be helpful.
If the graph is fairly simply then bitmaps will serve you fairly well. For very dense graphs however you'll want something with vector graphics, such as a SVG file that will support zooming in and out of fine details in a more friendly manner. Better yet is to use an interactive tool dedicated to navigating a graph such as gephi like someone mentioned above or yED
If you're trying to visualize a software dependency graph the best tool I've found for navigating is the DGML tools that are part of Visual Studio. They use a very powerful Sugiyama tree layout that does a fine job of making the flow of the graph directional. They have powerful interactive features with these edge hopping links that are bar none. You can also organize subgraphs and collapse them down, etc.
There's several graph description languages covered in Wikipedia with checking out
https://en.wikipedia.org/wiki/Category:Graph_description_languages. If you have a good chunk of RAM the DGML tools can render very pleasantly and make the interaction and exploration of the graph very intuitive.
There's a decent overview of layout techniques to be seen here particularly #2 Layered Graph Drawing from Kozo Sugiyama.
You might be interested in layered graph drawing (also known as "hierarchical graph drawing" or "Sugiyama-style graph drawing"). The algorithm is too long to describe here, but Google searches bring up many reliable explanations.
You can try this Go package I wrote: https://github.com/h8liu/e8tools/tree/master/dagvis
An example: http://lonnie.io/gostd/dagvis/

Resources