Skip to main content

Sequence classifiers for scikit-learn

Project description

Convolutional neural network sequence classifier with a scikit-learn interface.

Usage example

Predicting IMDB review sentiments.:

from keras.datasets import imdb
from keras.preprocessing import sequence
from sequence_classifiers import CNNSequenceClassifier

maxlen = 400
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=5000)
x_train = sequence.pad_sequences(x_train, maxlen=maxlen)
x_test = sequence.pad_sequences(x_test, maxlen=maxlen)

clf = CNNSequenceClassifier(epochs=2), y_train)
print(clf.score(x_test, y_test))

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sklearn-sequence-classifiers, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size sklearn_sequence_classifiers-0.2-py2.py3-none-any.whl (8.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size sklearn-sequence-classifiers-0.2.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page