This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Python bindings to start a Clojure repl from a python process. Relies on | |
libpython-clj being in a deps.edn pathway as clojure is called from the command | |
line to build the classpath. Expects javabridge to be installed and functional. | |
Javabridge will dynamically find the java library that corresponds with calling 'java' | |
from the command line and load it. We then initialize Clojure and provide pathways | |
to require namespaces, find symbols, and call functions. | |
There are two import initialization methods - init_clojure and init_clojure_repl - these | |
take care of starting up everything in the correct order. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; calculation function | |
(defn calc-correlations-matrix [data cols-to-use] | |
(doall | |
(for [col-1 cols-to-use col-2 cols-to-use] | |
{:col-1 col-1 | |
:col-2 col-2 | |
:corr | |
(Float/valueOf | |
(str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns behrica.corr-matrix | |
(:require [fastmath.stats :as stats] | |
[aerial.hanami.common :as hc] | |
[aerial.hanami.templates :as ht] | |
[aerial.hanami.core :as hmi])) | |
(defn round | |
[n scale rm] | |
(.setScale ^java.math.BigDecimal (bigdec n) | |
(int scale) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rocker/r-ver:4.1.1 | |
RUN apt-get update && apt-get -y install openjdk-11-jdk curl rlwrap libssl-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev | |
RUN curl -O https://download.clojure.org/install/linux-install-1.10.3.967.sh && chmod +x linux-install-1.10.3.967.sh && ./linux-install-1.10.3.967.sh | |
SHELL ["/bin/bash", "-c"] | |
RUN echo $'{ \n\ | |
:mvn/repos {"clojars" {:url "https://repo.clojars.org/"} \n\ | |
"central" {:url "https://repo1.maven.org/maven2/"} \n\ | |
"bedatadriven" {:url "https://nexus.bedatadriven.com/content/groups/public/"}} \n\ | |
\n\ | |
:paths ["src" "resources"] \n\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:fit-ctx {:metamorph/mode :fit, :metamorph/data Group: 3 [120 5]: | |
| :sepal_length | :sepal_width | :petal_length | :petal_width | :species | | |
|--------------:|-------------:|--------------:|-------------:|---------:| | |
| 4.5 | 2.3 | 1.3 | 0.3 | 1.0 | | |
| 5.8 | 2.7 | 3.9 | 1.2 | 0.0 | | |
| 6.3 | 2.7 | 4.9 | 1.8 | 2.0 | | |
| 7.1 | 3.0 | 5.9 | 2.1 | 2.0 | | |
| 6.3 | 3.4 | 5.6 | 2.4 | 2.0 | | |
| 6.4 | 3.2 | 4.5 | 1.5 | 0.0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({:dan-sleep 4.0, :dan-grump 90.20926835578194} | |
{:dan-sleep 4.1, :dan-grump 89.31559277383866} | |
{:dan-sleep 4.2, :dan-grump 88.42191719189539} | |
{:dan-sleep 4.3, :dan-grump 87.52824160995212} | |
{:dan-sleep 4.4, :dan-grump 86.63456602800885} | |
{:dan-sleep 4.5, :dan-grump 85.74089044606558} | |
{:dan-sleep 4.6, :dan-grump 84.84721486412231} | |
{:dan-sleep 4.7, :dan-grump 83.95353928217904} | |
{:dan-sleep 4.8, :dan-grump 83.05986370023575} | |
{:dan-sleep 4.9, :dan-grump 82.1661881182925} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.probability import FreqDist | |
import math | |
import pickle | |
from top2vec import Top2Vec | |
import numpy as np | |
from gensim.utils import simple_preprocess | |
from gensim.parsing.preprocessing import strip_tags | |
from tqdm import tqdm | |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Month,DayofMonth,DayOfWeek,DepTime,UniqueCarrier,Origin,Dest,Distance,dep_delayed_15min | |
c-8,c-21,c-7,1934,AA,ATL,DFW,732,N | |
c-4,c-20,c-3,1548,US,PIT,MCO,834,N | |
c-9,c-2,c-5,1422,XE,RDU,CLE,416,N | |
c-11,c-25,c-6,1015,OO,DEN,MEM,872,N | |
c-10,c-7,c-6,1828,WN,MDW,OMA,423,Y | |
c-8,c-3,c-4,1918,NW,MEM,MCO,683,N | |
c-1,c-27,c-4,754,DL,PBI,LGA,1035,N | |
c-4,c-29,c-6,635,OH,MSP,CVG,596,N | |
c-7,c-28,c-5,735,AA,ONT,DFW,1189,N |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\"#000\" opacity=\"1\">20</text><text text-anchor=\"end\" transform=\"translate(-7,123)\" font-family=\"sans-serif\" font-size=\"10px\" fill=\"#000\" opacity=\"1\">40</text><text text-anchor=\"end\" transform=\"translate(-7,83)\" font-family=\"sans-serif\" font-size=\"10px\" fill=\"#000\" opacity=\"1\">60</text><text text-anchor=\"end\" transform=\"translate(-7,42.99999999999999)\" font-family=\"sans-serif\" font-size=\"10px\" fill=\"#000\" opacity=\"1\">80</text><text text-anchor=\"end\" transform=\"translate(-7,3)\" font-family=\"sans-serif\" font-size=\"10px\" fill=\"#000\" opacity=\"1\">100</text></g><g class=\"mark-rule role-axis-domain\" pointer-events=\"none\"><line transform=\"translate(0,200)\" x2=\"0\" y2=\"-200\" stroke=\"#888\" stroke-width=\"1\" opacity=\"1\"/></g><g class=\"mark-text role-axis-title\" pointer-events=\"none\"><text text-anchor=\"middle\" transform=\"translate(-30.0869140625,100) rotate(-90) translate(0,-2)\" font-family=\"sans-serif\" font-size=\"11px\" font-weight=\"bold\" fill= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"{:path [], :nextjournal/value [{:path [0], :nextjournal/value [{:path [0 0], :nextjournal/value :Documents, :nextjournal/viewer {:render-fn #viewer-fn (fn [x] (v/html [:span.cmt-atom.inspected-value (str x)]))}} {:path [0 1], :nextjournal/value [{:path [0 1 0], :nextjournal/value 1.0, :nextjournal/viewer {:render-fn #viewer-fn (fn [x] (v/html [:span.cmt-number.inspected-value (if (js/Number.isNaN x) \"NaN\" (str x))]))}} {:path [0 1 1], :nextjournal/value 1.0, :nextjournal/viewer {:render-fn #viewer-fn (fn [x] (v/html [:span.cmt-number.inspected-value (if (js/Number.isNaN x) \"NaN\" (str x))]))}} {:path [0 1 2], :nextjournal/value 1.0, :nextjournal/viewer {:render-fn #viewer-fn (fn [x] (v/html [:span.cmt-number.inspected-value (if (js/Number.isNaN x) \"NaN\" (str x))]))}} {:path [0 1 3], :nextjournal/value 1.0, :nextjournal/viewer {:render-fn #viewer-fn (fn [x] (v/html [:span.cmt-number.inspected-value (if (js/Number.isNaN x) \"NaN\" (str x))]))}} {:path [0 1 4], :nextjournal/value 1.0, :nextjournal/viewer { |