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)
clf.fit(x_train, 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.

Source Distribution

sklearn-sequence-classifiers-0.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

sklearn_sequence_classifiers-0.2-py2.py3-none-any.whl (8.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sklearn-sequence-classifiers-0.2.tar.gz.

File metadata

File hashes

Hashes for sklearn-sequence-classifiers-0.2.tar.gz
Algorithm Hash digest
SHA256 433ae9b1a1cf3016cc5a7ac1da0e9c0e4852cbe6fb887337e08bc2422ba51a97
MD5 dd5a48ee5fb797bc9369c55b6d856ecd
BLAKE2b-256 4c3f6197bc01c0e9d3d7cf5052d8d6950812deb374bd4aecd8ff86d69d66f8e1

See more details on using hashes here.

File details

Details for the file sklearn_sequence_classifiers-0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sklearn_sequence_classifiers-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a196f21de1c0de91702ff162869575358075ce2cda37b8f047c054735e6a2807
MD5 c67f226679664d1ee83b751f6c9ba59c
BLAKE2b-256 517e7e02eba2500c723fe5c5c2dca185f2ac63a455aaa319c661608a8624745f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page