Git Product home page Git Product logo

Comments (19)

venkatesh-1729 avatar venkatesh-1729 commented on May 22, 2024 6

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))

from facets.

tastyminerals avatar tastyminerals commented on May 22, 2024 2

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.

from facets.

rahulkhul avatar rahulkhul commented on May 22, 2024 2

from facets.

jameswex avatar jameswex commented on May 22, 2024 1

@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.

from facets.

mg1075 avatar mg1075 commented on May 22, 2024 1

@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.

from facets.

fils avatar fils commented on May 22, 2024

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.

from facets.

jameswex avatar jameswex commented on May 22, 2024

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.

from facets.

anna-mo avatar anna-mo commented on May 22, 2024

@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.

from facets.

rahulkhul avatar rahulkhul commented on May 22, 2024

@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.

from facets.

jameswex avatar jameswex commented on May 22, 2024

@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?

from facets.

jameswex avatar jameswex commented on May 22, 2024

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!

from facets.

rahulkhul avatar rahulkhul commented on May 22, 2024

from facets.

jameswex avatar jameswex commented on May 22, 2024

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

from facets.

romulomadu-zz avatar romulomadu-zz commented on May 22, 2024

What is the jupyter HTML template for this one?
image

from facets.

stenpiren avatar stenpiren commented on May 22, 2024

same here @mg1075 !

from facets.

richard5334 avatar richard5334 commented on May 22, 2024

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/

from facets.

jameswex avatar jameswex commented on May 22, 2024

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.

from facets.

shirareznik avatar shirareznik commented on May 22, 2024

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!

from facets.

jameswex avatar jameswex commented on May 22, 2024

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

from facets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.