Skip to content

Instantly share code, notes, and snippets.

View Tagar's full-sized avatar
🗻

Ruslan Dautkhanov Tagar

🗻
  • Denver, CO
  • 11:09 (UTC -06:00)
View GitHub Profile
@kmjjacobs
kmjjacobs / gru_tensorflow.py
Last active August 14, 2022 17:10
GRU (Gated Recurrent Unit) implementation in TensorFlow and used in a simple Machine Learning task. The corresponding tutorial is found on Data Blogger: https://www.data-blogger.com/2017/08/27/gru-implementation-tensorflow/.
#%% (0) Important libraries
import tensorflow as tf
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
from IPython import display
% matplotlib inline
#%% (1) Dataset creation.
@vykhand
vykhand / Spark_SQL_leakage_solution.ipynb
Created May 12, 2016 10:30
Spark SQL leakage solution for Kaggle Expedia competition
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@0asa
0asa / sklearn-pyspark.py
Created January 27, 2015 11:12
Run a Scikit-Learn algorithm on top of Spark with PySpark
from pyspark import SparkConf, SparkContext
from sklearn.datasets import make_classification
from sklearn.ensemble import ExtraTreesClassifier
import pandas as pd
import numpy as np
conf = (SparkConf()
.setMaster("local[*]")
.setAppName("My app")
.set("spark.executor.memory", "1g"))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwmsmith
kwmsmith / pairwise_cython.pyx
Last active August 12, 2022 04:25
Numba vs. Cython: Parallel Cython with OMP
#cython:boundscheck=False
#cython:wraparound=False
import numpy as np
from cython.parallel cimport prange
from libc.math cimport sqrt
cdef inline double dotp(int i, int j, int N, double[:, ::1] X) nogil:
cdef:
int k
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ChrisWills
ChrisWills / .screenrc-main-example
Created November 3, 2011 17:50
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@dataminelab
dataminelab / hive_md5.java
Created June 27, 2011 22:24
Hive MD5 UDF
package com.dataminelab.hive.udf;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
import java.security.*;
/**
* Calculate md5 of the string
*/