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
# ---------------------------------------------------------------------- | |
# 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. | |
# |
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 the necessary packages | |
import argparse | |
import datetime | |
import imutils | |
import time | |
import cv2 | |
import collections | |
# construct the argument parser and parse the arguments |
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 -*- | |
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. |
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 | |
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! |