Skip to content

Instantly share code, notes, and snippets.

View jclevesque's full-sized avatar
🏠
Working from home

Julien-Charles Lévesque jclevesque

🏠
Working from home
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jclevesque
jclevesque / budgetedsvm.py
Created October 17, 2014 14:00
Python wrapper for budgeted svm toolbox
# -*- coding: utf-8 -*-
import os
import re
import subprocess
class BudgetSVMToolbox:
"""
Wrapper around the budgetsvm library as provided by the its authors.
Requires two executables, budgetsvm-train and budgetsvm-predict.
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License version 3 as
# published by the Free Software Foundation.
#
@jclevesque
jclevesque / detect.py
Last active September 16, 2015 21:02 — forked from mgard/detect.py
# import the necessary packages
import argparse
import datetime
import imutils
import time
import cv2
import collections
# construct the argument parser and parse the arguments
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier as GBC
import pandas as pd
import math
# Load training data
print('Loading training data.')
data_train = np.loadtxt( 'training.csv', delimiter=',', skiprows=1, converters={32: lambda x:int(x=='s'.encode('utf-8')) } )
# Pick a random seed for reproducible results. Choose wisely!