Skip to content

Instantly share code, notes, and snippets.

Avatar

Lynn Cherny arnicas

View GitHub Profile
@arnicas
arnicas / plotly_w2v_embedding.py
Created Jul 13, 2019
create interactive umap embedding display for a word2vec model by simple script
View plotly_w2v_embedding.py
"""
Script originally sourced from Peter Baumgartner
here: https://gist.github.com/pmbaumgartner/adb33aa486b77ab58eb3df265393195d
and then modified by Lynn Cherny to allow a corpus file,
any gensim w2v model file, and make or read a counts file before the
UMAP display.
The counts are used to focus on the most common words, and more
frequent words show as lighter colors in the UMAP display Peter made.
NOTE: Pip install umap-learn not umap; the import method below fixes a bad install/umap issue.
"""
We couldn’t find that file to show.
@arnicas
arnicas / index.html
Last active Apr 8, 2016
Animate a dot with a few transitions
View index.html
<!DOCTYPE html>
<html>
<style>
circle {
fill: blue;
}
svg {
@arnicas
arnicas / Rat_SightingsNY_extract.csv
Last active Mar 28, 2016
Dots for rats in 2016 on a leaflet map, with generated bios and pics from flickr
View Rat_SightingsNY_extract.csv
We can't make this file beautiful and searchable because it's too large.
Unique Key,Created Date,Closed Date,Location Type,Incident Zip,Incident Address,Street Name,Cross Street 1,Cross Street 2,Address Type,City,Due Date,Resolution Action Updated Date,Community Board,Borough,Park Borough,Latitude,Longitude,Location 32962543,3/22/16 23:53,,3+ Family Apt. Building,11225,335 LEFFERTS AVENUE,LEFFERTS AVENUE,NOSTRAND AVENUE,NEW YORK AVENUE,ADDRESS,BROOKLYN,4/21/16 23:53,3/23/16 0:00,09 BROOKLYN,BROOKLYN,BROOKLYN,40.66239321,-73.95026623,"(40.66239320568563, -73.95026622688094)" 32966604,3/22/16 23:50,,Other (Explain Below),11233,1323 HERKIMER STREET,HERKIMER STREET,PLEASANT PLACE,MONACO PLACE,ADDRESS,BROOKLYN,4/21/16 23:50,3/22/16 23:53,16 BROOKLYN,BROOKLYN,BROOKLYN,40.67746197,-73.90959516,"(40.67746196594494, -73.90959515599286)" 32962660,3/22/16 23:22,,Other (Explain Below),10025,120 WEST 109 STREET,WEST 109 STREET,COLUMBUS AVENUE,AMSTERDAM AVENUE,ADDRESS,NEW YORK,4/21/16 23:22,3/22/16 23:30,07 MANHATTAN,MANHATTAN,MANHATTAN,40.80151565,-73.96229483,"(40.801515645553465, -73.9622948
@arnicas
arnicas / README.md
Last active Mar 5, 2016
TSNE Plot of Yelp Reviews
View README.md

An illustration of TSNE layout of word2vec output from a subset of Yelp reviews.

Use the mouse to click on a dot and see the word plotted. Click a label to hide it again.

Color indicates polarity based on simple word labeling from the AFINN wordlist. It may be that context in this dataset affects polarity :)

@arnicas
arnicas / index.html
Last active Feb 21, 2016
Student project links, fall 2015
View index.html
<html>
<head>
<style>
body {
margin: 50px;
font-family: Arial;
}
h1 {
@arnicas
arnicas / README.md
Last active Feb 9, 2016
Week4 homework1 - Scale Fix
@arnicas
arnicas / index.html
Created Sep 21, 2015
Dot plot example
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Adding Labels</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<style type="text/css">
body {
background-color: #ddddff;
@arnicas
arnicas / index.html
Last active Sep 4, 2020
Slope Chart in High Charts
View index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts Example SlopeGraph</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript">
You can’t perform that action at this time.