See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
def istft(stft_matrix, hop_length=None, win_length=None, window='hann', | |
center=True, normalized=False, onesided=True, length=None): | |
"""stft_matrix = (batch, freq, time, complex) | |
All based on librosa | |
- http://librosa.github.io/librosa/_modules/librosa/core/spectrum.html#istft | |
What's missing? | |
- normalize by sum of squared window --> do we need it here? | |
Actually the result is ok by simply dividing y by 2. | |
""" |
import pandas as pd | |
# Calculate information value | |
def calc_iv(df, feature, target, pr=0): | |
lst = [] | |
for i in range(df[feature].nunique()): | |
val = list(df[feature].unique())[i] | |
lst.append([feature, val, df[df[feature] == val].count()[feature], df[(df[feature] == val) & (df[target] == 1)].count()[feature]]) |
typedef unsigned char uint8; | |
typedef unsigned short uint16; | |
typedef unsigned int uint32; | |
#define REG_DISPLAYCONTROL *((volatile uint32*)(0x04000000)) | |
#define VIDEOMODE_3 0x0003 | |
#define BGMODE_2 0x0400 | |
#define SCREENBUFFER ((volatile uint16*)0x06000000) | |
#define SCREEN_W 240 |
import numpy as np | |
import pandas as pd | |
from collections import defaultdict | |
from scipy.stats import hmean | |
from scipy.spatial.distance import cdist | |
from scipy import stats | |
import numbers | |
def weighted_hamming(data): |
If you'd like to use a .jar file in your project, but it's not available in any Maven repository, | |
you can get around this by creating your own local repository. This is done as follows: | |
1 - To configure the local repository, add the following section to your pom.xml (inside the <project> tag): | |
<repositories> | |
<repository> | |
<id>in-project</id> | |
<name>In Project Repo</name> | |
<url>file://${project.basedir}/libs</url> |
Source: http://datahugger.org/datascience/setting-up-hadoop-v2-with-spark-v1-on-osx-using-homebrew/ | |
This post builds on the previous setup Hadoop (v1) guide, to explain how to setup a single node Hadoop (v2) cluster with Spark (v1) on OSX (10.9.5). | |
Apache Hadoop is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. Rather than rely on hardware to deliver high-availability, the library itself is designed to detect and handle failures at the application layer, so delivering a highly-available service on top of a cluster of computers, each of which may be prone to failures. The Apache Hadoop framework is composed of the following core modules: | |
HDFS (Distributed File System): a distributed file-system that stores data on commodity machines, providing very high aggregate bandwidth across the cluster. | |
YARN (Yet A |
http://jhusain.github.io/learnrx/
Like an Event, an Observable is a sequence of values that a data producer pushes to the consumer. However unlike an Event, an Observable can signal to a listener that it has completed, and will send no more data.
Querying Arrays only gives us a snapshot. By contrast, querying Observables allows us to create data sets that react and update as the system changes over time. This enables a very powerful type of programming known as reactive programming.
Disposing of a Subscription object unsubscribes from the event and prevents memory leaks. Disposing of a subscription is the asynchronous equivalent of stopping half-way through a counting for loop.
If we convert Events to Observable Objects, we can use powerful functions to transform them.
func debounce( delay:NSTimeInterval, #queue:dispatch_queue_t, action: (()->()) ) -> ()->() { | |
var lastFireTime:dispatch_time_t = 0 | |
let dispatchDelay = Int64(delay * Double(NSEC_PER_SEC)) | |
return { | |
lastFireTime = dispatch_time(DISPATCH_TIME_NOW,0) | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, |