A beginner-friendly REPL that combines
| {:paths ["."] | |
| :deps {missionary {:mvn/version "a.3"}}} |
| (ns hello-react-blessed.core | |
| (:require | |
| [cljs.nodejs :as nodejs] | |
| [reagent.core :as reagent] | |
| [re-frame.core :as rf] | |
| [blessed :as blessed] ; or use neo-blessed | |
| ["react-blessed" :as rb] | |
| [ws])) | |
| (defonce logger (reagent/atom [])) |
This post will teach you how to visualize higher dimensional datasets in lower dimensions using Principal Component Analysis. And guess what?! Its all in Clojure! I was inspired to write this because I was curious how Principal Component Analysis worked, and there aren't a lot of data analysis resources out there for Clojure.
The best one I could find was from Data Sorcery https://data-sorcery.org/category/pca/.
Now that blog post was very informative on how to do Principal Component Analysis
(will be referring to this as PCA as well) in Clojure. However, when I decided to use it on a larger dataset I got an out of memory exception because the pca function incanter provides requires a matrix as input. The input matrix requires a lot of memory if the dataset is rather large. So I decided to write my own implementation which could calculate the covariance matrix with an input as a lazyseq. That way my input could be as big as I wanted. And learning
| (ns upload-file.core | |
| (:require [reagent.core :refer [render atom]] | |
| [cljs.core.async :refer [put! chan <! >!]]) | |
| (:require-macros [cljs.core.async.macros :refer [go go-loop]])) | |
| ;; derived from https://mrmcc3.github.io/post/csv-with-clojurescript/ | |
| ;; and based on reagent-frontend template. | |
| ;; dependencies from project.clj in addition to clojure, clojurescript, and reagent: | |
| ;; [org.clojure/core.async "0.2.395"] |
| (ns ukanren-transducers | |
| (:refer-clojure :exclude [== disj conj])) | |
| (defrecord Lvar [name]) | |
| (defn lvar [] (->Lvar (gensym "lvar"))) | |
| (defn lvar? [v] (instance? Lvar v)) | |
| (def empty-state {}) | |
| (defn walk [u s] |
(:identity req)is auth backend independent way to access user data- login and logout implementation depends on auth backend
:current-userdoesn't imply that authentication is required, route should also have:auth-rulesif authentication is required
| ;; Clojure | |
| (require 'clojure-mode) | |
| (setq auto-mode-alist (cons '("\\.cljs$" . clojure-mode) auto-mode-alist)) | |
| (setq inferior-lisp-program "lein repl") | |
| ;; clj-refactor | |
| (require 'clj-refactor) | |
| (add-hook 'clojure-mode-hook (lambda () | |
| (clj-refactor-mode 1) | |
| (cljr-add-keybindings-with-prefix "C-c C-o"))) |
| (comment ; Fun with transducers, v2 | |
| ;; Still haven't found a brief + approachable overview of Clojure 1.7's new | |
| ;; transducers in the particular way I would have preferred myself - so here goes: | |
| ;;;; Definitions | |
| ;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as: | |
| (fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation | |
| ;; (The `[]` arity is actually optional; it's only used when calling | |
| ;; `reduce` w/o an init-accumulator). |
Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev