summit.tests.test_utils package

Submodules

summit.tests.test_utils.test_GetMultiviewDB module

class Test_get_classic_db_csv(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

classmethod tearDown()

Hook method for deconstructing the test fixture after testing it.

test_simple()
class Test_get_classic_db_hdf5(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_all_views_asked()
test_asked_the_whole_dataset()
test_simple()
class Test_get_plausible_db_hdf5(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_simple()
test_two_class()

summit.tests.test_utils.test_base module

class FakeClassifier(no_params=False, accepts_mc=True)

Bases: BaseClassifier

fit(X, y)
get_params(deep=True)

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params – Parameter names mapped to their values.

Return type:

dict

class FakeDetector

Bases: object

class FakeResultAnalyzer(classifier, classification_indices, k_folds, hps_method, metrics_dict, n_iter, class_label_names, pred, directory, base_file_name, labels, database_name, nb_cores, duration, feature_ids)

Bases: ResultAnalyser

get_base_string()
get_view_specific_info()
class Test_BaseClassifier(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_accepts_mutliclass()
test_class()
test_gen_best_params()
test_gen_params_from_detector()
test_get_config()
test_get_iterpret()
test_params_to_string()
test_simple()
test_wrong_args()
class Test_Functions(methodName='runTest')

Bases: TestCase

test_get_metric()
test_get_name()
class Test_ResultAnalyzer(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_analyze()
test_get_all_metrics_scores()
test_get_classifier_config_string()
test_get_db_config_string()
test_get_metric_scores()
test_print_metrics_scores()
test_simple()

summit.tests.test_utils.test_configuration module

class Test_get_the_args(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_arguments()
test_dict_format()
test_file_loading()
class Test_save_config(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_simple()

summit.tests.test_utils.test_dataset module

class TestRAMDataset(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_filter()
test_get_label_names()
test_get_name()
test_get_v()
test_get_view_dict()
test_get_view_name()
test_init_attrs()
class Test_Dataset(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_add_gaussian_noise()
test_check_selected_label_names()
test_copy_view()
test_filter()

Had to create a new dataset to aviod playing with the class one

test_for_hdf5_file()
test_from_scratch()
test_get_label_names()
test_get_labels()
test_get_name()
test_get_nb_class()
test_get_nb_exmaples()
test_get_shape()
test_get_v()
test_get_view_dict()
test_init_sample_indices()
test_select_labels()
test_select_views_and_labels()
test_to_numpy_array()
class Test_Functions(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_datasets_already_exist()
test_init_multiple_datasets()

summit.tests.test_utils.test_execution module

class FakeArg

Bases: object

class Test_find_dataset_names(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_simple()
class Test_genArgumentDictionaries(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

class Test_genDirecortiesNames(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_ovo_no_iter()
test_simple_ovo()
class Test_genKFolds(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_genKFolds_iter()
class Test_genSplits(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_genSplits_no_iter()
test_simple()
class Test_gen_k_folds(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_list_rs()
test_multple_iters()
test_simple()
class Test_getDatabaseFunction(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_hdf5()
test_plausible_hdf5()
test_simple()
class Test_initRandomState(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

tearDown()

Hook method for deconstructing the test fixture after testing it.

test_random_state_42()
test_random_state_pickle()
class Test_initStatsIterRandomStates(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_multiple_iter()
test_one_statiter()
class Test_init_log_file(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_debug()
test_no_log()
test_simple()
class Test_init_views(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_simple()
class Test_parseTheArgs(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

test_empty_args()

summit.tests.test_utils.test_multiclass module

class FakeDset(n_samples)

Bases: object

get_nb_samples()
class FakeEstimNative

Bases: FakeMCEstim

accepts_multi_class(random_state)
class FakeMCEstim

Bases: BaseEstimator

accepts_multi_class(random_state)
class FakeMVClassifier(short_name='None')

Bases: BaseEstimator

fit(X, y, train_indices=None, view_indices=None)
predict(X, sample_indices=None, view_indices=None)
set_fit_request(*, train_indices: bool | None | str = '$UNCHANGED$', view_indices: bool | None | str = '$UNCHANGED$') FakeMVClassifier

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to fit.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
  • train_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for train_indices parameter in fit.

  • view_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for view_indices parameter in fit.

Returns:

self – The updated object.

Return type:

object

set_predict_request(*, sample_indices: bool | None | str = '$UNCHANGED$', view_indices: bool | None | str = '$UNCHANGED$') FakeMVClassifier

Request metadata passed to the predict method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to predict if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to predict.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
  • sample_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for sample_indices parameter in predict.

  • view_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for view_indices parameter in predict.

Returns:

self – The updated object.

Return type:

object

class FakeMVClassifierProb(short_name='None')

Bases: FakeMVClassifier

predict_proba(X, sample_indices=None, view_indices=None)
set_fit_request(*, train_indices: bool | None | str = '$UNCHANGED$', view_indices: bool | None | str = '$UNCHANGED$') FakeMVClassifierProb

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to fit.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
  • train_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for train_indices parameter in fit.

  • view_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for view_indices parameter in fit.

Returns:

self – The updated object.

Return type:

object

set_predict_proba_request(*, sample_indices: bool | None | str = '$UNCHANGED$', view_indices: bool | None | str = '$UNCHANGED$') FakeMVClassifierProb

Request metadata passed to the predict_proba method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to predict_proba if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to predict_proba.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
  • sample_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for sample_indices parameter in predict_proba.

  • view_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for view_indices parameter in predict_proba.

Returns:

self – The updated object.

Return type:

object

set_predict_request(*, sample_indices: bool | None | str = '$UNCHANGED$', view_indices: bool | None | str = '$UNCHANGED$') FakeMVClassifierProb

Request metadata passed to the predict method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to predict if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to predict.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
  • sample_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for sample_indices parameter in predict.

  • view_indices (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for view_indices parameter in predict.

Returns:

self – The updated object.

Return type:

object

class FakeNonProbaEstim

Bases: FakeMCEstim

class FakeProbaEstim

Bases: FakeMCEstim

predict_proba()
class Test_MultiviewOVOWrapper_fit(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_fit()
test_predict()
class Test_MultiviewOVRWrapper_fit(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_fit()
test_predict()
class Test_get_mc_estim(methodName='runTest')

Bases: TestCase

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

test_biclass()
test_multiclass_native()
test_multiclass_ovo()
test_multiclass_ovo_multiview()
test_multiclass_ovr()
test_multiclass_ovr_multiview()

summit.tests.test_utils.test_transormations module

class TestFunctions(methodName='runTest')

Bases: TestCase

test_simple_sign()
test_simple_unsign()

Module contents