How to import a GraphML to JGraphT - jgrapht

JGraphT has a GraphMLExporter that enables to export a graph to a GraphML file.
There doesn't seem to be a GraphMLImporter.
Is there a simple way to generate a graph in JGraphT from a .grphml file?

Starting from version 1.0.0 JGraphT has both an importer and an exporter for GraphML. The classes are named GraphMLImporter and GraphMLExporter inside the jgrapht-ext package.
Starting from version 1.1 all importers and exporters are located in the jgrapht-io package. Additionally, a simpler version called SimpleGraphMLImporter which provides less functionality in favor of greater speed is also available in latest versions.
A demo is also available, see GraphMLDemo.

Check out jgrapht-sna project. Beside implementations of SNA algorithms, it has GraphMLImporter class.

Related

How to update statsmodels to 0.13.0.dev0 version (to use OrderedModel module)?

What I was trying to do?
I was trying to analyze data using ordinal logistic regression. For that, I tried to import OrderedModel from statsmodels.miscmodels.ordinal_model as suggested by this doc.
Then, what is the problem?
After execution of the above mentioned import statement, I got the following error.
No module named 'statsmodels.miscmodels.ordinal_model'
How did I try to solve the problem?
First of all, I checked the statsmodels version, I am using. I find that I am using the latest version (0.12.1), available in Anaconda. From this doc, I perceive that I will need to use 0.13.0.dev0 version to get the OrderedModel module, as in v0.12.1, there is no folder/file named OrderedModel. However, I do not find any way to update the statsmodels to 0.13.0.dev0 version.
Then, my question
How can I update statsmodels to 0.13.0.dev0 version so that I can use OrderedModel module?
Note: I know that in Python, there are some other ways to do ordinal logit regression. However, I want to use statsmodels due to it's nice summary of analysis.
Thanks in advance!
You can install a recent build from the nightly wheel repository hosted on Anaconda.org.
Run pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple statsmodels.
It looks like you will need to compile from the GitHub. See prior related question here:
How to update to the developer version of statsmodels using Conda?

Can Tensorflow.js be used for face recognition?

There is a python and C++ api available for doing image recognition.The tutorial is provided in tensorflow.org but as tensorflow.js is released few months back only does it support all the api's available in the python and c++ implementation.
Vincent Mühler has created face-api.js, a JavaScript API base on tensorflow.js. You can find out the blog & code on the links below.
https://itnext.io/face-api-js-javascript-api-for-face-recognition-in-the-browser-with-tensorflow-js-bcc2a6c4cf07
https://github.com/justadudewhohacks/face-api.js
Adding to the answers above, tensorflow on JavaScript can be quite slow. Here's a quick comparison:
However, If you do run tensorflow.js on Node, you could make use of the binding directly to the TensorFlow APIs written in C which would be fast. You could also run the CUDA versions if you import the right packages on Node.js
On the browser WebGL is used to run tensorflow. Using the tensorflow or some ML on the browser, opens up whole new opportunities to do things from right within the browser.
As Jirapol suggested, you could take a look at https://github.com/justadudewhohacks/face-api.js which is super easy to use. It actually took a very short while for me to start writing a facial recognition login system on node using face-api.js. Here's a link if you want to take a look at the unfinshed code: https://github.com/WinstonMarvel/face-recognition-authentication
does it support all the api's available in the python and c++ implementation.
No, it still has a limited amount of features. Keep in mind it still in version 0.11.6 so that will change. You can look at the documentation to see what's available.
If you want to port a specific model to tfjs try to get it as a keras model then convert it using tensorflowjs_converter to a tfjs compatible one like this tutorial shows.
There is even a tfjs examples which works with webcam data (Tutorial, Live Demo), so you could look into that to start.
Yes it can.
and also with the help of webassembly and SIMD in the browser.
you can have a smooth experience of image processing and video processing in the browser.
have a look at this link from google v8.
the good news is that with the same api you can run Tensorflow.js in the browser, node.js and React Native all with the native speed and using native capabilities

Flink scala project depends on flink java project so java map called instead of scala map

I want to create a flink project written in scala.
when i importing
'flink-scala_2.11',
'flink-streaming-scala_2.11'
'flink-core',
i can run a code like:
val someEventScalaStream = myScalaStreamm.map{x=>x.Part3} (it is using scala map function)
but i see that for each:
flink-connector-rabbitmq_2.11
flink-connector-filesystem_2.11
flink-clients_2.11
all of them depends on 'flink-java'
so when all of them imported into my solution the project is trying to use the map function of the java version & doesn't compile.
any solution?
thanks.
Generally apis for java and scala are put into separate packages. So make sure you use the right one. E.g. for DataStream you have
Java:
org.apache.flink.streaming.api.datastream.DataStream
Scala:
org.apache.flink.streaming.api.scala.DataStream
In this case in scala it is recommended to import:
org.apache.flink.streaming.api.scala._
If that does not cover your question could you post a concrete example when a java version of a map function is used?

Is it possible to embed a package without to copy it?

Say there we have the package encoding/json. Can I just create a package mypackage and embed all the functions (at least the public functions) into my package without to copy them by hand and basically do calls back to the actual json package? I'm developing a cross platform (Google app engine / native ) solution and I would find a such solution quite useful.
No.
It sounds like you want some sort of package inheritance, this is not a supported feature.

lightwave 3d 9.6 sdk trouble

Are there tutorials for the SDK (or at least an example), about how to create an export plugin (extract polygons from scene)?
In Lightwave, you're not forced to write an export plugin to extract the polygons from a scene/object : the LWO and LWS are documented (enough) to parse them quite easily.
The file formats documentation are in filefmts folder of the SDK. You can find libs that parse Lightwave files also, such as Open Asset Import library.
If you still need to do it as a plugin, there's a sample plugin for Modeler, in the sample/Modeler/Input-Output/vidscape folder.
You can find a reasonable amount of LW export plugins on the web. Some of them are compiled .p plugins, but some are Python .py or LScript *.ls. Two latter can be edited and tweaked with text editor of your choice to individual needs quite easily.
There are wikis on the web about Lightwave API commands available from script as well.

Resources