Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cf093b6
Update test_denmune.py
egy1st Jul 8, 2023
7d45ee1
Update test_denmune.py
egy1st Jul 8, 2023
8b9fe91
Update test_denmune.py
egy1st Jul 8, 2023
97993e0
Update test_denmune.py
egy1st Jul 8, 2023
383af55
Update test_denmune.py
egy1st Jul 8, 2023
83c1a8d
Update test_denmune.py
egy1st Jul 8, 2023
87a1796
Update test_denmune.py
egy1st Jul 8, 2023
445ef15
Update test_denmune.py
egy1st Jul 8, 2023
e0902a0
Update test_denmune.py
egy1st Jul 8, 2023
04bdd25
Update test_denmune.py
egy1st Jul 8, 2023
3aaaff1
Update test_denmune.py
egy1st Jul 8, 2023
6f2c8ca
Update test_denmune.py
egy1st Jul 8, 2023
3780c46
Update test_denmune.py
egy1st Jul 9, 2023
ab7ec37
Update test_denmune.py
egy1st Jul 9, 2023
c0c4990
Update test_denmune.py
egy1st Jul 9, 2023
d2eb6d3
Update test_denmune.py
egy1st Jul 9, 2023
460a488
Update test_denmune.py
egy1st Jul 9, 2023
955cb2f
Updated config.yml
egy1st Jul 9, 2023
79cc8de
Updated config.yml
egy1st Jul 9, 2023
68e0b3f
Updated config.yml
egy1st Jul 9, 2023
282330e
Updated config.yml
egy1st Jul 9, 2023
e650800
Update denmune.py
egy1st Jul 9, 2023
7fc6365
Update denmune.py
egy1st Jul 9, 2023
0b0560c
Update denmune.py
egy1st Jul 9, 2023
6d6f9f9
Update denmune.py
egy1st Jul 9, 2023
0b0b4f2
Update denmune.py
egy1st Jul 9, 2023
02a04b4
Update denmune.py
egy1st Jul 9, 2023
5965e8c
Update denmune.py
egy1st Jul 9, 2023
d5a7c35
Update denmune.py
egy1st Jul 9, 2023
8582213
Update denmune.py
egy1st Jul 9, 2023
fdab09f
Update denmune.py
egy1st Jul 9, 2023
c7d0240
Update test_denmune.py
egy1st Jul 9, 2023
191a72b
Update test_denmune.py
egy1st Jul 9, 2023
3603f1f
Update test_denmune.py
egy1st Jul 9, 2023
37923a2
Update test_denmune.py
egy1st Jul 9, 2023
318561c
Update test_denmune.py
egy1st Jul 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ orbs:
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
codecov: codecov/codecov@3.0.0
slack: circleci/slack@4.4.4
python: circleci/python@1.2
python: circleci/python@2.1.1


# Define a job to be invoked later in a workflow.
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
Python-3.8: # This is the name of the workflow, feel free to change it to better match your workflow.
Python-3.10: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- build-and-test:
Expand Down
13 changes: 8 additions & 5 deletions src/denmune.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,32 @@ def __init__(
if isinstance(train_data, pd.DataFrame):
train_data = train_data.to_numpy()
train_data = train_data.copy(order='C')
elif type(train_data == np.ndarray and not train_data.data.c_contiguous):
# elif type(train_data == np.ndarray) and (not train_data.data.c_contiguous):
else:
train_data = train_data.copy(order='C')

if train_truth is not None:
if isinstance(train_truth, pd.Series):
train_truth = train_truth.to_numpy()
train_truth = train_truth.copy(order='C')
elif type(train_truth == np.ndarray and not train_truth.data.c_contiguous):
# elif type(train_truth == np.ndarray) and (not train_truth.data.c_contiguous):
else:
train_truth = train_truth.copy(order='C')

if test_data is not None:
if isinstance(test_data, pd.DataFrame):
test_data = test_data.to_numpy()
test_data = test_data.copy(order='C')
elif type(test_data == np.ndarray and not test_data.data.c_contiguous):
print ('I am in two')
# elif type(test_data == np.ndarray) and (not test_data.data.c_contiguous):
else:
test_data = test_data.copy(order='C')

if test_truth is not None:
if isinstance(test_truth, pd.Series):
test_truth = test_truth.to_numpy()
test_truth = test_truth.copy(order='C')
elif type(test_truth == np.ndarray and not test_truth.data.c_contiguous):
# elif type(test_truth == np.ndarray) and (not test_truth.data.c_contiguous):
else:
test_truth = test_truth.copy(order='C')

self.train_sz = len(train_data)
Expand Down
4 changes: 2 additions & 2 deletions src/tests/test_denmune.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_parameters(train_data, train_truth, test_data, test_truth, validate, sh
labels, validity = dm.fit_predict(validate=validate, show_plots=show_plots, show_noise=show_noise, show_analyzer=show_analyzer)
# This test use data that are not perfectly separable so the
# accuracy is not 1. Accuracy around 0.70
assert ( np.mean(dm.labels_pred == y_cc) > 0.70 or (1 - np.mean( dm.labels_pred == y_cc) > 0.70) )
assert ( np.mean(labels == y_cc) > 0.70 or (1 - np.mean( labels == y_cc) > 0.70) )


def test_DenMune_propagation():
Expand Down Expand Up @@ -118,6 +118,6 @@ def test_exceptions():
#raise Exception('train_data is not None and train_truth is not None and test_truth is not None and test_data is None')
with pytest.raises(Exception) as execinfo:

dm = DenMune(train_data=train_data, train_truth=train_labels) # default value for k_nearest is 0 which is invalid
dm = DenMune(train_data=train_data, train_truth=train_labels, k_nearest=0) # default value for k_nearest is 1 which is valid
#labels, validity = dm.fit_predict()
#raise Exception('k-nearest neighbor should be at least 1')