-
Split the logic into "retrieving data" and "processing data." Right now, the code has big, multi-purpose functions.
-
Refactor the code, making it in line with PEP 8, and (maybe?) add assertion statements to act as unit tests.
This file contains hidden or 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
","stringr23aphics |
This file contains hidden or 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
library("cvTools") | |
library('reshape2') | |
policy.all <- read.csv('data.csv', header = TRUE, sep = ',') | |
# > policy.all | |
# iteration RandomForest Lasso Ridge | |
# 1 1 0.18 0.06 0.06 | |
# 2 2 0.15 0.07 0.07 | |
# 3 3 0.15 -0.04 -0.06 |
This file contains hidden or 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/local/bin/python | |
"text-based Blackjack program. One player, one dealer; dealer hits to 17." | |
import random | |
import sys | |
class Card(object): | |
"Represents a playing card. Used here in DECK." | |
def __init__(self, name, value, suit, index): | |
self.name = name | |
self.value = value |
This file contains hidden or 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
# Creates a MA(3) model | |
ma.parameters <- c(0.5, 0.5, 0.2) | |
ma.model <- arima.sim(model=list(ma.parameters,n=100) | |
# Plots the autocorrelation function of the MA(3) model | |
acf(ma.model) |
This file contains hidden or 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
<html> | |
<head> | |
<title>Purity Test score vs. length of tenure</title> | |
<script src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style> | |
/* tell the SVG path to be a thin blue line without any area fill */ | |
path { | |
stroke: steelblue; | |
stroke-width: 1; | |
fill: none; |
-
forbidden set is a huge cluster of dups ==> randomly select a subset of the forbidden ones
-
test it on never before seen data
-
test without Anahita's data
-
which of Anahita's data did we use? ==> did we use Anahita's word lists?
This file contains hidden or 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
<!-- | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
NewerOlder