This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run some recommendation experiments using MovieLens 100K | |
import pandas | |
import numpy | |
import scipy.sparse | |
import scipy.sparse.linalg | |
import matplotlib.pyplot as plt | |
from sklearn.metrics import mean_absolute_error | |
data_dir = "data/ml-100k/" | |
data_shape = (943, 1682) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import pandas | |
from sklearn.datasets import load_digits | |
from sklearn import preprocessing | |
from sklearn.cross_validation import KFold | |
from sklearn.svm import SVC | |
from sklearn.metrics import zero_one_loss | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Activation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
from sklearn.datasets import load_iris | |
from sklearn import preprocessing | |
from sklearn.decomposition import PCA | |
from sklearn.cross_decomposition import PLSRegression | |
from sklearn.cross_validation import KFold | |
from sklearn.svm import LinearSVC | |
from sklearn.metrics import zero_one_loss | |
dataset = load_iris() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
import numpy | |
from sklearn.neighbors import KNeighborsClassifier | |
from sklearn.metrics import confusion_matrix, zero_one_loss | |
# Must declare data_dir as the directory of training and test files | |
train_data = data_dir + "kddcup.data.corrected" | |
train_labels = data_dir + "train_labels.txt" | |
test_data = data_dir + "corrected" |