All Projects → parrt → Lolviz

parrt / Lolviz

Licence: bsd-3-clause
A simple Python data-structure visualization tool for lists of lists, lists, dictionaries; primarily for use in Jupyter notebooks / presentations

Projects that are alternatives of or similar to Lolviz

Opencv Machine Learning
M. Beyeler (2017). Machine Learning for OpenCV: Intelligent image processing with Python. Packt Publishing Ltd., ISBN 978-178398028-4.
Stars: ✭ 693 (-1.84%)
Mutual labels:  jupyter-notebook
Stockpriceprediction
Stock Price Prediction using Machine Learning Techniques
Stars: ✭ 700 (-0.85%)
Mutual labels:  jupyter-notebook
Polyrnn Pp
Inference Code for Polygon-RNN++ (CVPR 2018)
Stars: ✭ 704 (-0.28%)
Mutual labels:  jupyter-notebook
Hands On Transfer Learning With Python
Deep learning simplified by transferring prior learning using the Python deep learning ecosystem
Stars: ✭ 694 (-1.7%)
Mutual labels:  jupyter-notebook
Madewithml
Learn how to responsibly deliver value with ML.
Stars: ✭ 29,253 (+4043.48%)
Mutual labels:  jupyter-notebook
Network Analysis Made Simple
An introduction to network analysis and applied graph theory using Python and NetworkX
Stars: ✭ 700 (-0.85%)
Mutual labels:  jupyter-notebook
Featexp
Feature exploration for supervised learning
Stars: ✭ 688 (-2.55%)
Mutual labels:  jupyter-notebook
Data hacking
Data Hacking Project
Stars: ✭ 705 (-0.14%)
Mutual labels:  jupyter-notebook
Analytics Handbook
Getting started with soccer analytics
Stars: ✭ 699 (-0.99%)
Mutual labels:  jupyter-notebook
Intro To Dl
Resources for "Introduction to Deep Learning" course.
Stars: ✭ 703 (-0.42%)
Mutual labels:  jupyter-notebook
Sciblog support
Support content for my blog
Stars: ✭ 694 (-1.7%)
Mutual labels:  jupyter-notebook
H1st
The AI Application Platform We All Need. Human AND Machine Intelligence. Based on experience building AI solutions at Panasonic: robotics predictive maintenance, cold-chain energy optimization, Gigafactory battery mfg, avionics, automotive cybersecurity, and more.
Stars: ✭ 697 (-1.27%)
Mutual labels:  jupyter-notebook
Panama Papers Dataset 2016
Structured data about Panama papers collected from official ICIJ website
Stars: ✭ 701 (-0.71%)
Mutual labels:  jupyter-notebook
Deepbayes 2019
Practical assignments of the Deep|Bayes summer school 2019
Stars: ✭ 694 (-1.7%)
Mutual labels:  jupyter-notebook
Cookbook 2nd
IPython Cookbook, Second Edition, by Cyrille Rossant, Packt Publishing 2018
Stars: ✭ 704 (-0.28%)
Mutual labels:  jupyter-notebook
Pytorch Segmentation Detection
Image Segmentation and Object Detection in Pytorch
Stars: ✭ 692 (-1.98%)
Mutual labels:  jupyter-notebook
Caffenet Benchmark
Evaluation of the CNN design choices performance on ImageNet-2012.
Stars: ✭ 700 (-0.85%)
Mutual labels:  jupyter-notebook
Fewshot Face Translation Gan
Generative adversarial networks integrating modules from FUNIT and SPADE for face-swapping.
Stars: ✭ 705 (-0.14%)
Mutual labels:  jupyter-notebook
Machine Learning
머신러닝 입문자 혹은 스터디를 준비하시는 분들에게 도움이 되고자 만든 repository입니다. (This repository is intented for helping whom are interested in machine learning study)
Stars: ✭ 705 (-0.14%)
Mutual labels:  jupyter-notebook
Ai Series
📚 [.md & .ipynb] Series of Artificial Intelligence & Deep Learning, including Mathematics Fundamentals, Python Practices, NLP Application, etc. 💫 人工智能与深度学习实战,数理统计篇 | 机器学习篇 | 深度学习篇 | 自然语言处理篇 | 工具实践 Scikit & Tensoflow & PyTorch 篇 | 行业应用 & 课程笔记
Stars: ✭ 702 (-0.57%)
Mutual labels:  jupyter-notebook

