Python implementation of weakly supervised learning algorithm framework
Project description
Weakly Supervised Learning
Description
This is a Python framework for weakly supervised learning. This package can be used for weak supervised learning classification tasks.
Installation
You can install it by pip method.
pip install weaklysupervised
API
We have implemented following weakly-supervised learning algorithm.
bootstrapping
Examples
from examples_utils import get_data, DNN
from sklearn import metrics
from weaklysupervised import BootstrappingNeuralNetworkClassifier
if __name__ == "__main__":
X_train, X_test, y_train, y_test = get_data()
DNN = DNN()
clf = DNN.build_model(input_dim=30, output_dim=2)
model = BootstrappingNeuralNetworkClassifier(clf, batch_size=128, epochs=40, bootstrapping_type="soft",
beta=0.95, patience=5, best_model_name="model_check_point_best_model")
model.fit(X_train, y_train, validation_data=(X_test, y_test), )
predict = model.predict(X_test)
acc = metrics.accuracy_score(y_test, predict)
print("bootstrapping accuracy", acc)
Please see examples folder for more examples.
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
File details
Details for the file weaklysupervised-0.0.5.tar.gz
.
File metadata
- Download URL: weaklysupervised-0.0.5.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa8905c096f37c9449def0c569dd8b37e65e71dbad267750e993cce672168a3a |
|
MD5 | 4613f20f7dd50f766bda23427c09e3fc |
|
BLAKE2b-256 | baa459ba38f40607988e731b584d2548e8d21a94c2431d0b13de0bcc795a0d96 |