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 csv | |
import numpy as np | |
from sklearn.cross_validation import KFold | |
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer | |
from sklearn.feature_selection import SelectPercentile, f_classif | |
from sklearn.metrics import accuracy_score, precision_recall_fscore_support | |
from sklearn.pipeline import Pipeline | |
from sklearn.svm import SVC | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.naive_bayes import MultinomialNB |
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 math | |
def createDataSet(): | |
dataSet = [ | |
[1, 1, 'yes'], | |
[1, 1, 'yes'], | |
[1, 0, 'no'], | |
[0, 1, 'no'], | |
[0, 1, 'no'], |
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 math | |
import numpy as np | |
def createDataSet(): | |
""" | |
Creates a basic data set labels. | |
The labels are the classification given to the points. The data | |
is hardcoded in this toy example. |
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() { | |
// Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray | |
if (!Array.isArray) { | |
Array.isArray = function(arg) { | |
return Object.prototype.toString.call(arg) === '[object Array]'; | |
}; | |
} | |
var _delim = '/'; | |
var _regexDelim = "\\/"; |
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 | |
import argparse | |
from datetime import datetime | |
from serial import Serial | |
from sqlite3 import ProgrammingError | |
from time import sleep | |
from core import DataParser, SensorReadingsDataStore, MessageFormatError | |
from utils import get_config, create_logger_from_config, parse_sensor_types_config |
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
keys = ('FacilityID', 'FacilityName', 'City', 'Zip', 'Score', 'InspDate') | |
facilities_data = [data[key].split('|') for key in keys] | |
facilities = [dict(zip(keys, row)) for row in zip(*facilities_data)] |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
clean: ['js', 'css', 'fonts'], | |
copy: { | |
main: { | |
files: [ | |
{ |
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
/* | |
Bridge Sensor with GSM, SDCard, and RTC | |
Sketch used by ARTF Sensors platform. | |
Created 14 6 2014 | |
Modified 13 7 2014 | |
*/ | |
#include <LowPower.h> |
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
#!/bin/bash | |
# First unzip the disc image with Keka: Right click on the xz file and then do "Open With" and pick Keka | |
# Next make sure you have an empty microSD card. 4GB minimum will be required. | |
# List disks on system and find location of microSD card. Look for the 4GB one | |
diskutil list | |
# WARNING: Make sure you selected the correct disk. You do not want to overwrite your hard drive, |
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 r(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
var type = 's'; | |
var start_time = 1404313860; | |
var interval = 2; | |
var readings = 10; | |
for (var g = 0; g < 10; g++) | |
{ |