Skip to content

Commit

Permalink
Preparing for version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jlgarridol committed Jan 31, 2024
1 parent 57b7473 commit 45d64ba
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.4] - 2024-01-31

### Added
- Add a parameter to `artificial_ssl_dataset` to force a minimum of instances. Issue #11

### Fixed
- DeTriTraining now is vectorized and is faster than before.

# [1.0.3.1] - 2023-04-01

### Changed
Expand Down
2 changes: 1 addition & 1 deletion sslearn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__='1.0.3.1'
__version__='1.0.4'
__AUTHOR__="José Luis Garrido-Labrador" # Author of the package
__AUTHOR_EMAIL__="jlgarrido@ubu.es" # Author's email
__URL__="https://pypi.org/project/sslearn/"
1 change: 0 additions & 1 deletion sslearn/wrapper/_co.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,6 @@ def score(self, X, y, sample_weight=None):

return self.ensemble_estimator.score(X, y, sample_weight)


# Done and tested
class CoForest(BaseCoTraining):
def __init__(self, base_estimator=DecisionTreeClassifier(), n_estimators=7, threshold=0.75, bootstrap=True, n_jobs=None, random_state=None, version="1.0.3"):
Expand Down
6 changes: 3 additions & 3 deletions test/test_model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def test_artificial_ssl_dataset_with_force_minimum():
X = np.concatenate((X, [X_0]), axis=0)
y = np.concatenate((y, [y_0]), axis=0)

X, y, X_unlabel, true_label = artificial_ssl_dataset(X, y, label_rate=0.02, force_minimum=2)
X, y, X_unlabel, true_label = artificial_ssl_dataset(X, y, label_rate=0.02, force_minimum=1)
assert X_unlabel.shape[0] == true_label.shape[0]
assert X_unlabel.shape[0]/X.shape[0] == pytest.approx(0.96, abs=0.01)
# Check if all labels have at least 10 instances
for i in np.unique(y):
assert np.sum(y == i) >= 1

pytest.raises(ValueError, artificial_ssl_dataset, X, y, label_rate=0.02, force_minimum=2)

def test_StratifiedKFoldSS():
X, y = load_iris(return_X_y=True)
splits = 5
Expand Down

0 comments on commit 45d64ba

Please sign in to comment.