restructured file management part 2
@ -1,944 +0,0 @@
|
|||||||
# Titan Robotics Team 2022: Data Analysis Module
|
|
||||||
# Written by Arthur Lu & Jacob Levine
|
|
||||||
# Notes:
|
|
||||||
# this should be imported as a python module using 'import analysis'
|
|
||||||
# this should be included in the local directory or environment variable
|
|
||||||
# this module has not been optimized for multhreaded computing
|
|
||||||
# number of easter eggs: 2
|
|
||||||
# setup:
|
|
||||||
|
|
||||||
__version__ = "1.0.9.000"
|
|
||||||
|
|
||||||
# changelog should be viewed using print(analysis.__changelog__)
|
|
||||||
__changelog__ = """changelog:
|
|
||||||
1.0.9.000:
|
|
||||||
- refactored
|
|
||||||
- numpyed everything
|
|
||||||
- removed stats in favor of numpy functions
|
|
||||||
1.0.8.005:
|
|
||||||
- minor fixes
|
|
||||||
1.0.8.004:
|
|
||||||
- removed a few unused dependencies
|
|
||||||
1.0.8.003:
|
|
||||||
- added p_value function
|
|
||||||
1.0.8.002:
|
|
||||||
- updated __all__ correctly to contain changes made in v 1.0.8.000 and v 1.0.8.001
|
|
||||||
1.0.8.001:
|
|
||||||
- refactors
|
|
||||||
- bugfixes
|
|
||||||
1.0.8.000:
|
|
||||||
- depreciated histo_analysis_old
|
|
||||||
- depreciated debug
|
|
||||||
- altered basic_analysis to take array data instead of filepath
|
|
||||||
- refactor
|
|
||||||
- optimization
|
|
||||||
1.0.7.002:
|
|
||||||
- bug fixes
|
|
||||||
1.0.7.001:
|
|
||||||
- bug fixes
|
|
||||||
1.0.7.000:
|
|
||||||
- added tanh_regression (logistical regression)
|
|
||||||
- bug fixes
|
|
||||||
1.0.6.005:
|
|
||||||
- added z_normalize function to normalize dataset
|
|
||||||
- bug fixes
|
|
||||||
1.0.6.004:
|
|
||||||
- bug fixes
|
|
||||||
1.0.6.003:
|
|
||||||
- bug fixes
|
|
||||||
1.0.6.002:
|
|
||||||
- bug fixes
|
|
||||||
1.0.6.001:
|
|
||||||
- corrected __all__ to contain all of the functions
|
|
||||||
1.0.6.000:
|
|
||||||
- added calc_overfit, which calculates two measures of overfit, error and performance
|
|
||||||
- added calculating overfit to optimize_regression
|
|
||||||
1.0.5.000:
|
|
||||||
- added optimize_regression function, which is a sample function to find the optimal regressions
|
|
||||||
- optimize_regression function filters out some overfit funtions (functions with r^2 = 1)
|
|
||||||
- planned addition: overfit detection in the optimize_regression function
|
|
||||||
1.0.4.002:
|
|
||||||
- added __changelog__
|
|
||||||
- updated debug function with log and exponential regressions
|
|
||||||
1.0.4.001:
|
|
||||||
- added log regressions
|
|
||||||
- added exponential regressions
|
|
||||||
- added log_regression and exp_regression to __all__
|
|
||||||
1.0.3.008:
|
|
||||||
- added debug function to further consolidate functions
|
|
||||||
1.0.3.007:
|
|
||||||
- added builtin benchmark function
|
|
||||||
- added builtin random (linear) data generation function
|
|
||||||
- added device initialization (_init_device)
|
|
||||||
1.0.3.006:
|
|
||||||
- reorganized the imports list to be in alphabetical order
|
|
||||||
- added search and regurgitate functions to c_entities, nc_entities, obstacles, objectives
|
|
||||||
1.0.3.005:
|
|
||||||
- major bug fixes
|
|
||||||
- updated historical analysis
|
|
||||||
- depreciated old historical analysis
|
|
||||||
1.0.3.004:
|
|
||||||
- added __version__, __author__, __all__
|
|
||||||
- added polynomial regression
|
|
||||||
- added root mean squared function
|
|
||||||
- added r squared function
|
|
||||||
1.0.3.003:
|
|
||||||
- bug fixes
|
|
||||||
- added c_entities
|
|
||||||
1.0.3.002:
|
|
||||||
- bug fixes
|
|
||||||
- added nc_entities, obstacles, objectives
|
|
||||||
- consolidated statistics.py to analysis.py
|
|
||||||
1.0.3.001:
|
|
||||||
- compiled 1d, column, and row basic stats into basic stats function
|
|
||||||
1.0.3.000:
|
|
||||||
- added historical analysis function
|
|
||||||
1.0.2.xxx:
|
|
||||||
- added z score test
|
|
||||||
1.0.1.xxx:
|
|
||||||
- major bug fixes
|
|
||||||
1.0.0.xxx:
|
|
||||||
- added loading csv
|
|
||||||
- added 1d, column, row basic stats
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = (
|
|
||||||
"Arthur Lu <arthurlu@ttic.edu>, "
|
|
||||||
"Jacob Levine <jlevine@ttic.edu>,"
|
|
||||||
)
|
|
||||||
|
|
||||||
__all__ = [
|
|
||||||
'_init_device',
|
|
||||||
'c_entities',
|
|
||||||
'nc_entities',
|
|
||||||
'obstacles',
|
|
||||||
'objectives',
|
|
||||||
'load_csv',
|
|
||||||
'basic_stats',
|
|
||||||
'z_score',
|
|
||||||
'z_normalize',
|
|
||||||
'stdev_z_split',
|
|
||||||
'histo_analysis',
|
|
||||||
'poly_regression',
|
|
||||||
'log_regression',
|
|
||||||
'exp_regression',
|
|
||||||
'r_squared',
|
|
||||||
'rms',
|
|
||||||
'calc_overfit',
|
|
||||||
'strip_data',
|
|
||||||
'optimize_regression',
|
|
||||||
'select_best_regression',
|
|
||||||
'basic_analysis',
|
|
||||||
# all statistics functions left out due to integration in other functions
|
|
||||||
]
|
|
||||||
|
|
||||||
# now back to your regularly scheduled programming:
|
|
||||||
|
|
||||||
# imports (now in alphabetical order! v 1.0.3.006):
|
|
||||||
|
|
||||||
from bisect import bisect_left, bisect_right
|
|
||||||
import collections
|
|
||||||
import csv
|
|
||||||
from decimal import Decimal
|
|
||||||
import functools
|
|
||||||
from fractions import Fraction
|
|
||||||
from itertools import groupby
|
|
||||||
import math
|
|
||||||
import matplotlib
|
|
||||||
import numbers
|
|
||||||
import numpy as np
|
|
||||||
import pandas
|
|
||||||
import random
|
|
||||||
import scipy
|
|
||||||
from scipy.optimize import curve_fit
|
|
||||||
from scipy import stats
|
|
||||||
from sklearn import *
|
|
||||||
# import statistics <-- statistics.py functions have been integrated into analysis.py as of v 1.0.3.002
|
|
||||||
import time
|
|
||||||
import torch
|
|
||||||
|
|
||||||
class error(ValueError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _init_device(setting, arg): # initiates computation device for ANNs
|
|
||||||
if setting == "cuda":
|
|
||||||
try:
|
|
||||||
return torch.device(setting + ":" + str(arg) if torch.cuda.is_available() else "cpu")
|
|
||||||
except:
|
|
||||||
raise error("could not assign cuda or cpu")
|
|
||||||
elif setting == "cpu":
|
|
||||||
try:
|
|
||||||
return torch.device("cpu")
|
|
||||||
except:
|
|
||||||
raise error("could not assign cpu")
|
|
||||||
else:
|
|
||||||
raise error("specified device does not exist")
|
|
||||||
|
|
||||||
def load_csv(filepath):
|
|
||||||
with open(filepath, newline='') as csvfile:
|
|
||||||
file_array = np.array(list(csv.reader(csvfile)))
|
|
||||||
csvfile.close()
|
|
||||||
return file_array
|
|
||||||
|
|
||||||
# data=array, mode = ['1d':1d_basic_stats, 'column':c_basic_stats, 'row':r_basic_stats], arg for mode 1 or mode 2 for column or row
|
|
||||||
def basic_stats(data, method, arg):
|
|
||||||
|
|
||||||
if method == 'debug':
|
|
||||||
return "basic_stats requires 3 args: data, mode, arg; where data is data to be analyzed, mode is an int from 0 - 2 depending on type of analysis (by column or by row) and is only applicable to 2d arrays (for 1d arrays use mode 1), and arg is row/column number for mode 1 or mode 2; function returns: [mean, median, mode, stdev, variance]"
|
|
||||||
|
|
||||||
if method == "1d" or method == 0:
|
|
||||||
|
|
||||||
data_t = np.array(data).astype(float)
|
|
||||||
|
|
||||||
_mean = mean(data_t)
|
|
||||||
_median = median(data_t)
|
|
||||||
try:
|
|
||||||
_mode = mode(data_t)
|
|
||||||
except:
|
|
||||||
_mode = None
|
|
||||||
try:
|
|
||||||
_stdev = stdev(data_t)
|
|
||||||
except:
|
|
||||||
_stdev = None
|
|
||||||
try:
|
|
||||||
_variance = variance(data_t)
|
|
||||||
except:
|
|
||||||
_variance = None
|
|
||||||
|
|
||||||
return _mean, _median, _mode, _stdev, _variance
|
|
||||||
"""
|
|
||||||
elif method == "column" or method == 1:
|
|
||||||
|
|
||||||
c_data = []
|
|
||||||
c_data_sorted = []
|
|
||||||
|
|
||||||
for i in data:
|
|
||||||
try:
|
|
||||||
c_data.append(float(i[arg]))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
_mean = mean(c_data)
|
|
||||||
_median = median(c_data)
|
|
||||||
try:
|
|
||||||
_mode = mode(c_data)
|
|
||||||
except:
|
|
||||||
_mode = None
|
|
||||||
try:
|
|
||||||
_stdev = stdev(c_data)
|
|
||||||
except:
|
|
||||||
_stdev = None
|
|
||||||
try:
|
|
||||||
_variance = variance(c_data)
|
|
||||||
except:
|
|
||||||
_variance = None
|
|
||||||
|
|
||||||
return _mean, _median, _mode, _stdev, _variance
|
|
||||||
|
|
||||||
elif method == "row" or method == 2:
|
|
||||||
|
|
||||||
r_data = []
|
|
||||||
|
|
||||||
for i in range(len(data[arg])):
|
|
||||||
r_data.append(float(data[arg][i]))
|
|
||||||
|
|
||||||
_mean = mean(r_data)
|
|
||||||
_median = median(r_data)
|
|
||||||
try:
|
|
||||||
_mode = mode(r_data)
|
|
||||||
except:
|
|
||||||
_mode = None
|
|
||||||
try:
|
|
||||||
_stdev = stdev(r_data)
|
|
||||||
except:
|
|
||||||
_stdev = None
|
|
||||||
try:
|
|
||||||
_variance = variance(r_data)
|
|
||||||
except:
|
|
||||||
_variance = None
|
|
||||||
|
|
||||||
return _mean, _median, _mode, _stdev, _variance
|
|
||||||
|
|
||||||
else:
|
|
||||||
raise error("method error")
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
# returns z score with inputs of point, mean and standard deviation of spread
|
|
||||||
def z_score(point, mean, stdev):
|
|
||||||
score = (point - mean) / stdev
|
|
||||||
return score
|
|
||||||
|
|
||||||
# mode is either 'x' or 'y' or 'both' depending on the variable(s) to be normalized
|
|
||||||
def z_normalize(x, y, mode):
|
|
||||||
|
|
||||||
x_norm = np.array().astype(float)
|
|
||||||
y_norm = np.array().astype(float)
|
|
||||||
|
|
||||||
mean = 0
|
|
||||||
stdev = 0
|
|
||||||
|
|
||||||
if mode == 'x':
|
|
||||||
_mean, _median, _mode, _stdev, _variance = basic_stats(x, "1d", 0)
|
|
||||||
|
|
||||||
for i in range(0, len(x), 1):
|
|
||||||
x_norm.append(z_score(x[i], _mean, _stdev))
|
|
||||||
|
|
||||||
return x_norm, y
|
|
||||||
|
|
||||||
if mode == 'y':
|
|
||||||
_mean, _median, _mode, _stdev, _variance = basic_stats(y, "1d", 0)
|
|
||||||
|
|
||||||
for i in range(0, len(y), 1):
|
|
||||||
y_norm.append(z_score(y[i], _mean, _stdev))
|
|
||||||
|
|
||||||
return x, y_norm
|
|
||||||
|
|
||||||
if mode == 'both':
|
|
||||||
_mean, _median, _mode, _stdev, _variance = basic_stats(x, "1d", 0)
|
|
||||||
|
|
||||||
for i in range(0, len(x), 1):
|
|
||||||
x_norm.append(z_score(x[i], _mean, _stdev))
|
|
||||||
|
|
||||||
_mean, _median, _mode, _stdev, _variance = basic_stats(y, "1d", 0)
|
|
||||||
|
|
||||||
for i in range(0, len(y), 1):
|
|
||||||
y_norm.append(z_score(y[i], _mean, _stdev))
|
|
||||||
|
|
||||||
return x_norm, y_norm
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
return error('method error')
|
|
||||||
|
|
||||||
|
|
||||||
# returns n-th percentile of spread given mean, standard deviation, lower z-score, and upper z-score
|
|
||||||
def stdev_z_split(mean, stdev, delta, low_bound, high_bound):
|
|
||||||
|
|
||||||
z_split = np.array().astype(float)
|
|
||||||
i = low_bound
|
|
||||||
|
|
||||||
while True:
|
|
||||||
z_split.append(float((1 / (stdev * math.sqrt(2 * math.pi))) *
|
|
||||||
math.e ** (-0.5 * (((i - mean) / stdev) ** 2))))
|
|
||||||
i = i + delta
|
|
||||||
if i > high_bound:
|
|
||||||
break
|
|
||||||
|
|
||||||
return z_split
|
|
||||||
|
|
||||||
|
|
||||||
def histo_analysis(hist_data, delta, low_bound, high_bound):
|
|
||||||
|
|
||||||
if hist_data == 'debug':
|
|
||||||
return ('returns list of predicted values based on historical data; input delta for delta step in z-score and lower and higher bounds in number of standard deviations')
|
|
||||||
|
|
||||||
derivative = []
|
|
||||||
|
|
||||||
for i in range(0, len(hist_data), 1):
|
|
||||||
try:
|
|
||||||
derivative.append(float(hist_data[i - 1]) - float(hist_data[i]))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
derivative_sorted = sorted(derivative, key=int)
|
|
||||||
mean_derivative = basic_stats(derivative_sorted, "1d", 0)[0]
|
|
||||||
stdev_derivative = basic_stats(derivative_sorted, "1d", 0)[3]
|
|
||||||
|
|
||||||
predictions = []
|
|
||||||
pred_change = 0
|
|
||||||
|
|
||||||
i = low_bound
|
|
||||||
|
|
||||||
while True:
|
|
||||||
if i > high_bound:
|
|
||||||
break
|
|
||||||
|
|
||||||
try:
|
|
||||||
pred_change = mean_derivative + i * stdev_derivative
|
|
||||||
except:
|
|
||||||
pred_change = mean_derivative
|
|
||||||
|
|
||||||
predictions.append(float(hist_data[-1:][0]) + pred_change)
|
|
||||||
|
|
||||||
i = i + delta
|
|
||||||
|
|
||||||
return predictions
|
|
||||||
|
|
||||||
|
|
||||||
def poly_regression(x, y, power):
|
|
||||||
|
|
||||||
if x == "null": # if x is 'null', then x will be filled with integer points between 1 and the size of y
|
|
||||||
x = []
|
|
||||||
|
|
||||||
for i in range(len(y)):
|
|
||||||
print(i)
|
|
||||||
x.append(i + 1)
|
|
||||||
|
|
||||||
reg_eq = scipy.polyfit(x, y, deg=power)
|
|
||||||
eq_str = ""
|
|
||||||
|
|
||||||
for i in range(0, len(reg_eq), 1):
|
|
||||||
if i < len(reg_eq) - 1:
|
|
||||||
eq_str = eq_str + str(reg_eq[i]) + \
|
|
||||||
"*(z**" + str(len(reg_eq) - i - 1) + ")+"
|
|
||||||
else:
|
|
||||||
eq_str = eq_str + str(reg_eq[i]) + \
|
|
||||||
"*(z**" + str(len(reg_eq) - i - 1) + ")"
|
|
||||||
|
|
||||||
vals = []
|
|
||||||
|
|
||||||
for i in range(0, len(x), 1):
|
|
||||||
z = x[i]
|
|
||||||
|
|
||||||
try:
|
|
||||||
exec("vals.append(" + eq_str + ")")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
_rms = rms(vals, y)
|
|
||||||
r2_d2 = r_squared(vals, y)
|
|
||||||
|
|
||||||
return [eq_str, _rms, r2_d2]
|
|
||||||
|
|
||||||
|
|
||||||
def log_regression(x, y, base):
|
|
||||||
|
|
||||||
x_fit = []
|
|
||||||
|
|
||||||
for i in range(len(x)):
|
|
||||||
try:
|
|
||||||
# change of base for logs
|
|
||||||
x_fit.append(np.log(x[i]) / np.log(base))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# y = reg_eq[0] * log(x, base) + reg_eq[1]
|
|
||||||
reg_eq = np.polyfit(x_fit, y, 1)
|
|
||||||
q_str = str(reg_eq[0]) + "* (np.log(z) / np.log(" + \
|
|
||||||
str(base) + "))+" + str(reg_eq[1])
|
|
||||||
vals = []
|
|
||||||
|
|
||||||
for i in range(len(x)):
|
|
||||||
z = x[i]
|
|
||||||
|
|
||||||
try:
|
|
||||||
exec("vals.append(" + eq_str + ")")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
_rms = rms(vals, y)
|
|
||||||
r2_d2 = r_squared(vals, y)
|
|
||||||
|
|
||||||
return eq_str, _rms, r2_d2
|
|
||||||
|
|
||||||
|
|
||||||
def exp_regression(x, y, base):
|
|
||||||
|
|
||||||
y_fit = []
|
|
||||||
|
|
||||||
for i in range(len(y)):
|
|
||||||
try:
|
|
||||||
# change of base for logs
|
|
||||||
y_fit.append(np.log(y[i]) / np.log(base))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# y = base ^ (reg_eq[0] * x) * base ^ (reg_eq[1])
|
|
||||||
reg_eq = np.polyfit(x, y_fit, 1, w=np.sqrt(y_fit))
|
|
||||||
eq_str = "(" + str(base) + "**(" + \
|
|
||||||
str(reg_eq[0]) + "*z))*(" + str(base) + "**(" + str(reg_eq[1]) + "))"
|
|
||||||
vals = []
|
|
||||||
|
|
||||||
for i in range(len(x)):
|
|
||||||
z = x[i]
|
|
||||||
|
|
||||||
try:
|
|
||||||
exec("vals.append(" + eq_str + ")")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
_rms = rms(vals, y)
|
|
||||||
r2_d2 = r_squared(vals, y)
|
|
||||||
|
|
||||||
return eq_str, _rms, r2_d2
|
|
||||||
|
|
||||||
|
|
||||||
def tanh_regression(x, y):
|
|
||||||
|
|
||||||
def tanh(x, a, b, c, d):
|
|
||||||
|
|
||||||
return a * np.tanh(b * (x - c)) + d
|
|
||||||
|
|
||||||
reg_eq = np.float64(curve_fit(tanh, np.array(x), np.array(y))[0]).tolist()
|
|
||||||
eq_str = str(reg_eq[0]) + " * np.tanh(" + str(reg_eq[1]) + \
|
|
||||||
"*(z - " + str(reg_eq[2]) + ")) + " + str(reg_eq[3])
|
|
||||||
vals = []
|
|
||||||
|
|
||||||
for i in range(len(x)):
|
|
||||||
z = x[i]
|
|
||||||
try:
|
|
||||||
exec("vals.append(" + eq_str + ")")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
_rms = rms(vals, y)
|
|
||||||
r2_d2 = r_squared(vals, y)
|
|
||||||
|
|
||||||
return eq_str, _rms, r2_d2
|
|
||||||
|
|
||||||
|
|
||||||
def r_squared(predictions, targets): # assumes equal size inputs
|
|
||||||
|
|
||||||
return metrics.r2_score(np.array(targets), np.array(predictions))
|
|
||||||
|
|
||||||
|
|
||||||
def rms(predictions, targets): # assumes equal size inputs
|
|
||||||
|
|
||||||
_sum = 0
|
|
||||||
|
|
||||||
for i in range(0, len(targets), 1):
|
|
||||||
_sum = (targets[i] - predictions[i]) ** 2
|
|
||||||
|
|
||||||
return float(math.sqrt(_sum / len(targets)))
|
|
||||||
|
|
||||||
|
|
||||||
def calc_overfit(equation, rms_train, r2_train, x_test, y_test):
|
|
||||||
|
|
||||||
# performance overfit = performance(train) - performance(test) where performance is r^2
|
|
||||||
# error overfit = error(train) - error(test) where error is rms; biased towards smaller values
|
|
||||||
|
|
||||||
vals = []
|
|
||||||
|
|
||||||
for i in range(0, len(x_test), 1):
|
|
||||||
|
|
||||||
z = x_test[i]
|
|
||||||
|
|
||||||
exec("vals.append(" + equation + ")")
|
|
||||||
|
|
||||||
r2_test = r_squared(vals, y_test)
|
|
||||||
rms_test = rms(vals, y_test)
|
|
||||||
|
|
||||||
return r2_train - r2_test
|
|
||||||
|
|
||||||
|
|
||||||
def strip_data(data, mode):
|
|
||||||
|
|
||||||
if mode == "adam": # x is the row number, y are the data
|
|
||||||
pass
|
|
||||||
|
|
||||||
if mode == "eve": # x are the data, y is the column number
|
|
||||||
pass
|
|
||||||
|
|
||||||
else:
|
|
||||||
raise error("mode error")
|
|
||||||
|
|
||||||
|
|
||||||
# _range in poly regression is the range of powers tried, and in log/exp it is the inverse of the stepsize taken from -1000 to 1000
|
|
||||||
def optimize_regression(x, y, _range, resolution):
|
|
||||||
# usage not: for demonstration purpose only, performance is shit
|
|
||||||
if type(resolution) != int:
|
|
||||||
raise error("resolution must be int")
|
|
||||||
|
|
||||||
x_train = x
|
|
||||||
y_train = []
|
|
||||||
|
|
||||||
for i in range(len(y)):
|
|
||||||
y_train.append(float(y[i]))
|
|
||||||
|
|
||||||
x_test = []
|
|
||||||
y_test = []
|
|
||||||
|
|
||||||
for i in range(0, math.floor(len(x) * 0.5), 1):
|
|
||||||
index = random.randint(0, len(x) - 1)
|
|
||||||
|
|
||||||
x_test.append(x[index])
|
|
||||||
y_test.append(float(y[index]))
|
|
||||||
|
|
||||||
x_train.pop(index)
|
|
||||||
y_train.pop(index)
|
|
||||||
|
|
||||||
#print(x_train, x_test)
|
|
||||||
#print(y_train, y_test)
|
|
||||||
|
|
||||||
eqs = []
|
|
||||||
rmss = []
|
|
||||||
r2s = []
|
|
||||||
|
|
||||||
for i in range(0, _range + 1, 1):
|
|
||||||
try:
|
|
||||||
x, y, z = poly_regression(x_train, y_train, i)
|
|
||||||
eqs.append(x)
|
|
||||||
rmss.append(y)
|
|
||||||
r2s.append(z)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
for i in range(1, 100 * resolution + 1):
|
|
||||||
try:
|
|
||||||
x, y, z = exp_regression(x_train, y_train, float(i / resolution))
|
|
||||||
eqs.append(x)
|
|
||||||
rmss.append(y)
|
|
||||||
r2s.append(z)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
for i in range(1, 100 * resolution + 1):
|
|
||||||
try:
|
|
||||||
x, y, z = log_regression(x_train, y_train, float(i / resolution))
|
|
||||||
eqs.append(x)
|
|
||||||
rmss.append(y)
|
|
||||||
r2s.append(z)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
x, y, z = tanh_regression(x_train, y_train)
|
|
||||||
|
|
||||||
eqs.append(x)
|
|
||||||
rmss.append(y)
|
|
||||||
r2s.append(z)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# marks all equations where r2 = 1 as they 95% of the time overfit the data
|
|
||||||
for i in range(0, len(eqs), 1):
|
|
||||||
if r2s[i] == 1:
|
|
||||||
eqs[i] = ""
|
|
||||||
rmss[i] = ""
|
|
||||||
r2s[i] = ""
|
|
||||||
|
|
||||||
while True: # removes all equations marked for removal
|
|
||||||
try:
|
|
||||||
eqs.remove('')
|
|
||||||
rmss.remove('')
|
|
||||||
r2s.remove('')
|
|
||||||
except:
|
|
||||||
break
|
|
||||||
|
|
||||||
overfit = []
|
|
||||||
|
|
||||||
for i in range(0, len(eqs), 1):
|
|
||||||
|
|
||||||
overfit.append(calc_overfit(eqs[i], rmss[i], r2s[i], x_test, y_test))
|
|
||||||
|
|
||||||
return eqs, rmss, r2s, overfit
|
|
||||||
|
|
||||||
|
|
||||||
def select_best_regression(eqs, rmss, r2s, overfit, selector):
|
|
||||||
|
|
||||||
b_eq = ""
|
|
||||||
b_rms = 0
|
|
||||||
b_r2 = 0
|
|
||||||
b_overfit = 0
|
|
||||||
|
|
||||||
ind = 0
|
|
||||||
|
|
||||||
if selector == "min_overfit":
|
|
||||||
|
|
||||||
ind = np.argmin(overfit)
|
|
||||||
|
|
||||||
b_eq = eqs[ind]
|
|
||||||
b_rms = rmss[ind]
|
|
||||||
b_r2 = r2s[ind]
|
|
||||||
b_overfit = overfit[ind]
|
|
||||||
|
|
||||||
if selector == "max_r2s":
|
|
||||||
|
|
||||||
ind = np.argmax(r2s)
|
|
||||||
b_eq = eqs[ind]
|
|
||||||
b_rms = rmss[ind]
|
|
||||||
b_r2 = r2s[ind]
|
|
||||||
b_overfit = overfit[ind]
|
|
||||||
|
|
||||||
return b_eq, b_rms, b_r2, b_overfit
|
|
||||||
|
|
||||||
|
|
||||||
def p_value(x, y): # takes 2 1d arrays
|
|
||||||
|
|
||||||
return stats.ttest_ind(x, y)[1]
|
|
||||||
|
|
||||||
|
|
||||||
# assumes that rows are the independent variable and columns are the dependant. also assumes that time flows from lowest column to highest column.
|
|
||||||
def basic_analysis(data):
|
|
||||||
|
|
||||||
row = len(data)
|
|
||||||
column = []
|
|
||||||
|
|
||||||
for i in range(0, row, 1):
|
|
||||||
column.append(len(data[i]))
|
|
||||||
|
|
||||||
column_max = max(column)
|
|
||||||
row_b_stats = []
|
|
||||||
row_histo = []
|
|
||||||
|
|
||||||
for i in range(0, row, 1):
|
|
||||||
row_b_stats.append(basic_stats(data, "row", i))
|
|
||||||
row_histo.append(histo_analysis(data[i], 0.67449, -0.67449, 0.67449))
|
|
||||||
|
|
||||||
column_b_stats = []
|
|
||||||
|
|
||||||
for i in range(0, column_max, 1):
|
|
||||||
column_b_stats.append(basic_stats(data, "column", i))
|
|
||||||
|
|
||||||
return[row_b_stats, column_b_stats, row_histo]
|
|
||||||
|
|
||||||
|
|
||||||
def benchmark(x, y):
|
|
||||||
|
|
||||||
start_g = time.time()
|
|
||||||
generate_data("data/data.csv", x, y, -10, 10)
|
|
||||||
end_g = time.time()
|
|
||||||
|
|
||||||
start_a = time.time()
|
|
||||||
basic_analysis("data/data.csv")
|
|
||||||
end_a = time.time()
|
|
||||||
|
|
||||||
return [(end_g - start_g), (end_a - start_a)]
|
|
||||||
|
|
||||||
|
|
||||||
def generate_data(filename, x, y, low, high):
|
|
||||||
|
|
||||||
file = open(filename, "w")
|
|
||||||
|
|
||||||
for i in range(0, y, 1):
|
|
||||||
temp = ""
|
|
||||||
|
|
||||||
for j in range(0, x - 1, 1):
|
|
||||||
temp = str(random.uniform(low, high)) + "," + temp
|
|
||||||
|
|
||||||
temp = temp + str(random.uniform(low, high))
|
|
||||||
file.write(temp + "\n")
|
|
||||||
|
|
||||||
def mean(data):
|
|
||||||
|
|
||||||
return np.mean(data)
|
|
||||||
|
|
||||||
def median(data):
|
|
||||||
|
|
||||||
return np.median(data)
|
|
||||||
|
|
||||||
def mode(data):
|
|
||||||
|
|
||||||
return np.argmax(np.bincount(data))
|
|
||||||
|
|
||||||
def stdev(data):
|
|
||||||
|
|
||||||
return np.std(data)
|
|
||||||
|
|
||||||
def variance(data):
|
|
||||||
|
|
||||||
return np.var(data)
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
class StatisticsError(ValueError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def _sum(data, start=0):
|
|
||||||
count = 0
|
|
||||||
n, d = _exact_ratio(start)
|
|
||||||
partials = {d: n}
|
|
||||||
partials_get = partials.get
|
|
||||||
T = _coerce(int, type(start))
|
|
||||||
for typ, values in groupby(data, type):
|
|
||||||
T = _coerce(T, typ) # or raise TypeError
|
|
||||||
for n, d in map(_exact_ratio, values):
|
|
||||||
count += 1
|
|
||||||
partials[d] = partials_get(d, 0) + n
|
|
||||||
if None in partials:
|
|
||||||
|
|
||||||
total = partials[None]
|
|
||||||
assert not _isfinite(total)
|
|
||||||
else:
|
|
||||||
|
|
||||||
total = sum(Fraction(n, d) for d, n in sorted(partials.items()))
|
|
||||||
return (T, total, count)
|
|
||||||
|
|
||||||
|
|
||||||
def _isfinite(x):
|
|
||||||
try:
|
|
||||||
return x.is_finite() # Likely a Decimal.
|
|
||||||
except AttributeError:
|
|
||||||
return math.isfinite(x) # Coerces to float first.
|
|
||||||
|
|
||||||
|
|
||||||
def _coerce(T, S):
|
|
||||||
|
|
||||||
assert T is not bool, "initial type T is bool"
|
|
||||||
|
|
||||||
if T is S:
|
|
||||||
return T
|
|
||||||
|
|
||||||
if S is int or S is bool:
|
|
||||||
return T
|
|
||||||
if T is int:
|
|
||||||
return S
|
|
||||||
|
|
||||||
if issubclass(S, T):
|
|
||||||
return S
|
|
||||||
if issubclass(T, S):
|
|
||||||
return T
|
|
||||||
|
|
||||||
if issubclass(T, int):
|
|
||||||
return S
|
|
||||||
if issubclass(S, int):
|
|
||||||
return T
|
|
||||||
|
|
||||||
if issubclass(T, Fraction) and issubclass(S, float):
|
|
||||||
return S
|
|
||||||
if issubclass(T, float) and issubclass(S, Fraction):
|
|
||||||
return T
|
|
||||||
|
|
||||||
msg = "don't know how to coerce %s and %s"
|
|
||||||
raise TypeError(msg % (T.__name__, S.__name__))
|
|
||||||
|
|
||||||
|
|
||||||
def _exact_ratio(x):
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
|
||||||
if type(x) is float or type(x) is Decimal:
|
|
||||||
return x.as_integer_ratio()
|
|
||||||
try:
|
|
||||||
|
|
||||||
return (x.numerator, x.denominator)
|
|
||||||
except AttributeError:
|
|
||||||
try:
|
|
||||||
|
|
||||||
return x.as_integer_ratio()
|
|
||||||
except AttributeError:
|
|
||||||
|
|
||||||
pass
|
|
||||||
except (OverflowError, ValueError):
|
|
||||||
|
|
||||||
assert not _isfinite(x)
|
|
||||||
return (x, None)
|
|
||||||
msg = "can't convert type '{}' to numerator/denominator"
|
|
||||||
raise TypeError(msg.format(type(x).__name__))
|
|
||||||
|
|
||||||
|
|
||||||
def _convert(value, T):
|
|
||||||
|
|
||||||
if type(value) is T:
|
|
||||||
|
|
||||||
return value
|
|
||||||
if issubclass(T, int) and value.denominator != 1:
|
|
||||||
T = float
|
|
||||||
try:
|
|
||||||
|
|
||||||
return T(value)
|
|
||||||
except TypeError:
|
|
||||||
if issubclass(T, Decimal):
|
|
||||||
return T(value.numerator) / T(value.denominator)
|
|
||||||
else:
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
def _counts(data):
|
|
||||||
|
|
||||||
table = collections.Counter(iter(data)).most_common()
|
|
||||||
if not table:
|
|
||||||
return table
|
|
||||||
|
|
||||||
maxfreq = table[0][1]
|
|
||||||
for i in range(1, len(table)):
|
|
||||||
if table[i][1] != maxfreq:
|
|
||||||
table = table[:i]
|
|
||||||
break
|
|
||||||
return table
|
|
||||||
|
|
||||||
|
|
||||||
def _find_lteq(a, x):
|
|
||||||
|
|
||||||
i = bisect_left(a, x)
|
|
||||||
if i != len(a) and a[i] == x:
|
|
||||||
return i
|
|
||||||
raise ValueError
|
|
||||||
|
|
||||||
|
|
||||||
def _find_rteq(a, l, x):
|
|
||||||
|
|
||||||
i = bisect_right(a, x, lo=l)
|
|
||||||
if i != (len(a) + 1) and a[i - 1] == x:
|
|
||||||
return i - 1
|
|
||||||
raise ValueError
|
|
||||||
|
|
||||||
|
|
||||||
def _fail_neg(values, errmsg='negative value'):
|
|
||||||
|
|
||||||
for x in values:
|
|
||||||
if x < 0:
|
|
||||||
raise StatisticsError(errmsg)
|
|
||||||
yield x
|
|
||||||
def mean(data):
|
|
||||||
|
|
||||||
if iter(data) is data:
|
|
||||||
data = list(data)
|
|
||||||
n = len(data)
|
|
||||||
if n < 1:
|
|
||||||
raise StatisticsError('mean requires at least one data point')
|
|
||||||
T, total, count = _sum(data)
|
|
||||||
assert count == n
|
|
||||||
return _convert(total / n, T)
|
|
||||||
|
|
||||||
|
|
||||||
def median(data):
|
|
||||||
|
|
||||||
data = sorted(data)
|
|
||||||
n = len(data)
|
|
||||||
if n == 0:
|
|
||||||
raise StatisticsError("no median for empty data")
|
|
||||||
if n % 2 == 1:
|
|
||||||
return data[n // 2]
|
|
||||||
else:
|
|
||||||
i = n // 2
|
|
||||||
return (data[i - 1] + data[i]) / 2
|
|
||||||
|
|
||||||
|
|
||||||
def mode(data):
|
|
||||||
|
|
||||||
table = _counts(data)
|
|
||||||
if len(table) == 1:
|
|
||||||
return table[0][0]
|
|
||||||
elif table:
|
|
||||||
raise StatisticsError(
|
|
||||||
'no unique mode; found %d equally common values' % len(table)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
raise StatisticsError('no mode for empty data')
|
|
||||||
|
|
||||||
|
|
||||||
def _ss(data, c=None):
|
|
||||||
|
|
||||||
if c is None:
|
|
||||||
c = mean(data)
|
|
||||||
T, total, count = _sum((x - c)**2 for x in data)
|
|
||||||
|
|
||||||
U, total2, count2 = _sum((x - c) for x in data)
|
|
||||||
assert T == U and count == count2
|
|
||||||
total -= total2**2 / len(data)
|
|
||||||
assert not total < 0, 'negative sum of square deviations: %f' % total
|
|
||||||
return (T, total)
|
|
||||||
|
|
||||||
|
|
||||||
def variance(data, xbar=None):
|
|
||||||
|
|
||||||
if iter(data) is data:
|
|
||||||
data = list(data)
|
|
||||||
n = len(data)
|
|
||||||
if n < 2:
|
|
||||||
raise StatisticsError('variance requires at least two data points')
|
|
||||||
T, ss = _ss(data, xbar)
|
|
||||||
return _convert(ss / (n - 1), T)
|
|
||||||
|
|
||||||
|
|
||||||
def stdev(data, xbar=None):
|
|
||||||
|
|
||||||
var = variance(data, xbar)
|
|
||||||
try:
|
|
||||||
return var.sqrt()
|
|
||||||
except AttributeError:
|
|
||||||
return math.sqrt(var)
|
|
||||||
"""
|
|
@ -1,2 +0,0 @@
|
|||||||
python setup.py build_ext --inplace
|
|
||||||
pause
|
|
@ -1 +0,0 @@
|
|||||||
python setup.py build_ext --inplace
|
|
@ -1,5 +0,0 @@
|
|||||||
from distutils.core import setup
|
|
||||||
from Cython.Build import cythonize
|
|
||||||
|
|
||||||
setup(name='analysis',
|
|
||||||
ext_modules=cythonize("analysis.py"))
|
|
@ -1 +0,0 @@
|
|||||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug"},"path":"app-debug.apk","properties":{}}]
|
|
@ -1,13 +0,0 @@
|
|||||||
*.iml
|
|
||||||
.gradle
|
|
||||||
/local.properties
|
|
||||||
/.idea/caches
|
|
||||||
/.idea/libraries
|
|
||||||
/.idea/modules.xml
|
|
||||||
/.idea/workspace.xml
|
|
||||||
/.idea/navEditor.xml
|
|
||||||
/.idea/assetWizardSettings.xml
|
|
||||||
.DS_Store
|
|
||||||
/build
|
|
||||||
/captures
|
|
||||||
.externalNativeBuild
|
|
@ -1,29 +0,0 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
|
||||||
<code_scheme name="Project" version="173">
|
|
||||||
<Objective-C-extensions>
|
|
||||||
<file>
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
|
||||||
</file>
|
|
||||||
<class>
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
|
||||||
</class>
|
|
||||||
<extensions>
|
|
||||||
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
|
||||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
|
||||||
</extensions>
|
|
||||||
</Objective-C-extensions>
|
|
||||||
</code_scheme>
|
|
||||||
</component>
|
|
@ -1,18 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="GradleSettings">
|
|
||||||
<option name="linkedExternalProjectsSettings">
|
|
||||||
<GradleProjectSettings>
|
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
||||||
<option name="modules">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$" />
|
|
||||||
<option value="$PROJECT_DIR$/app" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
|
||||||
</GradleProjectSettings>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectType">
|
|
||||||
<option name="id" value="Android" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -1,28 +0,0 @@
|
|||||||
apply plugin: 'com.android.application'
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 28
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "com.example.titanscouting"
|
|
||||||
minSdkVersion 16
|
|
||||||
targetSdkVersion 28
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled false
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
||||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
|
||||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
|
||||||
testImplementation 'junit:junit:4.12'
|
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
|
||||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# You can control the set of applied configuration files using the
|
|
||||||
# proguardFiles setting in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
|
||||||
# class:
|
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Uncomment this to preserve the line number information for
|
|
||||||
# debugging stack traces.
|
|
||||||
#-keepattributes SourceFile,LineNumberTable
|
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
|
||||||
# hide the original source file name.
|
|
||||||
#-renamesourcefileattribute SourceFile
|
|
@ -1 +0,0 @@
|
|||||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
|
|
@ -1,26 +0,0 @@
|
|||||||
package com.example.titanscouting;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.support.test.InstrumentationRegistry;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("com.example.titanscouting", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.example.titanscouting">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:allowBackup="true"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:roundIcon="@drawable/binoculars_big"
|
|
||||||
android:supportsRtl="true"
|
|
||||||
android:theme="@style/AppTheme"
|
|
||||||
android:usesCleartextTraffic="true">
|
|
||||||
<activity android:name=".tits"></activity>
|
|
||||||
<activity android:name=".launcher">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity android:name=".MainActivity">
|
|
||||||
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
@ -1,32 +0,0 @@
|
|||||||
package com.example.titanscouting;
|
|
||||||
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.webkit.WebView;
|
|
||||||
import android.webkit.WebSettings;
|
|
||||||
import android.webkit.WebViewClient;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WebView myWebView = (WebView) findViewById(R.id.webview);
|
|
||||||
|
|
||||||
myWebView.getSettings().setJavaScriptEnabled(true);
|
|
||||||
myWebView.setWebViewClient(new WebViewClient());
|
|
||||||
myWebView.loadUrl("http://titanrobotics.ddns.net:60080/public/");
|
|
||||||
|
|
||||||
myWebView.getSettings().setJavaScriptEnabled(true);
|
|
||||||
myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
|
|
||||||
myWebView.getSettings().setDomStorageEnabled(true);
|
|
||||||
myWebView.getSettings().setDomStorageEnabled(true);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
package com.example.titanscouting;
|
|
||||||
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
|
||||||
public class launcher extends AppCompatActivity {
|
|
||||||
|
|
||||||
Button button;
|
|
||||||
EditText passField;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_launcher);
|
|
||||||
|
|
||||||
// Locate the button in activity_main.xml
|
|
||||||
button = (Button) findViewById(R.id.launch_button);
|
|
||||||
final EditText passField = (EditText)findViewById(R.id.editText);
|
|
||||||
// Capture button clicks
|
|
||||||
button.setOnClickListener(new OnClickListener() {
|
|
||||||
public void onClick(View arg0) {
|
|
||||||
|
|
||||||
// Start NewActivity.class
|
|
||||||
if(passField.getText().toString().equals("gimmetits")){
|
|
||||||
|
|
||||||
Intent myIntent = new Intent(launcher.this,
|
|
||||||
tits.class);
|
|
||||||
startActivity(myIntent);
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Intent myIntent = new Intent(launcher.this,
|
|
||||||
MainActivity.class);
|
|
||||||
startActivity(myIntent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package com.example.titanscouting;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
|
||||||
|
|
||||||
public class tits extends AppCompatActivity {
|
|
||||||
Button button;
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_tits);
|
|
||||||
|
|
||||||
button = (Button) findViewById(R.id.button);
|
|
||||||
// Capture button clicks
|
|
||||||
button.setOnClickListener(new View.OnClickListener() {
|
|
||||||
public void onClick(View arg0) {
|
|
||||||
|
|
||||||
|
|
||||||
Intent myIntent = new Intent(tits.this,
|
|
||||||
MainActivity.class);
|
|
||||||
startActivity(myIntent);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:aapt="http://schemas.android.com/aapt"
|
|
||||||
android:width="108dp"
|
|
||||||
android:height="108dp"
|
|
||||||
android:viewportWidth="108"
|
|
||||||
android:viewportHeight="108">
|
|
||||||
<path
|
|
||||||
android:fillType="evenOdd"
|
|
||||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
|
||||||
android:strokeWidth="1"
|
|
||||||
android:strokeColor="#00000000">
|
|
||||||
<aapt:attr name="android:fillColor">
|
|
||||||
<gradient
|
|
||||||
android:endX="78.5885"
|
|
||||||
android:endY="90.9159"
|
|
||||||
android:startX="48.7653"
|
|
||||||
android:startY="61.0927"
|
|
||||||
android:type="linear">
|
|
||||||
<item
|
|
||||||
android:color="#44000000"
|
|
||||||
android:offset="0.0" />
|
|
||||||
<item
|
|
||||||
android:color="#00000000"
|
|
||||||
android:offset="1.0" />
|
|
||||||
</gradient>
|
|
||||||
</aapt:attr>
|
|
||||||
</path>
|
|
||||||
<path
|
|
||||||
android:fillColor="#FFFFFF"
|
|
||||||
android:fillType="nonZero"
|
|
||||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
|
||||||
android:strokeWidth="1"
|
|
||||||
android:strokeColor="#00000000" />
|
|
||||||
</vector>
|
|
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 925 B |
Before Width: | Height: | Size: 1.6 KiB |
@ -1,170 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="108dp"
|
|
||||||
android:height="108dp"
|
|
||||||
android:viewportWidth="108"
|
|
||||||
android:viewportHeight="108">
|
|
||||||
<path
|
|
||||||
android:fillColor="#008577"
|
|
||||||
android:pathData="M0,0h108v108h-108z" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M9,0L9,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,0L19,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,0L29,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,0L39,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,0L49,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,0L59,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,0L69,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,0L79,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M89,0L89,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M99,0L99,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,9L108,9"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,19L108,19"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,29L108,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,39L108,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,49L108,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,59L108,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,69L108,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,79L108,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,89L108,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,99L108,99"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,29L89,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,39L89,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,49L89,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,59L89,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,69L89,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,79L89,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,19L29,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,19L39,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,19L49,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,19L59,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,19L69,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,19L79,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
</vector>
|
|
@ -1,42 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".launcher">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/launch_button"
|
|
||||||
android:layout_width="253dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:text="Launch Titan Scouting"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/editText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:ems="10"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/launch_button"
|
|
||||||
app:layout_constraintVertical_bias="0.0" />
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".MainActivity">
|
|
||||||
|
|
||||||
<WebView
|
|
||||||
android:id="@+id/webview"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintVertical_bias="0.48000002" />
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
@ -1,36 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".tits">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageView"
|
|
||||||
android:layout_width="372dp"
|
|
||||||
android:layout_height="487dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:layout_marginBottom="215dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:srcCompat="@drawable/uuh" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/button"
|
|
||||||
android:layout_width="198dp"
|
|
||||||
android:layout_height="86dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:text="Fuck Get Me Out"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 15 KiB |
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<color name="colorPrimary">#008577</color>
|
|
||||||
<color name="colorPrimaryDark">#00574B</color>
|
|
||||||
<color name="colorAccent">#D81B60</color>
|
|
||||||
</resources>
|
|
@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">TitanScout</string>
|
|
||||||
</resources>
|
|
@ -1,11 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
@ -1,17 +0,0 @@
|
|||||||
package com.example.titanscouting;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
||||||
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:3.3.0'
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
|
||||||
// in the individual module build.gradle files
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task clean(type: Delete) {
|
|
||||||
delete rootProject.buildDir
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
# Project-wide Gradle settings.
|
|
||||||
# IDE (e.g. Android Studio) users:
|
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
org.gradle.jvmargs=-Xmx1536m
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
||||||
# org.gradle.parallel=true
|
|
||||||
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
#Wed Feb 06 15:44:44 CST 2019
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
|
||||||
distributionPath=wrapper/dists
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
|
172
data analysis/dep/2019/apps/android/source/gradlew
vendored
@ -1,172 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
##
|
|
||||||
## Gradle start up script for UN*X
|
|
||||||
##
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=`basename "$0"`
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS=""
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
||||||
MAX_FD="maximum"
|
|
||||||
|
|
||||||
warn () {
|
|
||||||
echo "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
die () {
|
|
||||||
echo
|
|
||||||
echo "$*"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
|
||||||
cygwin=false
|
|
||||||
msys=false
|
|
||||||
darwin=false
|
|
||||||
nonstop=false
|
|
||||||
case "`uname`" in
|
|
||||||
CYGWIN* )
|
|
||||||
cygwin=true
|
|
||||||
;;
|
|
||||||
Darwin* )
|
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
||||||
else
|
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
|
||||||
fi
|
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
JAVACMD="java"
|
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
|
||||||
if [ $? -eq 0 ] ; then
|
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
ulimit -n $MAX_FD
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
|
||||||
if $cygwin ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Escape application args
|
|
||||||
save () {
|
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
||||||
echo " "
|
|
||||||
}
|
|
||||||
APP_ARGS=$(save "$@")
|
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
|
@ -1,84 +0,0 @@
|
|||||||
@if "%DEBUG%" == "" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS=
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
@ -1 +0,0 @@
|
|||||||
include ':app'
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"cells": [],
|
|
||||||
"metadata": {},
|
|
||||||
"nbformat": 4,
|
|
||||||
"nbformat_minor": 2
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
2,3
|
|
||||||
6,5
|
|
||||||
5,5
|
|
||||||
5,8
|
|
||||||
6,6
|
|
||||||
6,8
|
|
|
@ -1,53 +0,0 @@
|
|||||||
4,6,4,5
|
|
||||||
3,4,8,8
|
|
||||||
2,8,3,0
|
|
||||||
5,8,4,7
|
|
||||||
4,0,9,6
|
|
||||||
2,0,1,6
|
|
||||||
5,3,5,0
|
|
||||||
2,0,2,2
|
|
||||||
4,8
|
|
||||||
6,6,5,1
|
|
||||||
2,1,5,1
|
|
||||||
2,0,3,9
|
|
||||||
2,2,5,2
|
|
||||||
1,1,1
|
|
||||||
6,8,2,3
|
|
||||||
2,1,3,6
|
|
||||||
4,2,9,2
|
|
||||||
5,8,2,2
|
|
||||||
7,6,0,8
|
|
||||||
2,3,5,8
|
|
||||||
4,2,4,1
|
|
||||||
3,1,1,0
|
|
||||||
7,6,0,9
|
|
||||||
5,1,2,5
|
|
||||||
6,9,0,6
|
|
||||||
9,3,0
|
|
||||||
2,0,6,2
|
|
||||||
3,0,6,7
|
|
||||||
4,7,8,7
|
|
||||||
2,7,0,9
|
|
||||||
7,5,6,0
|
|
||||||
5,9,3,4
|
|
||||||
4,7,0,2
|
|
||||||
5,1,4,8
|
|
||||||
1,6
|
|
||||||
4,1,5,6
|
|
||||||
1,8,8,4
|
|
||||||
1,6,7,5
|
|
||||||
1,7,9,7
|
|
||||||
2,4,5,1
|
|
||||||
7,7,3,8
|
|
||||||
1,0,1
|
|
||||||
1,7,3,9
|
|
||||||
3,7,3,4
|
|
||||||
1,7,3,6
|
|
||||||
3,0,6,1
|
|
||||||
2,7,2,5
|
|
||||||
7,2,3,7
|
|
||||||
3,6,9,5
|
|
||||||
6,9,6,8
|
|
||||||
1,7,8,1
|
|
||||||
4,2,9,6
|
|
||||||
2,3,3,8
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,1.0
|
|
||||||
2.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
5.0
|
|
||||||
1.0
|
|
||||||
0.0
|
|
||||||
5.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
2.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
1.0
|
|
||||||
1.0
|
|
||||||
0.0
|
|
||||||
2.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
2.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
3.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
3.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,5.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
4.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,1.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
1.0
|
|
||||||
0.0
|
|
||||||
1.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,4.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
2.0
|
|
||||||
1.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,0.0
|
|
||||||
0.0
|
|
||||||
13.0
|
|
||||||
0.0
|
|
||||||
1.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,7.0
|
|
||||||
0.0
|
|
||||||
10.0
|
|
||||||
7.0
|
|
||||||
8.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
0.0,7.0
|
|
||||||
0.0
|
|
||||||
1.0
|
|
||||||
0.0
|
|
||||||
1.0
|
|
||||||
0.0
|
|
|
@ -1,6 +0,0 @@
|
|||||||
match-18,match-3
|
|
||||||
match-5
|
|
||||||
match-23
|
|
||||||
match-18
|
|
||||||
match-5
|
|
||||||
match-1
|
|
|
@ -1,6 +0,0 @@
|
|||||||
,si papa
|
|
||||||
""
|
|
||||||
yeeee
|
|
||||||
nine
|
|
||||||
""
|
|
||||||
""
|
|
|
@ -1,6 +0,0 @@
|
|||||||
Quantitative,Quantitative
|
|
||||||
Quantitative
|
|
||||||
Quantitative
|
|
||||||
Quantitative
|
|
||||||
Quantitative
|
|
||||||
Quantitative
|
|
|
@ -1,36 +0,0 @@
|
|||||||
23,57,61,28,62,31,58,42,47,61,52,54,50,68,54,44,53,26,28,68
|
|
||||||
35,58,61,39,51,51,42,31,33,70,47,55,44,55,62,43,69,69,65,51,46,68,60,78,96,58,63
|
|
||||||
14,6,9,54,48,36,59,46,30,17,68,38,35,39,48,33,43,68,60,51,53,51,67,59
|
|
||||||
46,71,40,52,68,57,60,57,60,60,65,79,55,54,47,75,80,72,45,59,64,67,57,63,77,71,72,72,77
|
|
||||||
65,43,74,59,68,59,75,62,67,55,60,79,86,67,66,77,71,75,68,67,65,41,75,68,86,92,74,64,65,29,60,78,96,58,63
|
|
||||||
56,44,26,50,49,41,33,40,45,44,39,53,74,63,65,70,71,52,71,54,75,52,61,46,53,53,51,48,55,67,46,58
|
|
||||||
15,49,53,18,53,45,20,55,36,54,49,53,64,71,82,78,67,60,67,52,52,52,57,55,64,86,71,59,79,84,52,71,85,84,66,63,64
|
|
||||||
27,16,41,64,48,21,65,61,46,68,46,72,67,61,51,52,65,55,75,54,60,56,75,55,70,55,63,77,71,72,72,77
|
|
||||||
33,51,63,85,39,59,44,45,34,89,55,34,46,47,74,54,57,52,80,42,92,60,45,81,64,63,77,71,72,72,77
|
|
||||||
42,56,53,50,37,39,52,59,38,43,56,38,42,53,52,67,52,47,45,57,69,51,63,64,48,30,58,48
|
|
||||||
21,22,59,27,33,32,14,36,53,42,58,58,67,48,43,38,62,61,42,60,59,26,70,30,46,50
|
|
||||||
10,54,36,44,40,63,41,31,46,79,40,43,55,55,65,52,74,46,48,41,81,70,70,64
|
|
||||||
50,45,49,19,55,35,15,33,68,36,48,49,66,61,69,44,60,55,46,49,58,48
|
|
||||||
26,62,45,37,42,29,59,44,40,47,67,42,64,63,54,60,88,76,80,86,78,78,76,79,69,66,57,57,43,60,60,63,64,70,64,63,76
|
|
||||||
14,12,61,24,53,39,32,15,44,47,67,48,38,41,57,52,52,53,61,46,52
|
|
||||||
47,53,34,48,42,61,34,51,34,45,50,56,46,59,54,47,53,43,62,40,80,66,94,58,64,71,82,78,67,60,67,67,58,65,75,66,74,92,65,79,55,83,60,78,96,58,63
|
|
||||||
42,55,36,34,56,46,26,35,52,70,51,71,54,33,46,57,49,71,60,46,70,30
|
|
||||||
50,17,66,53,32,60,32,39,53,68,39,43,61,41,64,49,69,52,45,28,64
|
|
||||||
36,45,44,49,49,37,49,36,46,53,36,66,61,76,80,74,53,60,61,84,68,71,85,84,66,63,64
|
|
||||||
53,48,48,41,43,54,46,49,65,46,28,57
|
|
||||||
32,45,61,52,34,47,59,62,48,57,71,49,79,50,48,51,55,54,42,55,47,76,43,65,55,104,57,85,55,75,48,44,49,50,72,71,75,55,81,83,81,70,70,64
|
|
||||||
10,44,49,20,45,32,38,41,35,69,65,69,46,57,65,53,65,64,70,83,46,50
|
|
||||||
58,41,38,64,61,39,42,40,54,66,69,63,34,47,74,65,47,43,61,52,56,62,79,63,64,46,50
|
|
||||||
42,37,62,38,51,44,41,70,41,28,32,61,54,61,66,57,60,52,75,51,65,57
|
|
||||||
35,71,43,39,76,52,45,63,55,65,41,67,46,58
|
|
||||||
19,55,58,42,22,34,44,45,43,33,45,75,39,48,39,57,61,86,46,62,64,55,64,58,48
|
|
||||||
26,31,41,26,69,34,12,25,67,52,44,69,45,61,60,45,53,61,70,49
|
|
||||||
39,45,49,44,48,49,37,39,75,40,43,41,46,64,42,44,53,64,46,55,71,85,84,66,63,64
|
|
||||||
55,45,48,19,53,32,59,56,58,79,50,52,58,45,54,76,60,60,52,64,67,64,67,46,58
|
|
||||||
33,68,12,18,49,36,39,35,49,35,21,38,51,55,48,38,57,54,49,52,51,81,29
|
|
||||||
47,51,64,50,102,40,47,31,57,15,54,50,56,64,51,37,62,60,77,62,44,52,52,72,67,52,61,43,75,62,47,72,49,62,64,84,49,81,70,70,64
|
|
||||||
53,40,45,69,50,43,49,56,60,51,55,59
|
|
||||||
9,55,26,45,33,18,52,30,53,42,58,58,52,36,65,39,55,57,54,69,65,55,63,59,63,76
|
|
||||||
32,69,45,49,52,54,74,46,74,26,63,52,63,76
|
|
||||||
47,58,66,33,45,47,46,46,65,45,46,41
|
|
||||||
32,74,54,54,41,47,65,51,60,55,46,29
|
|
|
@ -1,6 +0,0 @@
|
|||||||
team-16,team-16
|
|
||||||
team-2016
|
|
||||||
team-2022
|
|
||||||
team-2451
|
|
||||||
team-3695
|
|
||||||
team-5148
|
|
|
@ -1,36 +0,0 @@
|
|||||||
31
|
|
||||||
931
|
|
||||||
938
|
|
||||||
1094
|
|
||||||
1756
|
|
||||||
1785
|
|
||||||
1806
|
|
||||||
1939
|
|
||||||
1987
|
|
||||||
1997
|
|
||||||
2164
|
|
||||||
2333
|
|
||||||
2359
|
|
||||||
2451
|
|
||||||
2773
|
|
||||||
3284
|
|
||||||
3397
|
|
||||||
3593
|
|
||||||
3931
|
|
||||||
4455
|
|
||||||
4522
|
|
||||||
4959
|
|
||||||
5006
|
|
||||||
5041
|
|
||||||
5119
|
|
||||||
5437
|
|
||||||
5454
|
|
||||||
5550
|
|
||||||
5889
|
|
||||||
5918
|
|
||||||
6424
|
|
||||||
6843
|
|
||||||
6886
|
|
||||||
7141
|
|
||||||
7662
|
|
||||||
7729
|
|
|
@ -1,178 +0,0 @@
|
|||||||
Doccumentation of python module: analysis.py
|
|
||||||
|
|
||||||
revision version: 1.0.8.003
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
analysis.py{
|
|
||||||
|
|
||||||
analysis.py should be imported as a python module using "import analysis" in the tr2022 directory, or using "from tr2022 import analysis" if tr2022 modules are installed in the python Libs directory
|
|
||||||
|
|
||||||
analysis.py is a module designed for statistical analyses and artifician neural network analyses
|
|
||||||
|
|
||||||
functions{
|
|
||||||
|
|
||||||
|
|
||||||
_init_device{
|
|
||||||
|
|
||||||
|
|
||||||
initiates device for tensor flow with either a cuda device (device specified via the "arg" argument) or cpu (ignored "arg" argument)
|
|
||||||
|
|
||||||
usage{
|
|
||||||
|
|
||||||
analysis._init_device("cuda", arg) , where arg is the cuda device number
|
|
||||||
|
|
||||||
analysis._init_device("cpu", 0) , which initiates the cpu as the tensorflow device
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
load_csv{
|
|
||||||
|
|
||||||
loads a csv file as a 2 dimentional array
|
|
||||||
|
|
||||||
usage{
|
|
||||||
|
|
||||||
analysis.load_csv(filepath) , where filepath is the path to the csv file to be loaded
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
basic_stats{
|
|
||||||
|
|
||||||
performs basic stats such as mean, median, mode, standard deviation, and varaince on a set of data
|
|
||||||
|
|
||||||
the function can do stats on a 1 dimentional array, or on a specified row or column in a 2 dimentional array
|
|
||||||
|
|
||||||
the method in which it does the statistics is specified by the "method" argument
|
|
||||||
|
|
||||||
usage{
|
|
||||||
|
|
||||||
analysis.basic_stats(data, "1d", 0) , where data is a 1 dimentional array
|
|
||||||
|
|
||||||
analysis.basic_stats(data, "row", rownum) , where data is a 2 dimentional array and "rownum" is the row to run statistics on
|
|
||||||
|
|
||||||
analysis.basic_stats(data, "column", columnnum) , where data is a 2 dimentional array and "columnnum" is the column to run statistics on
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
z_score{
|
|
||||||
|
|
||||||
returns the z score of a point relative to the population mean and standard deviation
|
|
||||||
|
|
||||||
usage{
|
|
||||||
|
|
||||||
analysis.z_score(datapoint, mean, stdev) , where "datapoint" is the specific data point to assign a z score, mean is the mean of the entire data set, and stdev is the standard deviation of the data set
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
z_normalize{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
stdev_z_split{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
histo_analysis{
|
|
||||||
|
|
||||||
returns an analysis of historical data, the analysis predicts a range of possible next data poins given historical data
|
|
||||||
|
|
||||||
usage{
|
|
||||||
|
|
||||||
analysis.histo_analysis(data, delta, low, high) , where data is the historical data to be predicted, delta are the steps (in standard deviations) that the predictor uses, and the low and high bounds are the ranges of standard deviations that the function predicts within
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
poly_regression{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
log_regression{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exp_regression{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
tanh_regression{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
r_squared{
|
|
||||||
|
|
||||||
used in other functions
|
|
||||||
|
|
||||||
returns the r^2 score of a curve and corresponding data
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
rms{
|
|
||||||
|
|
||||||
used in other functions
|
|
||||||
|
|
||||||
returns the root mean squared score of a curve and corresponding data
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
calc_overfit{
|
|
||||||
|
|
||||||
used in other functions, not important
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
optimize_regression{
|
|
||||||
|
|
||||||
returns a list of possible regressions given the x and y coordinates of the data
|
|
||||||
|
|
||||||
usage{
|
|
||||||
|
|
||||||
analysis.optimize_regression(x, y, range, resolution) , where x and y are the x and y values of each data point, range is the range of polynomial equations tried, and resolution is the detail of bases used for exponential and logorithmic regressions
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
select_best_regression{
|
|
||||||
|
|
||||||
takes a list of equations and returns the best equation, either based on minimizing overfit or based on maximizing root mean squareds
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
p_value{
|
|
||||||
|
|
||||||
returns the p value of two data sets
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
basic_analysis{
|
|
||||||
|
|
||||||
runs every stat on a given file
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "service_account",
|
|
||||||
"project_id": "titanscoutandroid",
|
|
||||||
"private_key_id": "e7cde706a13a6fade555cce2bc46ee53f05a0b11",
|
|
||||||
"private_key": "-----BEGIN PRIVATE KEY-----\(gottem)/B\ntvFNxi7l6IsHUa+ijrDKGP3O2jbQCWjfBS0gNxpx65JXdKw4l+5p1lIyO5xe5b2m\nKOGQQf9Vd3X6xP9ttHD9ILjvdDRGvtR/bkD3e1ZdFSvt1PDddcLLPnIeDgkNQHXd\nzAYv0TIspJe6bUL3a5+HGK7nyfH7dGXZksNB/hiy3WS/eAgAnL6xzCRsdjK40Cf4\nP7B79bCNNnxnOy/GBpXG/CE8H+xGRr1Xuj5pmJFTc6GbaDbLc8bKMvVOzbCPYKgu\nbCaidtDoiMEJqy8AakrvN39DrlUOT3+kbAhJpw/fk9Rq4A2Mo+J2BuApze2hoYET\noI5HysuLAgMBAAECggEAGYkXgTTrxFmKLUC1+yFI3YO6yaIxrH4bdEStgF6Rq784\nWX+SZCjBKAYC5BrDOrp66/pavEJDo2Oi3WU9su2OqTu3nRJyD+2Uplan//3VnH+p\nOg06XVtGMQxoKghIcvRtj03z4K2CeQsGYXs/juIF4MOUCmMMezbVpkrn0CvyMZGM\n5vrFXvOwdKHyZaDXvql8nQIq6b46RC6ozLUBidEW37pHvuZm+QWD0W7VS2na4DKw\n+jIJz8zjsg3vCLpdTOMFxymW/LmusFTubn3evv4/8BLvw69seWPOyNi/PEjZWwgR\npQA7VYkETlZopZ6paHutmD5Yy4N0FjcJ6PMocwgKQQKBgQDnf6oFvZFV/QO1RACi\nhc0skytc7h96ePUWLwIMSMed3Jdr5ANC6tD4OIwGyrCDfKuLvsUCyEjHKhW8tarb\nTioaqgzM8Jwn+HMTyLJjzU4j8KhxgQWoLWri2HgRlqZV2Y1XNO3fRA8Zs3CsT7Fa\nIyEnKylWM6u0kQ2mMQicgQpulQKBgQC/BjSELv43ZGZKBg5m+Ps+PEFxJArvJgqA\nd+lXSHYkALWynyvukAuhmciAEKN1NKL7/DvxzfNRRXB32kmQkcjcsFZnnqbEkpq+\nzCOIJcesYN0k3kiCJuoNENdQXtAKGJrtHF1ilJfpt5Yuw67VC/B/JwkPF2wCsSfU\nHusyguFpnwKBgGKzVaRY7KxC0d/o/HROo+nLXYOjqxwmkihBJphiN2mg8ZZ4gsN3\nJl2OjnUe2h9VejZ8wbar+gugb+AjfJNAQkdYFVkThSCtlzLqMNTIZfaA1vB92BGa\nO6Y4MQkeuBCGTvLNiFXWyLFmhjWRTMZnj+0JQ/iS0zSLW8xtv4QqqG35AoGBAIee\n3zAtsP0gweKyNA11neLMouWx4jVx+6jD+Z2na4EaI+YiTe18xVVBOnF53qM68LAY\nn3KIdsRvmW7uQqZqaoIMi/vbTqlnMIhfpKZntEC1MKyZSD9nY2pNV6DO/8L7Pxsy\ntTZlKwma9vxSn9DQPjn4O91EEsJChnV6Uh+1flYfAoGADfomBP+kLm0jdvKm3Q+u\nA5S4ng3erDbCbZK0ADeVY5H0fNNJihx1yXx12g02T0biH6Efj+VpCeYC6W0wb2A1\nT/HqY1JSSsKQ7cPe1VEPKbbfn6PPrs+HbsHB8DDVPi9pysVfG7351PgNX/tb+iz/\nvJCSRvjRtxyFafuX4YQzWu0=\n-----END PRIVATE KEY-----\n",
|
|
||||||
"client_email": "firebase-adminsdk-wpsvx@titanscoutandroid.iam.gserviceaccount.com",
|
|
||||||
"client_id": "114864465329268712237",
|
|
||||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
|
||||||
"token_uri": "https://oauth2.googleapis.com/token",
|
|
||||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
|
||||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-wpsvx%40titanscoutandroid.iam.gserviceaccount.com"
|
|
||||||
}
|
|
@ -1,132 +0,0 @@
|
|||||||
{
|
|
||||||
"cells": [
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 1,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"import firebase_admin\n",
|
|
||||||
"from firebase_admin import credentials\n",
|
|
||||||
"from firebase_admin import firestore\n",
|
|
||||||
"import csv\n",
|
|
||||||
"import numpy as np\n",
|
|
||||||
"# Use a service account\n",
|
|
||||||
"cred = credentials.Certificate(r'../keys/fsk.json')\n",
|
|
||||||
"#add your own key as this is public. email me for details\n",
|
|
||||||
"firebase_admin.initialize_app(cred)\n",
|
|
||||||
"\n",
|
|
||||||
"db = firestore.client()"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 2,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"teams=db.collection('data').document('team-2022').collection(\"Midwest 2019\").get()\n",
|
|
||||||
"full=[]\n",
|
|
||||||
"tms=[]\n",
|
|
||||||
"for team in teams:\n",
|
|
||||||
" data=[]\n",
|
|
||||||
" tms.append(team.id)\n",
|
|
||||||
" reports=db.collection('data').document('team-2022').collection(\"Midwest 2019\").document(team.id).collection(\"matches\").get()\n",
|
|
||||||
" for report in reports:\n",
|
|
||||||
" data.append(db.collection('data').document('team-2022').collection(\"Midwest 2019\").document(team.id).collection(\"matches\").document(report.id).get().to_dict())\n",
|
|
||||||
" full.append(data)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 4,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"def expcsv(loc,data):\n",
|
|
||||||
" with open(loc+'.csv', 'w', newline='', encoding='utf-8') as csvfile:\n",
|
|
||||||
" w = csv.writer(csvfile, delimiter=',', quotechar=\"\\\"\", quoting=csv.QUOTE_MINIMAL)\n",
|
|
||||||
" for i in data:\n",
|
|
||||||
" w.writerow(i)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 12,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"def keymatch(ld):\n",
|
|
||||||
" keys=set([])\n",
|
|
||||||
" for i in ld:\n",
|
|
||||||
" for j in i.keys():\n",
|
|
||||||
" keys.add(j)\n",
|
|
||||||
" kl=list(keys)\n",
|
|
||||||
" data=[]\n",
|
|
||||||
" for i in kl:\n",
|
|
||||||
" data.append([i])\n",
|
|
||||||
" for i in kl:\n",
|
|
||||||
" for j in ld:\n",
|
|
||||||
" try:\n",
|
|
||||||
" (data[kl.index(i)]).append(j[i])\n",
|
|
||||||
" except:\n",
|
|
||||||
" (data[kl.index(i)]).append(\"\")\n",
|
|
||||||
" return data\n",
|
|
||||||
"wn=[]\n",
|
|
||||||
"for i in full:\n",
|
|
||||||
" wn.append(np.transpose(np.array(keymatch(i))).tolist())\n",
|
|
||||||
"for i in range(len(wn)):\n",
|
|
||||||
" expcsv(tms[i],wn[i])"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"metadata": {
|
|
||||||
"kernelspec": {
|
|
||||||
"display_name": "Python 3",
|
|
||||||
"language": "python",
|
|
||||||
"name": "python3"
|
|
||||||
},
|
|
||||||
"language_info": {
|
|
||||||
"codemirror_mode": {
|
|
||||||
"name": "ipython",
|
|
||||||
"version": 3
|
|
||||||
},
|
|
||||||
"file_extension": ".py",
|
|
||||||
"mimetype": "text/x-python",
|
|
||||||
"name": "python",
|
|
||||||
"nbconvert_exporter": "python",
|
|
||||||
"pygments_lexer": "ipython3",
|
|
||||||
"version": "3.6.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nbformat": 4,
|
|
||||||
"nbformat_minor": 2
|
|
||||||
}
|
|
@ -1,191 +0,0 @@
|
|||||||
{
|
|
||||||
"cells": [
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 1,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"import operator\n",
|
|
||||||
"import csv\n",
|
|
||||||
"#constants\n",
|
|
||||||
"k=100\n",
|
|
||||||
"rdf=400\n",
|
|
||||||
"\n",
|
|
||||||
"def win_prob(yas,oas):\n",
|
|
||||||
" return 1/(1+10**(1/rdf*(oas-yas)))\n",
|
|
||||||
"def new_score(oscore,yas,oas,outcome):\n",
|
|
||||||
" return (oscore)+k*(outcome-win_prob(yas,oas))\n",
|
|
||||||
"\n",
|
|
||||||
"def readFile(filepath):\n",
|
|
||||||
"\n",
|
|
||||||
" with open(filepath) as csvfile:\n",
|
|
||||||
" lines = csv.reader(csvfile, delimiter=',', quotechar='|')\n",
|
|
||||||
" data = []\n",
|
|
||||||
" try:\n",
|
|
||||||
" for row in lines:\n",
|
|
||||||
" data.append((', '.join(row)).split(\", \"))\n",
|
|
||||||
" except:\n",
|
|
||||||
" pass\n",
|
|
||||||
"\n",
|
|
||||||
" return data\n"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 2,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"sb=readFile('scoreboard.csv')\n",
|
|
||||||
"teams=set([])\n",
|
|
||||||
"for i in sb:\n",
|
|
||||||
" teams.add(i[2])\n",
|
|
||||||
" teams.add(i[3])\n",
|
|
||||||
" teams.add(i[4])\n",
|
|
||||||
" teams.add(i[5])\n",
|
|
||||||
" teams.add(i[6])\n",
|
|
||||||
" teams.add(i[7])\n",
|
|
||||||
"list(teams)\n",
|
|
||||||
"tsd={}\n",
|
|
||||||
"for i in list(teams):\n",
|
|
||||||
" tsd[i]=500\n",
|
|
||||||
"for i in sb:\n",
|
|
||||||
" ras=tsd[i[2]]+tsd[i[3]]+tsd[i[4]]\n",
|
|
||||||
" bas=tsd[i[5]]+tsd[i[6]]+tsd[i[7]]\n",
|
|
||||||
" outcome=0\n",
|
|
||||||
" if i[8]>i[9]:\n",
|
|
||||||
" outcome=1\n",
|
|
||||||
" elif i[9]==i[8]:\n",
|
|
||||||
" outcome=.5\n",
|
|
||||||
" for j in range(2,5,1):\n",
|
|
||||||
" tsd[i[j]]=new_score(tsd[i[j]],ras,bas,outcome)\n",
|
|
||||||
" for j in range(5,8,1):\n",
|
|
||||||
" tsd[i[j]]=new_score(tsd[i[j]],bas,ras,1-outcome)\n",
|
|
||||||
" \n",
|
|
||||||
"rankinfs = sorted(tsd.items(), key=operator.itemgetter(1), reverse=True) "
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 3,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"text/plain": [
|
|
||||||
"[('5934', 833.1830859510761),\n",
|
|
||||||
" ('48', 739.9728094005745),\n",
|
|
||||||
" ('16', 705.9551102513088),\n",
|
|
||||||
" ('3061', 702.9024075826381),\n",
|
|
||||||
" ('3695', 700.1366129603175),\n",
|
|
||||||
" ('2338', 696.932652524603),\n",
|
|
||||||
" ('4096', 652.7038522070818),\n",
|
|
||||||
" ('3488', 648.9766694246662),\n",
|
|
||||||
" ('4156', 638.0881039843185),\n",
|
|
||||||
" ('101', 626.9019952260375),\n",
|
|
||||||
" ('6823', 613.1453027540894),\n",
|
|
||||||
" ('930', 610.7992869961017),\n",
|
|
||||||
" ('2062', 608.0647276785079),\n",
|
|
||||||
" ('2830', 600.0239706519325),\n",
|
|
||||||
" ('5847', 589.0350788865741),\n",
|
|
||||||
" ('1736', 584.367394696335),\n",
|
|
||||||
" ('2358', 577.5524744241919),\n",
|
|
||||||
" ('5822', 575.4792058357157),\n",
|
|
||||||
" ('1675', 569.9944280943398),\n",
|
|
||||||
" ('111', 559.5150813478114),\n",
|
|
||||||
" ('1797', 537.9429025884093),\n",
|
|
||||||
" ('5148', 533.9623603303631),\n",
|
|
||||||
" ('1781', 519.5609268991466),\n",
|
|
||||||
" ('6651', 516.3195829730869),\n",
|
|
||||||
" ('6906', 501.7408783344565),\n",
|
|
||||||
" ('2022', 482.2765218696747),\n",
|
|
||||||
" ('7237', 474.4616019824547),\n",
|
|
||||||
" ('1884', 468.87487164611116),\n",
|
|
||||||
" ('2039', 467.0990375388428),\n",
|
|
||||||
" ('2451', 462.70812165138807),\n",
|
|
||||||
" ('7608', 462.0188420364676),\n",
|
|
||||||
" ('1739', 459.00590084129664),\n",
|
|
||||||
" ('2252', 456.43201385653043),\n",
|
|
||||||
" ('2151', 439.4118535382677),\n",
|
|
||||||
" ('4702', 435.5729578944645),\n",
|
|
||||||
" ('7738', 423.16353418538296),\n",
|
|
||||||
" ('4296', 420.5085609998351),\n",
|
|
||||||
" ('3734', 418.47615429198186),\n",
|
|
||||||
" ('7609', 409.29347746836567),\n",
|
|
||||||
" ('2709', 403.9793052336144),\n",
|
|
||||||
" ('3067', 402.77020998279653),\n",
|
|
||||||
" ('2136', 386.0798688817299),\n",
|
|
||||||
" ('5350', 383.4109800245315),\n",
|
|
||||||
" ('5125', 377.1609505922246),\n",
|
|
||||||
" ('4292', 357.43188113820975),\n",
|
|
||||||
" ('3110', 344.8643460008074),\n",
|
|
||||||
" ('2725', 332.21429556184444),\n",
|
|
||||||
" ('4645', 329.6452389079341),\n",
|
|
||||||
" ('6968', 329.08368400289095),\n",
|
|
||||||
" ('4241', 315.12115012426335),\n",
|
|
||||||
" ('4787', 288.64374620808815),\n",
|
|
||||||
" ('7560', 279.7779164676232),\n",
|
|
||||||
" ('2016', 247.25607506869346)]"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"execution_count": 3,
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "execute_result"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
|
||||||
"rankinfs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"metadata": {
|
|
||||||
"kernelspec": {
|
|
||||||
"display_name": "Python 3",
|
|
||||||
"language": "python",
|
|
||||||
"name": "python3"
|
|
||||||
},
|
|
||||||
"language_info": {
|
|
||||||
"codemirror_mode": {
|
|
||||||
"name": "ipython",
|
|
||||||
"version": 3
|
|
||||||
},
|
|
||||||
"file_extension": ".py",
|
|
||||||
"mimetype": "text/x-python",
|
|
||||||
"name": "python",
|
|
||||||
"nbconvert_exporter": "python",
|
|
||||||
"pygments_lexer": "ipython3",
|
|
||||||
"version": "3.6.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nbformat": 4,
|
|
||||||
"nbformat_minor": 2
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
Match,Time,Red1,Red2,Red3,Blue1,Blue2,Blue3,RedScore,BlueScore
|
|
||||||
Qualification 1 ,Fri 3/8 - 9:00 AM,7560,3061,3488,1675,2451,5148,37,26
|
|
||||||
Qualification 2 ,Fri 3/8 - 9:09 AM,7608,1884,2338,4702,2151,111,23,33
|
|
||||||
Qualification 3 ,Fri 3/8 - 9:18 AM,2830,7609,101,2039,4292,16,45,35
|
|
||||||
Qualification 4 ,Fri 3/8 - 9:27 AM,6968,1736,4096,4645,3067,2252,40,20
|
|
||||||
Qualification 5 ,Fri 3/8 - 9:36 AM,4156,2016,3695,2022,3110,3734,46,29
|
|
||||||
Qualification 6 ,Fri 3/8 - 9:45 AM,5934,5822,1739,7738,2062,4296,38,33
|
|
||||||
Qualification 7 ,Fri 3/8 - 9:54 AM,930,5125,4787,7237,6906,1781,37,41
|
|
||||||
Qualification 8 ,Fri 3/8 - 10:03 AM,2725,5847,5350,2709,1797,4241,25,24
|
|
||||||
Qualification 9 ,Fri 3/8 - 10:12 AM,2358,6823,2136,48,6651,3734,17,40
|
|
||||||
Qualification 10 ,Fri 3/8 - 10:21 AM,3067,7608,5148,2062,4292,5822,15,39
|
|
||||||
Qualification 11 ,Fri 3/8 - 10:30 AM,111,6968,4787,16,2022,1675,41,63
|
|
||||||
Qualification 12 ,Fri 3/8 - 10:39 AM,4702,7738,2830,6906,2725,2016,52,24
|
|
||||||
Qualification 13 ,Fri 3/8 - 10:48 AM,2709,2358,7609,101,930,6823,16,42
|
|
||||||
Qualification 14 ,Fri 3/8 - 10:56 AM,2136,5934,3695,1736,7237,2151,45,25
|
|
||||||
Qualification 15 ,Fri 3/8 - 11:04 AM,3110,1781,2252,1797,2338,3488,35,65
|
|
||||||
Qualification 16 ,Fri 3/8 - 11:12 AM,48,4156,4241,4296,1884,3061,48,34
|
|
||||||
Qualification 17 ,Fri 3/8 - 11:20 AM,2039,6651,5125,4096,7560,5350,31,23
|
|
||||||
Qualification 18 ,Fri 3/8 - 11:28 AM,5847,2451,16,4645,1739,7237,62,15
|
|
||||||
Qualification 19 ,Fri 3/8 - 11:36 AM,3734,3067,1797,7609,5148,5934,18,31
|
|
||||||
Qualification 20 ,Fri 3/8 - 11:44 AM,5822,2725,4241,2338,4156,930,20,55
|
|
||||||
Qualification 21 ,Fri 3/8 - 11:52 AM,6968,2016,2709,7608,2151,6823,12,14
|
|
||||||
Qualification 22,Fri 3/8 - 1:00 PM,1736,7560,1739,4292,5350,48,43,58
|
|
||||||
Qualification 23,Fri 3/8 - 1:09 PM,2062,1781,2022,2451,4096,6651,35,45
|
|
||||||
Qualification 24,Fri 3/8 - 1:18 PM,111,4296,3488,4787,2136,2039,49,27
|
|
||||||
Qualification 25,Fri 3/8 - 1:27 PM,101,3061,5847,2252,2830,6906,53,40
|
|
||||||
Qualification 26,Fri 3/8 - 1:36 PM,1675,4645,4702,3695,3110,7738,15,71
|
|
||||||
Qualification 27,Fri 3/8 - 1:44 PM,1736,1884,2358,2016,5125,7560,25,23
|
|
||||||
Qualification 28,Fri 3/8 - 1:52 PM,4156,2725,6651,3488,7237,3067,42,39
|
|
||||||
Qualification 29,Fri 3/8 - 2:00 PM,3734,5350,2151,6906,2062,101,18,36
|
|
||||||
Qualification 30,Fri 3/8 - 2:08 PM,5847,7738,6823,2338,111,4096,54,58
|
|
||||||
Qualification 31,Fri 3/8 - 2:16 PM,2709,48,4702,5934,2039,2252,20,49
|
|
||||||
Qualification 32,Fri 3/8 - 2:24 PM,1884,930,2830,1797,1675,6968,61,49
|
|
||||||
Qualification 33,Fri 3/8 - 2:32 PM,7609,1739,3695,5148,4241,4787,85,54
|
|
||||||
Qualification 34,Fri 3/8 - 2:40 PM,5125,4645,2022,3061,2136,4292,37,39
|
|
||||||
Qualification 35,Fri 3/8 - 2:48 PM,2451,2358,7608,4296,16,3110,37,18
|
|
||||||
Qualification 36,Fri 3/8 - 2:56 PM,1781,2039,3734,5822,7237,5847,30,61
|
|
||||||
Qualification 37,Fri 3/8 - 3:04 PM,3488,5350,930,1884,3695,111,52,54
|
|
||||||
Qualification 38,Fri 3/8 - 3:12 PM,2016,5934,2338,7609,7560,4156,66,24
|
|
||||||
Qualification 39,Fri 3/8 - 3:20 PM,2252,6651,2136,4787,7608,1739,27,23
|
|
||||||
Qualification 40,Fri 3/8 - 3:28 PM,4096,4702,5148,2358,4241,101,37,28
|
|
||||||
Qualification 41,Fri 3/8 - 3:36 PM,3110,5822,2451,48,6968,6906,42,68
|
|
||||||
Qualification 42,Fri 3/8 - 3:44 PM,16,1736,1781,7738,3061,2725,56,43
|
|
||||||
Qualification 43,Fri 3/8 - 3:52 PM,1797,5125,4292,6823,2709,2062,32,42
|
|
||||||
Qualification 44,Fri 3/8 - 4:00 PM,2022,4296,3067,2151,2830,1675,26,31
|
|
||||||
Qualification 45,Fri 3/8 - 4:08 PM,4645,48,5847,5148,3488,2016,63,48
|
|
||||||
Qualification 46,Fri 3/8 - 4:16 PM,3110,4096,930,3061,4787,5934,42,56
|
|
||||||
Qualification 47,Fri 3/8 - 4:24 PM,2725,6823,2451,7608,3695,2039,29,57
|
|
||||||
Qualification 48,Fri 3/8 - 4:32 PM,2062,1675,4156,101,4702,2136,40,31
|
|
||||||
Qualification 49,Fri 3/8 - 4:40 PM,2022,7738,7237,5350,2252,7609,51,37
|
|
||||||
Qualification 50,Fri 3/8 - 4:48 PM,7560,4296,2151,1781,1797,4645,21,39
|
|
||||||
Qualification 51,Fri 3/8 - 4:56 PM,2338,1736,5822,2830,2709,6651,68,37
|
|
||||||
Qualification 52,Fri 3/8 - 5:04 PM,6906,1739,2358,4292,6968,1884,33,29
|
|
||||||
Qualification 53,Fri 3/8 - 5:12 PM,111,16,3067,4241,3734,5125,65,41
|
|
||||||
Qualification 54,Fri 3/8 - 5:20 PM,3061,1675,48,7609,5847,7608,65,42
|
|
||||||
Qualification 55,Fri 3/8 - 5:28 PM,6651,2016,2062,930,2252,4296,43,77
|
|
||||||
Qualification 56,Fri 3/8 - 5:36 PM,4292,5148,2725,2151,4787,3110,19,3
|
|
|