3
$\begingroup$

Sorry, if this topic is not connected directly to Data Science.

I want to understand how the Graphlab tool works. Firstly I want to execute the toy examples from the Gallery site. When I try to execute the example code, everything is OK except one command: I can not see the graphlab plot after show(). The command show() returns to me some kind of object in IPython and nothing in the IPython Notebook.

If the example code has the plot, which depends directly on the matplotlib module, I can produce the real plots and save it on my machine. Consequently, I suppose the main error depends on the graphlab (or object from its class). If somebody already used this tool and rendered the plot, can he/she tell me, how I can execute the plots command?

In [8]: import graphlab

In [9]: from IPython.display import display

        from IPython.display import Image

        graphlab.canvas.set_target('ipynb')

In [10]:import urllib

        url = 'https://s3.amazonaws.com/GraphLab-Datasets/americanMovies   /freebase_performances.csv'

        urllib.urlretrieve(url, filename='freebase_performances.csv')  # downloads an 8MB file to the working directory

Out[10]: ('freebase_performances.csv', <httplib.HTTPMessage instance at 0x7f44e153cf38>)

In [11]: data = graphlab.SFrame.read_csv('remote://freebase_performances.csv', column_type_hints={'year': int})

... ... ...

In [15]:data.show()

No plot after this line ... ...

In [19]:print data.show()

<IPython.core.display.Javascript object at 0x7f44e14c0850>

The object of graphlab (?) after print command

$\endgroup$
  • $\begingroup$ It is a known issue in GraphLab Create 1.0.1 and earlier that the visualization output will not show in an IPython Notebook running over HTTPS. If you are using HTTPS, try over HTTP instead. This will be fixed in a future release of GraphLab Create. $\endgroup$ – Zach Oct 28 '14 at 17:56
  • $\begingroup$ I am also facing the same issue, When I have set the target as browser, it opened a new tab and display the charts and data but when using graphlab.canvas.set_target('ipynb'), nothing happened. I am using - Python 2.7 Jupyter Notebook Graphlab create 1.21 $\endgroup$ – Atul Singh Nov 28 '16 at 2:06
3
$\begingroup$

I have found some solution and will post it here, because somebody, who works with graphlab, can have the same question.

We can look at the example here: Six degrees of Kevin Bacon

At te beginning of the program execution you need to run next command:

graphlab.canvas.set_target('ipynb')

Exactly this is a key of the whole problem (at least by me:-)

At the beginning it is important to know, which parameter of set_target() command you want to execute. You can use two options for argument of this command: 'ipynb' (which is executed direct in iPython Notebook, like in example) or 'browser' (which open the new window with the plots) On my machine 64-bit, Ubuntu, I can not use the command 'ipynb'. Only the 'browser'-command get me the plot back. I don't think, it is necessary to change https to http, but you can do it anyway. We have also the other machine by us (32-bit, Ubuntu) and it executes the other command 'ipynb', but not 'browser' (without to change https to http)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.