lolviz

By Terence Parr. See Explained.ai for more stuff.

A very nice looking javascript lolviz port with improvements by Adnan M.Sagar.

A simple Python data-structure visualization tool that started out as a List Of Lists (lol) visualizer but now handles arbitrary object graphs, including function call stacks! lolviz tries to look out for and format nicely common data structures such as lists, dictionaries, linked lists, and binary trees. This package is primarily for use in teaching and presentations with Jupyter notebooks, but could also be used for debugging data structures. Useful for devoting machine learning data structures, such as decision trees, as well.

It seems that I'm always trying to describe how data is laid out in memory to students. There are really great data structure visualization tools but I wanted something I could use directly via Python in Jupyter notebooks.

The look and idea was inspired by the awesome Python tutor. The graphviz/dot tool does all of the heavy lifting underneath for layout; my contribution is primarily making graphviz display objects in a nice way.

Functionality

There are currently a number of functions of interest that return graphviz.files.Source objects:

  • listviz(): Horizontal list visualization
  • lolviz(): List of lists visualization with the first list vertical and the nested lists horizontal.
  • treeviz(): Binary trees visualized top-down ala computer science.
  • objviz(): Generic object graph visualization that knows how to find lists of lists (like lolviz()) and linked lists. Trees are also displayed reasonably, but with left to right orientation instead of top-down (a limitation of graphviz). Here is an example linked list and dictionary:

  • callsviz(): Visualize the call stack and anything pointed to by globals, locals, or parameters. You can limit the variables displayed by passing in a list of varnames as an argument.
  • callviz(): Same as callsviz() but displays only the current function's frame or you can pass in a Python stack frame object to display.
  • matrixviz(data): Display numpy ndarray; only 1D and 2D at moment.
  • strviz(): Show a string like an array.

Given the return value in generic Python, simply call method view() on the returned object to display the visualization. From jupyter, call function IPython.display.display() with the returned object as an argument. Function arguments are in italics.

Check out the examples.

Installation

First you need graphviz (more specifically the dot executable). On a mac it's easy:

$ brew install graphviz

Then just install the lolviz Python package:

$ pip install lolviz

or upgrade to the latest version:

$ pip install -U lolviz

Usage

From within generic Python, you can get a window to pop up using the view() method:

from lolviz import *
data = ['hi','mom',{3,4},{"parrt":"user"}]
g = listviz(data)
print(g.source) # if you want to see the graphviz source
g.view() # render and show graphviz.files.Source object

From within Jupyter notebooks you can avoid the render() call because Jupyter knows how to display graphviz.files.Source objects:

For more examples that you can cut-and-paste, please see the jupyter notebook full of examples.

Preferences

There are global preferences you can set that affect the display for long values:

  • prefs.max_str_len (Default 20). How many chars in a string representation of a value before we abbreviate with .... E.g.,:
  • prefs.max_horiz_array_len (Default 70) Lists can quickly become too wide and distort the visualization. This preference lets you set how long the combined string representations of the list values can get before we use a vertical representation of the list. E.g.,:
  • prefs.max_list_elems. Horizontal and vertical lists and sets show maximum of 10 (default) elements.
  • prefs.float_precision. How many decimal places to show for floats (default is 5).

Implementation notes

Mostly notes for parrt to remember things.

Graphviz

  • Ugh. shape=record means html-labels can't use ports. warning!

  • warning: <td> and </td> must be on same line or row is super wide!

Deploy

$ python setup.py sdist upload 

Or to install locally

$ cd ~/github/lolviz
$ pip install .
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].