Comments (3)
Upd. Seems like the problem is with the pdf viewer installed in my laptop.
I open the file with https://smallpdf.com/pdf-reader and after zooming in 26 times it finally shows a lattice.
Still, can a lattice visualization be saved to png file instead of pdf?
from concepts.
Hi Egor, yep, the issue is probably purely the size.
Still, can a lattice visualization be saved to png file instead of pdf?
Use the format
argument, see Lattice.graphviz() and Digraph.render()
AFAICT your code includes the row number as feature (68 instead of 67), here is an adaped version:
import pathlib
import concepts
import pandas as pd
URL = ('https://raw.githubusercontent.com/fivethirtyeight/data/master'
'/bob-ross/elements-by-episode.csv')
CSV = pathlib.Path('bob_ross.csv')
FORMAT = {'encoding': 'utf-8'}
if not CSV.exists():
pd.read_csv(URL, **FORMAT).to_csv(CSV, **FORMAT)
df = pd.read_csv(CSV, **FORMAT).drop('Unnamed: 0', axis='columns')
df['EPISODE_TITLE'] = df['EPISODE'] + ' ' + df['TITLE']
df = df.drop(['EPISODE','TITLE'], axis='columns')
df = df.set_index('EPISODE_TITLE', drop=True).astype(bool)
context = concepts.Context(df.index, df.columns, df.values)
assert len(context.objects) == 403
assert len(context.properties) == 67
dot = context.lattice.graphviz('bob_ross.gv', render=True, format='png')
from concepts.
Closing for now.
from concepts.
Related Issues (8)
- You cant have a context with only one Object. HOT 1
- Access to concepts themselves HOT 3
- lattice_memebers.Concept vs _common.Concept API HOT 6
- Concept from pandas dataframe HOT 2
- missing middle level labels ? HOT 3
- Scalable method for deserializing lattice objects? HOT 15
- Plans for lattice reduction? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concepts.