Skip to content

Instantly share code, notes, and snippets.

View qharlie's full-sized avatar

charlie qharlie

  • USA
View GitHub Profile
~/workspace  hg clone http://www.octave.org/hg/octave Mon 03 Apr 2017 10:43:17 AM CDT
real URL is http://hg.savannah.gnu.org/hgweb/octave
destination directory: octave
requesting all changes
adding changesets
adding manifests
adding file changes
added 23342 changesets with 155237 changes to 13201 files
updating to bookmark @
updating [===> ] 100/3255cloning subrepo
import pandas as pd
import sys
loc = int(sys.argv[1])-1 if len(sys.argv) > 1 else -1
df = pd.read_csv("https://docs.google.com/spreadsheet/ccc?key=1xej5Nca2xUUtrZ1GCyPjFMqI9ZgNq_OhgnTxOOMQ2js&usp=sharing&output=csv")
class Keys:
NAME="Paper Name"
SUMMARY="High level summary"
STATE="Does it claim a State of the Art result?"
import pandas as pd
import sys
loc = int(sys.argv[1])-1 if len(sys.argv) > 1 else -1
df = pd.read_csv("Arxiv Paper Analysis Worksheet (Responses) - Form Responses 1.csv")
class Keys:
NAME="Paper Name"
SUMMARY="High level summary"
STATE="Does it claim a State of the Art result?"
values = {}
values['A1'] = [1]
values['A2'] = [2]
values['A3'] = [1]
box = 'A1'
for num in values[box]:
values[box] = num
# coding: utf-8
# ## COPY THIS FOR TRAINING DATA
# In[64]:
from sklearn.model_selection import train_test_split
import charba.api as capi
import pandas as pd
features_train, features_test, labels_train, labels_test = train_test_split(features, labels, test_size=0.3,
random_state=42)
clf = DecisionTreeClassifier(random_state=RANDOM_STATE)
param_grid = [
{
"pca__n_components": range(1, len(features_list) - 1, 1),
"selectatmostkbest__k": [2, 3, 4, 5, 6, 'all'],
for score in scores:
sss = StratifiedShuffleSplit()
search = GridSearchCV(pipe, param_grid, cv=sss, scoring="recall", n_jobs=-1)
search.fit(features, labels)
print("BEST SCORE = " + str(search.score(features_test,labels_test)))
print("BEST PARAMS = " + str(search.best_params_)) # the parameter combination that together got the best f1 score
print("BEST ESTIMATOR = " + str(search.best_estimator_))
#!/usr/bin/python
import pickle
import numpy
from sklearn.feature_selection import SelectPercentile, f_classif
numpy.random.seed(42)
### The words (features) and authors (labels), already largely processed.
### These files should have been created from the previous (Lesson 10)
@qharlie
qharlie / svm.py
Last active February 16, 2017 04:33
# coding: utf-8
# ## COPY THIS FOR TRAINING DATA
# In[113]:
from sklearn.model_selection import train_test_split
import charba.api as capi
import pandas as pd
FROM ubuntu:16.04
LABEL maintainer "Charlie"
LABEL com.nvidia.volumes.needed="nvidia_driver"
ENV DEBIAN_FRONTEND noninteractive
RUN NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \
NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub && \
apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +5 > cudasign.pub && \