Metadata-Version: 1.2
Name: semisupervised
Version: 0.0.16
Summary: Python implementation of semi-supervised learning algorithm
Home-page: https://github.com/rosefun/semisupervised
Author: Rosefun
Author-email: rosefun@foxmail.com
License: UNKNOWN
Download-URL: https://github.com/rosefun/semisupervised/tags
Description: SemiSupervised
        ==============
        
        Describe
        ========
        
        This is a Semi-supervised learning framework of Python. You can use it
        for classification task in machine learning.
        
        Install
        =======
        
        ::
        
            pip install semisupervised
        
        API
        ===
        
        We have implemented following semi-supervised learning algorithm.
        
        -  LabelPropagation
        
        `reference
        code <https://scikit-learn.org/stable/modules/generated/sklearn.semi_supervised.LabelPropagation.html#sklearn.semi_supervised.LabelPropagation>`__
        
        -  S3VM
        
        `reference
        code <https://github.com/d12306/Implementation-of-Transductive-SVM-Sklearn-Compatible>`__
        
        Statement
        
        Some of the code comes from the Internet.
        
        Examples
        --------
        
        .. code:: python
        
            from __future__ import absolute_import
            import numpy as np
            from sklearn import datasets
            from sklearn import metrics
            from sklearn.model_selection import train_test_split
        
            # normalization
            def normalize(x):
                return (x - np.min(x))/(np.max(x) - np.min(x))
        
            def get_data():
                X, y = datasets.load_breast_cancer(return_X_y=True)
                X = normalize(X)
                X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.6, random_state = 0)
                rng = np.random.RandomState(42)
                random_unlabeled_points = rng.rand(len(X_train)) < 0.1
                y_train[random_unlabeled_points] = -1
                # 
                index, = np.where(y_train != -1)
                label_X_train = X_train[index,:]
                label_y_train = y_train[index]
                index, = np.where(y_train == -1)
                unlabel_X_train = X_train[index,:]
                unlabel_y = -1*np.ones(unlabel_X_train.shape[0]).astype(int)
                return label_X_train, label_y_train, unlabel_X_train, unlabel_y, X_test, y_test
        
            label_X_train, label_y_train, unlabel_X_train, unlabel_y, X_test, y_test = get_data()
        
            # import 
            from semisupervised import SKTSVM
        
            model = SKTSVM()
            model.fit(np.vstack((label_X_train, unlabel_X_train)), np.append(label_y_train, unlabel_y))
            # predict
            predict = model.predict(X_test)
            acc = metrics.accuracy_score(y_test, predict)
            # metric
            print("accuracy", acc)
        
Keywords: semi-supervised learning,ssl,deep learning,machine learning,semisupervised
Platform: linux/Windows
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Operating System :: OS Independent
Requires-Python: >=3.0
