Skip to content

Instantly share code, notes, and snippets.

@Ekrekr
Ekrekr / local.sh
Last active April 23, 2024 18:23
Run jupyter notebooks remotely using a custom python environment.
#!/bin/bash
# local.sh - access a remote running jupyter notebooks, for example on a
# cluster, locally. These steps can be run from any directory on your local
# machine.
# Create a tunnel for notebook communication. The user and server credentials
# should be the same as you used to log in to the server for the `remote.sh`
# script.
ssh -N -f -L localhost:8888:localhost:8890 <user>@<server>
@Ekrekr
Ekrekr / basic_svm_algo.py
Last active August 12, 2019 20:27
Basic implementation of Debarghya Das's SVM trading algorithm. Note the current leakage caused by overlap between testing/training time series.
# -*- coding: utf-8 -*-
"""Confidence Based Support Vector Machine
This algorithm implements a confidence based support vector machine, as designed
by Debarghya Das (website http://debarghyadas.com/).
To clear up any ambiguity with regards to financial terms, my use of the word
"Margin" throughout this coderelates to the length of the sequence of data being
experimented upon and "Polarity" indicates the direction of within each sequence
item. +1 indicates up and -1 indicates down.