Skip to content

Instantly share code, notes, and snippets.

@sidharthrajaram
Created August 8, 2017 21:34
Show Gist options
  • Save sidharthrajaram/5b08a79817bfbd0a8a89514705d8b19c to your computer and use it in GitHub Desktop.
Save sidharthrajaram/5b08a79817bfbd0a8a89514705d8b19c to your computer and use it in GitHub Desktop.
just a conceptual (just methods + one fit)
#Sidharth Rajaram, 2017, part of NBA-Predict
from sklearn import svm
import numpy as np
def combineData(values1, values2):
combined_stats = []
for a in range(values1.size):
result_component = [values1[a],values2[a]]
combined_stats.append(result_component)
combined_stats = np.array(combined_stats)
return combined_stats
classifier = svm.SVC() #rbf kernel by default
# X represents dataset, Y represents labels
scoring_ability = combineData(X[:,3], X[:,45])
def offense(player):
result = 0.0
classifier.fit(scoring_ability, Y)
result += classifier.predict([[ player[1][3], player[0][23] ]])[0]
return result
#just like this, many other factors are predicted and the cumulative sum represents the composite STAR rating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment