Skip to content

Commit 49906ee

Browse files
Improved documentation #194
1 parent 4f036b3 commit 49906ee

File tree

4 files changed

+3
-35
lines changed

4 files changed

+3
-35
lines changed

semisupervised/CoTraining.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,7 @@ class CoTraining:
5454
def __init__(self, p=1, n=3, k=30, u=75, random_state=None,
5555
c1=None, c1_params=None,
5656
c2=None, c2_params=None,):
57-
"""
58-
The function takes in the parameters for the two classifiers, and if the
59-
classifier is not None, it will use the parameters to create the
60-
classifier. If the classifier is None, it will use the default
61-
classifier, which is GaussianNB
62-
63-
:param p: The number of positive samples, defaults to 1
64-
(optional)
65-
:param n: The number of negative samples, defaults to 3
66-
(optional)
67-
:param k: The number of iterations to train the classifiers, defaults
68-
to 30 (optional)
69-
:param u: The number of unlabeled samples to use in the training set,
70-
defaults to 75 (optional)
71-
:param random_state: The random seed used to generate the initial
72-
population
73-
:param c1: The first classifier to be used
74-
:param c1_params: parameters for the first classifier
75-
:param c2: The second classifier to be used
76-
:param c2_params: The parameters for the second classifier
77-
"""
57+
"""Co-Training."""
7858
self.p = p
7959
self.n = n
8060
self.k = k

semisupervised/DemocraticCoLearning.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,7 @@ def __init__(self, random_state=None,
6868
c1=None, c1_params=None,
6969
c2=None, c2_params=None,
7070
c3=None, c3_params=None):
71-
"""
72-
The function takes in three classifiers and their parameters, and if
73-
they are not provided, it uses the default classifiers and their
74-
parameters.
75-
76-
:param random_state: The random seed used to initialize the classifiers
77-
:param c1: The first classifier
78-
:param c1_params: parameters for the first classifier
79-
:param c2: The classifier to use for the second classifier
80-
:param c2_params: The parameters for the second classifier
81-
:param c3: The third classifier
82-
:param c3_params: The parameters for the third classifier
83-
"""
71+
"""Democratic Co-Learning."""
8472
self.const = 1.96 # 95%
8573
self.random_state = random_state if random_state is not None else \
8674
np.random.randint(low=0, high=10e5, size=1)[0]

semisupervised/TriTraining.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(self, random_state=None,
6060
c1=None, c1_params=None,
6161
c2=None, c2_params=None,
6262
c3=None, c3_params=None):
63+
"""Tri-Training."""
6364

6465
classifiers = [c1, c2, c3]
6566
classifiers_params = [c1_params, c2_params, c3_params]

semisupervised/utils/_split.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def split(samples, y):
1818
:param y: the labels of the data
1919
:return: L, U, y
2020
"""
21-
2221
if isinstance(y, pd.DataFrame):
2322
y = y.to_numpy()
2423

0 commit comments

Comments
 (0)