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
+ set -e | |
+++ dirname ./cpp/thirdparty/build_thirdparty.sh | |
++ cd ./cpp/thirdparty | |
++ pwd | |
+ TP_DIR=/home/manoj/arrow/cpp/thirdparty | |
+ source /home/manoj/arrow/cpp/thirdparty/versions.sh | |
++ GTEST_VERSION=1.7.0 | |
++ GTEST_URL=https://github.com/google/googletest/archive/release-1.7.0.tar.gz | |
++ GTEST_BASEDIR=googletest-release-1.7.0 | |
++ GBENCHMARK_VERSION=1.0.0 |
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 | |
# Predicting the Behavior of the Supreme Court of the United States: A General Approach | |
# ================== | |
# * __Title__: Predicting the Behavior of the Supreme Court of the United States: A General Approach | |
# * __Authors__: [Daniel Martin Katz](http://www.law.msu.edu/faculty_staff/profile.php?prof=780), [Michael J Bommarito II](http://bommaritollc.com/), [Josh Blackman](http://joshblackman.com) | |
# * __Paper URL__: [http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2463244](http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2463244) | |
# * __Blog URL__: [http://lexpredict.com/portfolio/predicting-the-supreme-court/](http://lexpredict.com/portfolio/predicting-the-supreme-court/) | |
# | |
# ## Paper Abstract |
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
from math import exp | |
import numpy as np | |
from scipy.stats import beta | |
from sklearn.gaussian_process import GaussianProcessRegressor | |
from sklearn.gaussian_process.kernels import Matern | |
from sklearn.utils import safe_mask | |
from scipy import stats |
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
from sklearn.datasets import make_classification, load_iris, load_digits | |
from scipy.stats import uniform, rv_continuous | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.model_selection import RandomizedSearchCV, GridSearchCV, SequentialSearchCV | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# iris = load_iris() | |
# digits = load_digits() | |
# X, y = iris.data, iris.target |
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 urllib | |
import pickle | |
from urllib.error import HTTPError | |
from bs4 import BeautifulSoup | |
# The logic here is messy but it seems to work. | |
# The idea is to pass the html read from urllib to BeautifulSoup | |
# which will return a soup object. |
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 | |
import matplotlib.pyplot as plt | |
from sklearn.datasets import make_regression | |
from sklearn.linear_model import HuberRegressor, Ridge | |
from sklearn.metrics import mean_squared_error | |
from sklearn.preprocessing import StandardScaler | |
rng = np.random.RandomState(0) | |
noise = rng.randn(100).reshape(-1, 1) |
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.datasets import make_regression, load_boston | |
from sklearn.linear_model import HuberRegressor | |
from sklearn.metrics import mean_squared_error | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.grid_search import GridSearchCV | |
from sklearn.utils.estimator_checks import NotAnArray, _boston_subset | |
boston = load_boston() |
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
echo "Enter file name" | |
read file_name | |
output=$(grep -n 'since' $file_name) | |
echo "$output" > tmp.txt | |
while read name | |
do | |
IFS=': ' read -ra line_and_since <<< "$name" | |
line_no="${line_and_since[0]}" | |
version_no="${line_and_since[-1]}" |
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 org.apache.spark.SparkContext | |
import org.apache.spark.sql.SQLContext | |
val a = Array(1, 2, 3, 4) | |
val b = Array("one", "two", "three", "four") | |
val sc = SparkContext.getOrCreate() | |
val sql = SQLContext.getOrCreate(sc) | |
val df = sc.parallelize(a.zip(b)).toDF("number", "word") | |
# Collects the dataframe |
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 pyspark | |
W: 48, 0: Wildcard import pyspark.status (wildcard-import) | |
************* Module pyspark.broadcast | |
W: 27, 4: Redefining built-in 'unicode' (redefined-builtin) | |
W: 37, 4: Redefining name '_broadcastRegistry' from outer scope (line 33) (redefined-outer-name) | |
W: 37, 4: Module import itself (import-self) | |
R: 77, 4: Method could be a function (no-self-use) | |
R: 82, 4: Method could be a function (no-self-use) | |
W: 97,12: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) | |
************* Module pyspark.heapq3 |