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
""" | |
======================================== | |
Unfair Casino Problem using Discrete HMM | |
======================================== | |
This script shows how to use Decoding in a Discrete(Multinomial) HMM, which means | |
given the model parameters and an observed sequence we wish to find the most likely hidden state sequence | |
generating the same. | |
It uses the model given in http://www.rose-hulman.edu/~shibberu/MA490/MA490HMM.html#Example_Dishonest_Casino_ | |
One may also refer to a great lecture series at http://vimeo.com/7175217 |
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 subprocess,time | |
import shutil | |
import time | |
#Number of lines to tail | |
NUMLINES_TAIL="1000" | |
FILE_PATH="/home/nipun/Desktop/OZW_log.txt" | |
SLEEP_TIME=20 | |
while True: |
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
{ | |
"metadata": { | |
"name": "HMM_Viterbi" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"metadata": { | |
"name": "AdaBoost" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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.
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# pegasos.py | |
# | |
# Copyright 2013 nipun batra <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
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 requests | |
files = {'Data': open(filename, 'rb')} | |
r = requests.post('http://sensoract.iiitd.edu.in:9004', files=files) | |
print r |
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 glob | |
import os | |
import time | |
import MySQLdb | |
DATA_PATH='/home/nipun/Desktop/' | |
THRESHOLD_TIME=300 | |
connection = MySQLdb.Connect(host='', user='root', passwd='password', db='smart_meter_data',local_infile = 1) | |
cursor = connection.cursor() | |
folders=os.listdir(DATA_PATH) |
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
'''Importing the functions to be unit tested''' | |
from smart_meter import create_header_row | |
from nose import with_setup | |
'''Creating a setup method to initialize variables which can be used more than once during multiple tests''' | |
def setup_lists(): | |
global parameter_list, parameter_numbers | |
parameter_list=["timestamp","W","W1","A1"] | |
parameter_numbers=[1,2] | |
OlderNewer