Skip to content

Instantly share code, notes, and snippets.

View idmn's full-sized avatar
💭
:suspect:

Iaroslav Domin idmn

💭
:suspect:
View GitHub Profile
@idmn
idmn / naval.py
Last active September 6, 2018 14:53
import math
import random
import sys
# 2-D point with some helpful methods like addition of two points, multiplication by number,
# distance to other point etc
class Point(object):
def __init__(self, x=0, y=0):
self.x = x
library(ggplot2)
library(dplyr)
library(ggbeeswarm)
cities <- c(
"Portland", "New York City", "Chicago", "Detroit",
"New Haven", "Boston", "Philadelphia", "St. Louis"
)
slice_data <- tibble(
@idmn
idmn / NMF.R
Created September 22, 2023 14:52
NMF essence
library(NMF)
# random non-negative matrix
v <- rmatrix(20, 10)
# fit an NMF model
x <- nmf(v, 5)
# decomposition components
x@fit@W
x@fit@H