View benchmark_gbm.py
""" | |
Benchmark script to bench R's gbm package via rpy2. | |
NOTE:: | |
make sure you run | |
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/R/lib | |
""" |
View njobsbug.py
#!/usr/bin/python | |
import sys | |
import numpy as np | |
from pprint import pprint | |
from scikits.learn.cross_val import StratifiedKFold | |
from scikits.learn.grid_search import GridSearchCV | |
from scikits.learn import svm | |
from scikits.learn.metrics import zero_one_score, f1_score, classification_report |
View linearsvc_vs_svc.py
"""High difference in classifier accuracies with LinearSVC and SVC. | |
Get data.npz from [1]. | |
[1] https://docs.google.com/leaf?id=0B1BhwRZOwyxRZTcxZDA1OWMtZjZkMy00YjgxLWI3ZTMtZjJkNGIyODAyOTQy&hl=en_US | |
""" | |
print __doc__ | |
import numpy as np | |
from functools import partial |
View joblib_test.py
from __future__ import division | |
import gc | |
import numpy as np | |
from time import sleep | |
from ext.joblib import Parallel, delayed | |
from multiprocessing import Process, current_process | |
from scikits.learn import svm, linear_model |
View mk_product_cat_dataset.py
#!/usr/bin/python | |
"""Creates the product category dataset from the Cross-Lingual | |
Sentiment dataset [1]. The output can be used directly with the | |
CLSCL reference implementation in NUT [2]. | |
Usage: | |
./mk_product_cat_dataset.py {en|de|fr|jp} {train|test|unlabeled} output_dir num_docs |
View tksvm.py
""" | |
========== | |
Libsvm GUI | |
========== | |
A simple graphical frontend for Libsvm mainly intended for didactic | |
purposes. You can create data points by point and click and visualize | |
the decision region induced by different kernels and parameter settings. | |
To create positive examples click the left mouse button; to create |
View lightning_convergence.py
from lightning.impl.primal_cd import CDClassifier | |
from lightning.impl.datasets.samples_generator import make_classification | |
bin_dense, bin_target = make_classification(n_samples=20000, n_features=100, n_informative=5, | |
n_classes=2, random_state=0, flip_y=0.2) | |
est = CDClassifier(C=1.0, alpha=0.01, random_state=0, penalty="l2", loss="log", verbose=3, max_iter=100) | |
est.fit(bin_dense[:10000,:], bin_target[:10000]) | |
est.score(bin_dense[10000:,:], bin_target[10000:]) |
View joblib_killer.py
import numpy as np | |
from sklearn.ensemble import gradient_boosting | |
import time | |
from joblib import Parallel, delayed | |
class Bad(object): | |
tree_ = None | |
NewerOlder