-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- test whether cloning works, not all work now, WIP
- Loading branch information
Showing
9 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,38 @@ | ||
import unittest | ||
|
||
from skmultilearn.problem_transform.cc import ClassifierChain | ||
from skmultilearn.problem_transform.lp import LabelPowerset | ||
from skmultilearn.tests.classifier_basetest import ClassifierBaseTest | ||
from sklearn.naive_bayes import GaussianNB | ||
from sklearn.svm import SVC | ||
from sklearn.datasets import make_multilabel_classification | ||
from sklearn.cross_validation import train_test_split | ||
from sklearn.utils.estimator_checks import check_estimator | ||
|
||
class CCTest(ClassifierBaseTest): | ||
class LPTest(ClassifierBaseTest): | ||
def test_if_sparse_classification_works_on_non_dense_base_classifier(self): | ||
classifier = ClassifierChain(classifier = SVC(), require_dense = [False, True]) | ||
classifier = LabelPowerset(classifier = SVC(), require_dense = [False, True]) | ||
|
||
self.assertClassifierWorksWithSparsity(classifier, 'sparse') | ||
|
||
def test_if_dense_classification_works_on_non_dense_base_classifier(self): | ||
classifier = ClassifierChain(classifier = SVC(), require_dense = [False, True]) | ||
classifier = LabelPowerset(classifier = SVC(), require_dense = [False, True]) | ||
|
||
self.assertClassifierWorksWithSparsity(classifier, 'dense') | ||
|
||
def test_if_sparse_classification_works_on_dense_base_classifier(self): | ||
classifier = ClassifierChain(classifier = GaussianNB(), require_dense = [True, True]) | ||
classifier = LabelPowerset(classifier = GaussianNB(), require_dense = [True, True]) | ||
|
||
self.assertClassifierWorksWithSparsity(classifier, 'sparse') | ||
|
||
def test_if_dense_classification_works_on_dense_base_classifier(self): | ||
classifier = ClassifierChain(classifier = GaussianNB(), require_dense = [True, True]) | ||
classifier = LabelPowerset(classifier = GaussianNB(), require_dense = [True, True]) | ||
|
||
self.assertClassifierWorksWithSparsity(classifier, 'dense') | ||
|
||
def test_if_works_with_cross_validation(self): | ||
classifier = LabelPowerset(classifier = GaussianNB(), require_dense = [True, True]) | ||
|
||
self.assertClassifierWorksWithCV(classifier) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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