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
FantasyBaseball3 <- log(FantasyBaseball[, -1]) | |
est_mean <- colMeans(FantasyBaseball3) | |
k=1 | |
for (i in 1:7){ | |
for (j in (i+1) : 8){ | |
est <- est_mean[i]-est_mean[j] | |
pair <- paste(names(est_mean[i]), names(est_mean[j]), sep="~") | |
Lower <- est-margin | |
Upper <- est+margin | |
result[k, ]<- c(pair, est, Lower, Upper) |
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
\begin{center} | |
\begin{tikzpicture} | |
\node (max) at (0,4) {$M_{1}^{1}$}; | |
\node (a) at (-2,2) {$A_{2}^{3}$}; | |
\node (c) at (2,2) {$D_{2}^{3}$}; | |
\node (d) at (-2,0) {$(B)_{3}^{6}$}; | |
\node (ad) at (0,0) {$(AD)_{4}^{9}$}; | |
\node (f) at (2,0) {$(C)_{3}^{6}$}; |
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
/* Delete the tables if they already exist */ | |
drop table if exists Movie; | |
drop table if exists Reviewer; | |
drop table if exists Rating; | |
/* Create the schema for our tables */ | |
create table Movie(mID int, title text, year int, director text); | |
create table Reviewer(rID int, name text); | |
create table Rating(rID int, mID int, stars int, ratingDate date); |
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
function (data, k = 10, scale = T, meth = "weighAvg", distData = NULL) | |
{ | |
n <- nrow(data) | |
if (!is.null(distData)) { | |
distInit <- n + 1 | |
data <- rbind(data, distData) | |
} | |
else distInit <- 1 | |
N <- nrow(data) | |
ncol <- ncol(data) |
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
https://gist.github.com/ac2b8cc202712d12595d |
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
import numpy | |
#data = numpy.random.random(100) | |
bins = numpy.linspace(15, 100, 5) | |
group_names = ['1', '2', '3', '4','5'] | |
#digitized = numpy.digitize(df_all['age'], bins) | |
categories = pd.cut(df_all['age'], bins, labels=group_names) | |
df['categories'] = pd.cut(df['postTestScore'], bins, labels=group_names) | |
categories | |
#bin_means = [data[digitized == i].mean() for i in range(1, len(bins))] | |
#df_all['age'] |
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
import seaborn as sns | |
sns.set_style("white", {'ytick.major.size': 10.0}) | |
sns.set_context("poster", font_scale=1.1) | |
income = df_train.MonthlyIncome.dropna() | |
income = income[income < 20000] | |
sns.distplot(income, color='#FD5C64') | |
#df[(df.T != 0).any()] | |
plt.xlabel('Income') | |
sns.despine() |
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
pd.concat((train_users, test_users), axis=0, ignore_index=True) |
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
users.drop('id',axis=1, inplace=True) |