Skip to content

Instantly share code, notes, and snippets.

View dalamar66's full-sized avatar

Daniel dalamar66

View GitHub Profile
@bjorskog
bjorskog / statnett.py
Created November 25, 2016 10:27
Loading production and consumption data from Statnett
"""
Extracting various figures from Statnett
"""
import requests
import datetime
import pprint
@bjorskog
bjorskog / svm_rsi_trend.R
Created December 29, 2015 16:12 — forked from Inpirical-Coder/svm_rsi_trend.R
Trains and tests SVM on two features (relative strength index and trend over x observations)
# Some code to asses an SVM with a two-dimensional feature space:
# trend (price - simple moving average) and relative strength index.
# The code is an adaptation of the code found in the following linkedin post:
# "Trading the RSI using a Support Vector Machine"
# "https://www.linkedin.com/pulse/article/20141103165037-172934333-trading-the-rsi-using-a-support-vector-machine"
# Settings
sma.window = 50 # Number of observations in simple moving average.
rsi.window = 3 # Number of observation in relative strength index (RSI)
@four43
four43 / install-redis.sh
Last active January 4, 2025 19:18 — forked from dstroot/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@Inpirical-Coder
Inpirical-Coder / twttr_sentiment_bench.R
Created November 26, 2014 00:45
Benchmarking sentiment scoring algorithms for twitter using precision, recall, F-measure
# Short scripts for testing three different sentiment classifiers on tweets,
# acquiring the tweets used for testing,
# calculating systems' precision, recall and F-measures.
require(RCurl) # For downloading file from a given URL.
require(twitteR) # Used for the 'twitter' class.
require(sentiment) # For bayes and voter classifiers.
source("sent140.R") # Used for the Sentiment 140 API. Can be downloaded from here:
# https://github.com/okugami79/sentiment140/blob/master/R/sentiment.r
@dalamar66
dalamar66 / e1071.R
Last active January 24, 2017 16:43 — forked from ivannp/e1071.R
svmComputeOneForecast = function(
id,
data,
response,
startPoints,
endPoints,
len,
history=500,
trace=FALSE,
kernel="radial",
@Inpirical-Coder
Inpirical-Coder / sentiment_score_simple.R
Last active August 25, 2024 12:02
R Sentiment Scoring HSBC w/ Harvard General Inquirer
# Code to fetch news streams from 5 live sources, process the streams and text
# and apply a simple sentiment scoring algorigthm.
#
# A writeup of the analysis can be found here:
# https://www.linkedin.com/pulse/article/20141109035942-34768479-r-sentiment-scoring-hsbc-w-harvard-general-inquirer
# Define the packages we want to load:
packs = c(
"tm", # Text mining
"tm.plugin.webmining", # Web-source plugin for text mining
@Inpirical-Coder
Inpirical-Coder / svm_rsi_trend.R
Created November 6, 2014 02:05
Trains and tests SVM on two features (relative strength index and trend over x observations)
# Some code to asses an SVM with a two-dimensional feature space:
# trend (price - simple moving average) and relative strength index.
# The code is an adaptation of the code found in the following linkedin post:
# "Trading the RSI using a Support Vector Machine"
# "https://www.linkedin.com/pulse/article/20141103165037-172934333-trading-the-rsi-using-a-support-vector-machine"
# Settings
sma.window = 50 # Number of observations in simple moving average.
rsi.window = 3 # Number of observation in relative strength index (RSI)
@mrbcuda
mrbcuda / currency.png
Last active December 29, 2018 05:28
A mashup of financial turbulence and regime switching examples having missing bits into a standalone example without missing bits. Uses sources from Quantivity and Systematic Investor blogs as well as the CRAN RHmm and TTR packages. Uses quantmod and FRED as a data source. The turbulence calculation clearly is not the same as referenced original…
currency.png
@ivannp
ivannp / e1071.R
Created December 1, 2012 03:18
Back-testing SVM with e1071
svmComputeOneForecast = function(
id,
data,
response,
startPoints,
endPoints,
len,
history=500,
trace=FALSE,
kernel="radial",