Skip to content

Instantly share code, notes, and snippets.

View minesh1291's full-sized avatar
🚖
On The Journey to Neverland

Minesh A. Jethva minesh1291

🚖
On The Journey to Neverland
View GitHub Profile
@marcelcaraciolo
marcelcaraciolo / log_regression.py
Last active August 7, 2019 18:51
Logistic prediction
def sigmoid(X):
'''Compute the sigmoid function '''
#d = zeros(shape=(X.shape))
den = 1.0 + e ** (-1.0 * X)
d = 1.0 / den
return d
@tonious
tonious / hash.c
Last active June 21, 2024 00:57
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
@yong27
yong27 / apply_df_by_multiprocessing.py
Last active April 12, 2023 04:35
pandas DataFrame apply multiprocessing
import multiprocessing
import pandas as pd
import numpy as np
def _apply_df(args):
df, func, kwargs = args
return df.apply(func, **kwargs)
def apply_by_multiprocessing(df, func, **kwargs):
workers = kwargs.pop('workers')
@GaelVaroquaux
GaelVaroquaux / mutual_info.py
Last active June 18, 2023 12:25
Estimating entropy and mutual information with scikit-learn: visit https://github.com/mutualinfo/mutual_info
'''
Non-parametric computation of entropy and mutual-information
Adapted by G Varoquaux for code created by R Brette, itself
from several papers (see in the code).
This code is maintained at https://github.com/mutualinfo/mutual_info
Please download the latest code there, to have improvements and
bug fixes.
@bzhr
bzhr / Vector Auto Regression with Statsmodels to predict the stock of Safe Assets in the U.S. Economy
Last active May 3, 2018 13:27
Vector Auto Regression with Statsmodels to predict the stock of Safe Assets in the U.S. Economy
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
@decodebiology
decodebiology / EnsemblGTFtoAnnotation.sh
Last active June 29, 2018 12:18
Convert EnsEMBL GTF to Annotation table (Geneid, GeneSymbol, GeneWiseChrLocation, GeneClass, Strand)
echo `date`;
dir=(`dirname $1`)
base=(`basename $1`)
echo "1/7 Preparing files";
cat $1 | sed 's/ "/\t/g' | sed 's/"; /\t/g' | cut -f1,4,5,7,10,12,16,18,22 | sed 's/";//' | awk '!x[$6]++' | awk '{print $6"\t"$0;}' > $dir/enst_annotation.tmp;
# Prepare Steps:
# We are assuming we’re using CUDA 7.5
# Clone and Build latest Mesos with GPUs (skipping instructions here…)
# CUDA prepare script for ubuntu 14.04 with AWS G2 instance.
# http://tleyden.github.io/blog/2015/11/22/cuda-7-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Start mesos master and slave
# ./mesos-master --work_dir=/tmp/mesos
# sudo GLOG_v=1 ./mesos-slave --isolation=gpu/nvidia --master=`hostname -i`:5050 --nvidia_gpu_devices=0
# Add cuda bin to PATH
@doowon
doowon / jupyter
Last active October 15, 2023 17:46 — forked from jmtatsch/jupyter
A service (init.d) script for jupyter
#! /bin/sh
### BEGIN INIT INFO
# Provides: jupyter
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start jupyter
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@fchollet
fchollet / classifier_from_little_data_script_2.py
Last active September 13, 2023 03:34
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active June 29, 2024 09:06
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS