Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load and view your data? #15

Open
tastyminerals opened this issue Jul 19, 2017 · 19 comments
Open

How to load and view your data? #15

tastyminerals opened this issue Jul 19, 2017 · 19 comments

Comments

@tastyminerals
Copy link

tastyminerals commented Jul 19, 2017

After reading through all the interesting technicalities on what the facets is I decided to try it on one of my datasets and realized that I still don't know how to load and view the data? Is there a normal tutorial that basically says: if you have a dataset D, do a, b and c, voilà ?

@venkatesh-1729
Copy link

Here you go for facets dive:

from IPython.core.display import display, HTML
import pandas as pd

from sklearn.datasets import load_boston
boston_data = load_boston()

df = pd.DataFrame(boston_data['data'], columns=boston_data['feature_names'])
jsonstr = df.to_json(orient='records')

HTML_TEMPLATE = \
    """
        <link rel="import" href="/nbextensions/facets-dist/facets-jupyter.html">
        <facets-dive id="elem_id" height="600"></facets-dive>
        <script>
          var data = {jsonstr};
          document.querySelector("#elem_id").data = data;
        </script>
    """
html = HTML_TEMPLATE.format(jsonstr=jsonstr)
display(HTML(html))

@fils
Copy link

fils commented Jul 19, 2017

Is there a similar example on how to download, build and view via a web browser? I was able to install bazel and rebuild for Jupyter, but not seeing a path to build and run in a browser. Any help appreciated, this looks useful to me and others I know. Thanks.

@jameswex
Copy link
Collaborator

jameswex commented Jul 19, 2017

Right now the best examples of how to embed the visualizations into a website are the demo pages (https://pair-code.github.io/facets/index.html and https://pair-code.github.io/facets/quickdraw.html). The code for those pages can be found in this project's gh-pages branch (https://github.com/PAIR-code/facets/tree/gh-pages)

The basic idea is that you can build facets.html with "bazel build facets:facets" from the top-level directory. Then that facets.html can be imported into another page (such as the index.html and quickdraw.html from the gh-pages branch) and the and polymer elements can then be used in that page.

In the future, we can create some documentation clarifying this.

@tastyminerals
Copy link
Author

tastyminerals commented Jul 19, 2017

These are not examples but a showcase of facets visualization features. I understand examples as instructions on how to use the toolkit locally.

Right now there is too much work to get it up and running tbo and it is easier (for me at least) to shove my data into prewritten R script and plot it. Unless I have a very high need to analyze the dataset samples in the very detail.

@anna-mo
Copy link

anna-mo commented Jul 28, 2017

@jameswex i was puzzled by that i had build facets.html,and index.html also imports it, but not only the examples of the index.html did not display but the function of upload csv files didn't work, i'm curious what should i do to make the index.html work smoothly on my computer locally.

@rahulkhul
Copy link

rahulkhul commented Oct 6, 2017

@jameswex , I have python implementation of facets, but sometime graph are not visible with the same, but if I try from https://pair-code.github.io/facets/, it works fine and load faster for any size of dataset. could you please let me know, how we can solve the problem.

@jameswex
Copy link
Collaborator

@rahulkhul Do you have an example dataset that it is failing with, along with an ipython notebook that shows the issue? Which facets visualization are you seeing this problem with?

Are there are errors in the browser debugging console?

@rahulkhul
Copy link

rahulkhul commented Oct 11, 2017 via email

@jameswex
Copy link
Collaborator

Would you be willing to share a csv on which this works and one on which it doesn't work? That would help me debug your issue. Let me know. Thanks!

@rahulkhul
Copy link

rahulkhul commented Oct 12, 2017 via email

@jameswex
Copy link
Collaborator

jameswex commented Oct 12, 2017

I don't see the attached files in the issue. Can you email the csvs to james.[my last name]@gmail.com? Thanks.

@makroid makroid mentioned this issue Oct 17, 2017
@romulomadu-zz
Copy link

What is the jupyter HTML template for this one?
image

@jameswex
Copy link
Collaborator

@romulomadu What is the question exactly?

For Facets Overview comparing the two datasets in your screenshot, the code to do that is in the example ipynb notebook file in the facets_overview directory.

@mg1075
Copy link

mg1075 commented Dec 30, 2017

@jameswex > In the future, we can create some documentation clarifying this.
That would be much appreciated.
I am getting nowhere fast trying to install all the different dependencies, etc., just to set things up (e.g., bazel on windows)0, and then for how to run and view in a web browser, I seem to be hopping all over the place, searching for instructions and finding tidbits here and there.

@stenpiren
Copy link

same here @mg1075 !

@richard5334
Copy link

Facets is great to quickly visualize data except... only the most advance user will manage to get it installed/working.

I wish it would be made available the same way tensorboard is. With tensorboard, it's as simple as typing a single command. The only easy alternative to get quickly going in Facet is to directly use the example demo at https://pair-code.github.io/facets/

@jameswex
Copy link
Collaborator

Check out the new section on using Facets in Google Colaboratory (a free jupyter-based notebook environment): https://github.com/PAIR-code/facets#usage-in-google-colabratoryjupyter-notebooks and the sample notebook here: https://colab.research.google.com/drive/1QrcuNHJnL3TBzcFV-0yw6y3wWmSWv_gM

You can use facets dive and overview on csv or pandas dataframes with no need for any installations. Just a few commands in the notebook.

@shirareznik
Copy link

Hi,
I understand how to do everything with text or numeric data, but in what format I may add images to the csv?
(i.e.- how may I implement something similar to the "draw" data- but show my own images instead of faces?)
I want to add a "high dimensional" feature to the csv (some kind of an image).

Many thanks!

@jameswex
Copy link
Collaborator

jameswex commented Aug 6, 2018

The image data can't be added to the CSV, but with Facets Dive you can add an atlas image which contains thumbnail images for line in the csv, which is what we did for the draw data.

PR #137 is about to merge in a tool to help create this atlas image for any dataset you have, and then the atlas image can be provided to dive as the atlasUrl parameter as seen here: https://github.com/PAIR-code/facets/tree/master/facets_dive#sprite-properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests