This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# @Author: roman | |
# @Date: 2016-05-09 19:59:31 | |
# @Last Modified by: roman | |
# @Last Modified time: 2016-05-09 21:08:37 | |
import numpy as np | |
from sklearn.cross_validation import train_test_split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function loadCustomScripts() { | |
var elems = document.getElementsByTagName('IMG'); | |
console.log(elems); | |
for (var x = 0; x < elems.length; x++) { | |
if (elems[x].className.indexOf("JS_EMBED") >= 0) { | |
var use_source = elems[x].src; | |
if (/^https?:\/\/[^\/\\]+[.]juniper[.]net\/[^?]+[.]js$/.exec(use_source)) { | |
var s = document.createElement('SCRIPT'); | |
s.type = "text/javascript"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as pl | |
def calc_lv(x, y, coefs): | |
x_new = x * (coefs['a'] - coefs['b'] * y - coefs['c']) | |
y_new = y * (coefs['e'] * coefs['b'] * x - coefs['d']) | |
return x_new, y_new | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wordcount(text) | |
words=split(readall(text), Set([' ','\n','\r','\t','-','.',',',':','_','"',';','!']),false) | |
counts=Dict() | |
for w in words | |
counts[w] = get(counts,w,0)+1 | |
end | |
return counts | |
end | |
tic();open(wordcount, "input1.txt");toc() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def initTrades(trades): | |
for i, trade in enumerate(trades): | |
if i % 2: | |
trade["side"] = 'S' | |
else: | |
trade["side"] = 'B' | |
trade["tradeId"] = i | |
trade["clientId"] = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Roman Sinayev | |
# License: BSD Style. | |
# Viterbi algorithm implementation and example written in Julia Language | |
# | |
# The idea is to decode the most probable order of a hidden markov model | |
# based on indirect observations. | |
# In the example below, we attempt to determine where a person is based on | |
# their cell phone service strength. We also have fake probabilities associated | |
# with each state(location) and with transitions between locations and with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Authors: Olivier Grisel <olivier.grisel@ensta.org> | |
# Mathieu Blondel <mathieu@mblondel.org> | |
# Lars Buitinck <L.J.Buitinck@uva.nl> | |
# Robert Layton <robertlayton@gmail.com> | |
# Jochen Wersdörfer <jochen@wersdoerfer.de> | |
# Roman Sinayev <roman.sinayev@gmail.com> | |
# | |
# License: BSD Style. | |
""" |