Skip to content

Instantly share code, notes, and snippets.

View tbrittoborges's full-sized avatar

Thiago Britto Borges tbrittoborges

View GitHub Profile
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
import numpy as np
iris = load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df['is_train'] = np.random.uniform(0, 1, len(df)) <= .75
df['species'] = pd.Factor(iris.target, iris.target_names)
df.head()
@martijnvermaat
martijnvermaat / README.md
Last active February 7, 2022 09:06
The IPython Notebook on an SGE cluster

IPython Notebook on an SGE cluster

This guide documents how we set up an easy workflow for using the IPython Notebook on our compute cluster managed with Sun Grid Engine (SGE).

Summary: We provide a script to the cluster users that runs qrsh to schedule an ipython notebook job using SSL and password protection.

Installing IPython

@sloria
sloria / bobp-python.md
Last active November 14, 2024 15:01
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@madjar
madjar / scrapper.py
Last active March 5, 2023 15:02
A example of scrapper using asyncio and aiohttp
import asyncio
import aiohttp
import bs4
import tqdm
@asyncio.coroutine
def get(*args, **kwargs):
response = yield from aiohttp.request('GET', *args, **kwargs)
return (yield from response.read_and_close(decode=True))
@jfpuget
jfpuget / Julia_Python_perf.ipynb
Last active April 15, 2022 11:55
An exercise in Python optimization: make Python benchmarks as fast, if not faster, than Julia.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stefanthaler
stefanthaler / stateful_lstm_embedding.py
Last active September 2, 2020 14:10
Simple example for a stateful keras LSTM with embedding.
"""
Learning Task:
Given a sequence, predict a label based on the first value of the sequence
Explanation of stateful LSTM and setup:
http://philipperemy.github.io/keras-stateful-lstm/
Exmple:
given a sequence [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], predict 1
given a sequence [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], predict 0
@Brainiarc7
Brainiarc7 / gnu-parallel-bioinformatics.md
Last active September 6, 2023 13:59
GNU Parallel usage in Bioinformatics with examples: A primer.
@stefanthaler
stefanthaler / colorize_word_embeddings.py
Created February 3, 2017 14:38
A simple example to demonstrate how to link embedding metadata to word embeddings in tensorflow / tensorboard
"""
Simple example to demostrate the embedding visualization for word embeddings in tensorflow / tensorboard
https://www.tensorflow.org/how_tos/embedding_viz/
"""
import tensorflow as tf
import os
assert tf.__version__ == '1.0.0-rc0' # if code breaks, check tensorflow version
from tensorflow.contrib.tensorboard.plugins import projector
@ilevantis
ilevantis / bedtools_cheatsheet.md
Last active September 13, 2024 19:19
Bedtools cheatsheet

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.