base¶
Base classes for all estimators and experiments.
-
class
s3l.base.
BaseEstimator
[source]¶ Bases:
abc.ABC
Base class for all estimators in s3l. .. rubric:: Notes
All estimators should specify all the parameters that can be set at the class level in their
__init__
as explicit keyword arguments (no*args
or**kwargs
).
-
class
s3l.base.
BaseExperiments
(transductive=True, n_jobs=1, all_class=True)[source]¶ Bases:
object
The base class for all experiments. You can inherit this class to design you own experiment process.
-
append_configs
(configs)[source]¶ Append estimators configs to self.config
Parameters: configs (list of (name, estimator, param_dict)) – In which name: string, estimator: object of estimator, param_dict: dict of parameters for corresponding estimator.
-
append_datasets
(datasets)[source]¶ Append datasets file names to self.datasets
Parameters: datasets (list of (name,feature_file,label_file,split_path,graph_file)) – Detais:
name: string Name of the dataset. Arbitrary feature_file: string or None Absolute file name of the feature file. Can be any thing if label_file: string or None Absolute file name of the label file. split_path: string or None Absolute path in which store the split files. Should be None if no split files is provided. graph_file: string or None Absolute file name of the graph files. Should be None if no graph is provided.
-
append_evaluate_metric
(performance_metric='accuracy_score', kwargs={})[source]¶ Append the metric for evaluation.
Parameters: - performace_metric (str) – The query performance-metric function. Giving str to use a pre-defined performance-metric.
- kwargs (dict, optional) – The args used in performance-metric. if kwargs is None,the pre-defined performance will init in the default way. Note that, each parameters should be static.
-
set_metric
(performance_metric='accuracy_score', metric_large_better=True, param_dict=None)[source]¶ Set the metric for experiment.
Parameters: - performace_metric (str) – The query performance-metric function. Giving str to use a pre-defined performance-metric.
- kwargs (dict, optional) – The args used in performance-metric. if kwargs is None,the pre-defined performance will init in the default way. Note that, each parameters should be static.
-
-
class
s3l.base.
InductiveEstimatorWOGraph
[source]¶ Bases:
s3l.base.BaseEstimator
-
class
s3l.base.
InductiveEstimatorwithGraph
[source]¶ Bases:
s3l.base.BaseEstimator
-
class
s3l.base.
SaferEnsemble
[source]¶ Bases:
s3l.base.BaseEstimator
Base class for SaferEnsemble for semi-supervised learning. .. rubric:: Notes
All estimators should specify all the parameters that can be set at the class level in their
__init__
as explicit keyword arguments (no*args
or**kwargs
).
-
class
s3l.base.
SupervisedEstimator
[source]¶ Bases:
s3l.base.BaseEstimator
Supervised estimator of single-label task.
-
class
s3l.base.
TransductiveEstimatorWOGraph
[source]¶ Bases:
s3l.base.BaseEstimator