| @@ -13,7 +13,7 @@ from d3m import utils | |||
| __all__ = ('TODSTransformerPrimitiveBase',) | |||
| class TODSTransformerPrimitiveBase(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperparams]): | |||
| class TODSTransformerPrimitiveBase(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperparams]): # pragma: no cover | |||
| """ | |||
| A base class for primitives which are not fitted at all and can | |||
| simply produce (useful) outputs from inputs directly. As such they | |||
| @@ -76,7 +76,7 @@ class TODSTransformerPrimitiveBase(transformer.TransformerPrimitiveBase[Inputs, | |||
| data.iloc[i][col_name] = out.value | |||
| return data | |||
| class TODSUnsupervisedLearnerPrimitiveBase(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params, Hyperparams]): | |||
| class TODSUnsupervisedLearnerPrimitiveBase(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params, Hyperparams]):# pragma: no cover | |||
| def __init__(self, *, hyperparams: Hyperparams, | |||
| random_seed: int=0, | |||
| @@ -174,14 +174,14 @@ def cut_dataset(dataset: container.Dataset, row_indices_to_keep: typing.Mapping[ | |||
| return dataset.select_rows(row_indices_to_keep) | |||
| def parse_datetime(value: str, *, fuzzy: bool = True) -> typing.Optional[datetime.datetime]: | |||
| def parse_datetime(value: str, *, fuzzy: bool = True) -> typing.Optional[datetime.datetime]: # pragma: no cover | |||
| try: | |||
| return dateutil.parser.parse(value, default=DEFAULT_DATETIME, fuzzy=fuzzy) | |||
| except (ValueError, OverflowError, TypeError): | |||
| return None | |||
| def parse_datetime_to_float(value: str, *, fuzzy: bool = True) -> float: | |||
| def parse_datetime_to_float(value: str, *, fuzzy: bool = True) -> float: # pragma: no cover | |||
| try: | |||
| parsed = parse_datetime(value, fuzzy=fuzzy) | |||
| if parsed is None: | |||
| @@ -134,7 +134,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| 'id': str(uuid.uuid3(uuid.NAMESPACE_DNS, 'EnsemblePrimitive')), | |||
| }) | |||
| def __init__(self, *, | |||
| def __init__(self, *, # pragma: no cover | |||
| hyperparams: Hyperparams, | |||
| random_seed: int = 0, | |||
| docker_containers: Dict[str, DockerContainer] = None) -> None: | |||
| @@ -158,11 +158,11 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| self._fitted = False | |||
| def set_training_data(self, *, inputs: Inputs) -> None: | |||
| def set_training_data(self, *, inputs: Inputs) -> None: # pragma: no cover | |||
| self._inputs = inputs | |||
| self._fitted = False | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: # pragma: no cover | |||
| if self._fitted: | |||
| return CallResult(None) | |||
| @@ -181,7 +181,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| self.logger.warn("No input columns were selected") | |||
| return CallResult(None) | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: # pragma: no cover | |||
| outputs = inputs | |||
| outputs.columns = ['timestamp','value','system_id','scores'] | |||
| @@ -197,7 +197,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| # | |||
| # print('mean_score') | |||
| # outputs_mean = outputs.groupby('system_id')[outputs.columns[3]].mean() | |||
| # print(outputs_mean) | |||
| # print(outputs_mean) | |||
| outputs['results'] = numpy.where(outputs['scores']>0.05, 1, 0) | |||
| print(outputs) | |||
| @@ -207,7 +207,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| print(outputs_xy) | |||
| outputs_sum_x = outputs.groupby(['timestamp','system_id'])['results'].sum() | |||
| # outputs_sum_x = outputs.groupby(['system_id','timestamp']).size().reset_index().groupby(['timestamp'])['results'].sum() | |||
| # outputs_sum_x = outputs.groupby(['system_id','timestamp']).size().reset_index().groupby(['timestamp'])['results'].sum() | |||
| outputs_sum_y = outputs.groupby(['system_id','value'])['results'].sum() | |||
| @@ -218,10 +218,10 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| return base.CallResult(outputs) | |||
| def _update_metadata(self, outputs): | |||
| def _update_metadata(self, outputs): # pragma: no cover | |||
| outputs.metadata = outputs.metadata.generate(outputs,) | |||
| def get_params(self) -> Params: | |||
| def get_params(self) -> Params: # pragma: no cover | |||
| if not self._fitted: | |||
| return Params( | |||
| input_column_names=self._input_column_names, | |||
| @@ -239,7 +239,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| target_columns_metadata_=self._target_columns_metadata | |||
| ) | |||
| def set_params(self, *, params: Params) -> None: | |||
| def set_params(self, *, params: Params) -> None: # pragma: no cover | |||
| self._input_column_names = params['input_column_names'] | |||
| self._training_indices = params['training_indices_'] | |||
| self._target_names = params['target_names_'] | |||
| @@ -252,7 +252,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| @classmethod | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): # pragma: no cover | |||
| if not hyperparams['use_semantic_types']: | |||
| return inputs, list(range(len(inputs.columns))) | |||
| @@ -269,7 +269,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| # return columns_to_produce | |||
| @classmethod | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: # pragma: no cover | |||
| column_metadata = inputs_metadata.query((metadata_base.ALL_ELEMENTS, column_index)) | |||
| accepted_structural_types = (int, float, numpy.integer, numpy.float64) | |||
| @@ -292,7 +292,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| @classmethod | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| @@ -313,7 +313,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| return target_columns_metadata | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], # pragma: no cover | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: | |||
| outputs_metadata = metadata_base.DataMetadata().generate(value=outputs) | |||
| @@ -323,7 +323,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| return outputs_metadata | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: # pragma: no cover | |||
| outputs = d3m_dataframe(predictions, generate_metadata=True) | |||
| target_columns_metadata = self._copy_inputs_metadata(inputs.metadata, self._training_indices, outputs.metadata, self.hyperparams) | |||
| outputs.metadata = self._update_predictions_metadata(inputs.metadata, outputs, target_columns_metadata) | |||
| @@ -331,7 +331,7 @@ class EnsemblePrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, Params | |||
| @classmethod | |||
| def _copy_inputs_metadata(cls, inputs_metadata: metadata_base.DataMetadata, input_indices: List[int], | |||
| def _copy_inputs_metadata(cls, inputs_metadata: metadata_base.DataMetadata, input_indices: List[int], # pragma: no cover | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| @@ -29,13 +29,13 @@ __all__ = ('SystemWiseDetectionPrimitive',) | |||
| Inputs = container.DataFrame | |||
| Outputs = container.DataFrame | |||
| class Params(params.Params): | |||
| class Params(params.Params): # pragma: no cover | |||
| #to-do : how to make params dynamic | |||
| use_column_names: Optional[Any] | |||
| class Hyperparams(hyperparams.Hyperparams): | |||
| class Hyperparams(hyperparams.Hyperparams): # pragma: no cover | |||
| #Tuning Parameter | |||
| #default -1 considers entire time series is considered | |||
| @@ -102,7 +102,7 @@ class Hyperparams(hyperparams.Hyperparams): | |||
| class SystemWiseDetectionPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperparams]): | |||
| class SystemWiseDetectionPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperparams]): # pragma: no cover | |||
| """ | |||
| Primitive to find abs_energy of time series | |||
| """ | |||
| @@ -29,13 +29,13 @@ __all__ = ('SystemWiseDetectionPrimitive',) | |||
| Inputs = container.DataFrame | |||
| Outputs = container.DataFrame | |||
| class Params(params.Params): | |||
| class Params(params.Params): # pragma: no cover | |||
| #to-do : how to make params dynamic | |||
| use_column_names: Optional[Any] | |||
| class Hyperparams(hyperparams.Hyperparams): | |||
| class Hyperparams(hyperparams.Hyperparams): # pragma: no cover | |||
| #Tuning Parameter | |||
| #default -1 considers entire time series is considered | |||
| @@ -102,7 +102,7 @@ class Hyperparams(hyperparams.Hyperparams): | |||
| class SystemWiseDetectionPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperparams]): | |||
| class SystemWiseDetectionPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperparams]): # pragma: no cover | |||
| """ | |||
| Primitive to find abs_energy of time series | |||
| """ | |||
| @@ -341,7 +341,7 @@ class UnsupervisedOutlierDetectorBase(TODSUnsupervisedLearnerPrimitiveBase[Input | |||
| return CallResult(outputs) | |||
| def _produce_score(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> CallResult[Outputs]: | |||
| def _produce_score(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> CallResult[Outputs]: # pragma: no cover | |||
| """ | |||
| Process the testing data. | |||
| Args: | |||
| @@ -402,7 +402,7 @@ class UnsupervisedOutlierDetectorBase(TODSUnsupervisedLearnerPrimitiveBase[Input | |||
| return CallResult(outputs) | |||
| def get_params(self) -> Params_ODBase: | |||
| def get_params(self) -> Params_ODBase: # pragma: no cover | |||
| """ | |||
| Return parameters. | |||
| Args: | |||
| @@ -447,7 +447,7 @@ class UnsupervisedOutlierDetectorBase(TODSUnsupervisedLearnerPrimitiveBase[Input | |||
| # pass | |||
| def set_params(self, *, params: Params_ODBase) -> None: | |||
| def set_params(self, *, params: Params_ODBase) -> None: # pragma: no cover | |||
| """ | |||
| Set parameters for outlier detection. | |||
| Args: | |||
| @@ -580,7 +580,7 @@ class UnsupervisedOutlierDetectorBase(TODSUnsupervisedLearnerPrimitiveBase[Input | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: # pragma: no cover | |||
| """ | |||
| Updata metadata for selected columns. | |||
| @@ -737,10 +737,10 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| __author__ = "DATALAB @Taxes A&M University" | |||
| metadata: metadata_base.PrimitiveMetadata = None | |||
| def __init__(self, *, | |||
| def __init__(self, *, | |||
| hyperparams: Hyperparams, | |||
| random_seed: int = 0, | |||
| docker_containers: Dict[str, DockerContainer] = None) -> None: | |||
| docker_containers: Dict[str, DockerContainer] = None) -> None: # pragma: no cover | |||
| super().__init__(hyperparams=hyperparams, random_seed=random_seed, docker_containers=docker_containers) | |||
| self._clf = None | |||
| @@ -764,7 +764,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| self._fitted = False | |||
| # | |||
| @abc.abstractmethod | |||
| def set_training_data(self, *, inputs: Inputs) -> None: | |||
| def set_training_data(self, *, inputs: Inputs) -> None: # pragma: no cover | |||
| """ | |||
| Set training data for outlier detection. | |||
| Args: | |||
| @@ -776,7 +776,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| self._inputs = inputs | |||
| self._fitted = False | |||
| def _set_subseq_inds(self): | |||
| def _set_subseq_inds(self): # pragma: no cover | |||
| self.left_inds_ = getattr(self._clf, 'left_inds_', None) | |||
| self.right_inds_ = getattr(self._clf, 'right_inds_', None) | |||
| @@ -787,7 +787,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| self.right_inds_[self.right_inds_ > len(self._inputs)] = len(self._inputs) | |||
| # print(self.left_inds_, self.right_inds_) | |||
| def _fit(self, *, timeout: float = None, iterations: int = None) -> CallResult[None]: | |||
| def _fit(self, *, timeout: float = None, iterations: int = None) -> CallResult[None]: # pragma: no cover | |||
| """ | |||
| Fit model with training data. | |||
| Args: | |||
| @@ -829,7 +829,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| return CallResult(None) | |||
| def _produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> CallResult[Outputs]: | |||
| def _produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> CallResult[Outputs]: # pragma: no cover | |||
| """ | |||
| Process the testing data. | |||
| Args: | |||
| @@ -894,7 +894,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| return CallResult(outputs) | |||
| def _produce_score(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> CallResult[Outputs]: | |||
| def _produce_score(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> CallResult[Outputs]: # pragma: no cover | |||
| """ | |||
| Process the testing data. | |||
| Args: | |||
| @@ -955,7 +955,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| return CallResult(outputs) | |||
| def get_params(self) -> Params_ODBase: | |||
| def get_params(self) -> Params_ODBase: # pragma: no cover | |||
| """ | |||
| Return parameters. | |||
| Args: | |||
| @@ -1000,7 +1000,7 @@ class UnsupervisedOutlierDetectorBase2(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| # pass | |||
| def set_params(self, *, params: Params_ODBase) -> None: | |||
| def set_params(self, *, params: Params_ODBase) -> None: # pragma: no cover | |||
| """ | |||
| Set parameters for outlier detection. | |||
| Args: | |||
| @@ -7,7 +7,7 @@ from d3m.metadata.pipeline import Pipeline | |||
| from axolotl.algorithms.base import PipelineSearchBase | |||
| from axolotl.utils import schemas as schemas_utils | |||
| class BruteForceSearch(PipelineSearchBase): | |||
| class BruteForceSearch(PipelineSearchBase): # pragma: no cover | |||
| def __init__(self, problem_description, backend, *, primitives_blocklist=None, ranking_function=None): | |||
| super().__init__(problem_description=problem_description, backend=backend, | |||
| primitives_blocklist=primitives_blocklist, ranking_function=ranking_function) | |||
| @@ -73,7 +73,7 @@ class BruteForceSearch(PipelineSearchBase): | |||
| pipeline_candidates = _generate_pipelines(primitive_python_paths) | |||
| return pipeline_candidates | |||
| primitive_python_paths = { | |||
| primitive_python_paths = { # pragma: no cover | |||
| 'data_processing': [ | |||
| #'d3m.primitives.tods.data_processing.time_interval_transform', | |||
| #'d3m.primitives.tods.data_processing.categorical_to_binary', | |||
| @@ -153,7 +153,7 @@ primitive_python_paths = { | |||
| } | |||
| def _rank_first_metric(pipeline_result): | |||
| def _rank_first_metric(pipeline_result): # pragma: no cover | |||
| if pipeline_result.status == 'COMPLETED': | |||
| scores = pipeline_result.scores | |||
| pipeline_result.rank = -scores['value'][0] | |||
| @@ -163,22 +163,22 @@ def _rank_first_metric(pipeline_result): | |||
| pipeline_result.rank = 1 | |||
| return pipeline_result | |||
| def _generate_data_preparation_params(): | |||
| def _generate_data_preparation_params(): # pragma: no cover | |||
| from axolotl.utils import schemas as schemas_utils | |||
| data_preparation_params = schemas_utils.DATA_PREPARATION_PARAMS['no_split'] | |||
| return data_preparation_params | |||
| def _generate_scoring_pipeline(): | |||
| def _generate_scoring_pipeline(): # pragma: no cover | |||
| from axolotl.utils import schemas as schemas_utils | |||
| scoring_pipeline = schemas_utils.get_scoring_pipeline() | |||
| return scoring_pipeline | |||
| def _generate_data_preparation_pipeline(): | |||
| def _generate_data_preparation_pipeline(): # pragma: no cover | |||
| from axolotl.utils import schemas as schemas_utils | |||
| data_preparation_pipeline = schemas_utils.get_splitting_pipeline("TRAINING_DATA") | |||
| return data_preparation_pipeline | |||
| def _generate_pipline(combinations): | |||
| def _generate_pipline(combinations): # pragma: no cover | |||
| from d3m import index | |||
| from d3m.metadata.base import ArgumentType | |||
| from d3m.metadata.pipeline import Pipeline, PrimitiveStep | |||
| @@ -257,7 +257,7 @@ def _generate_pipline(combinations): | |||
| piplines.append(pipeline_description) | |||
| return piplines | |||
| def _generate_pipelines(primitive_python_paths, cpu_count=40): | |||
| def _generate_pipelines(primitive_python_paths, cpu_count=40): # pragma: no cover | |||
| """ | |||
| Args: | |||
| primitive_python_paths: a list of primitive Python paths for algorithms | |||
| @@ -156,7 +156,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| self._inputs = inputs | |||
| self._fitted = False | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: # pragma: no cover | |||
| if self._fitted: | |||
| return CallResult(None) | |||
| @@ -175,7 +175,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| self.logger.warn("No input columns were selected") | |||
| return CallResult(None) | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: # pragma: no cover | |||
| self.logger.info('Holt Smoothing Primitive called') | |||
| outputs = inputs | |||
| @@ -197,10 +197,10 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| return base.CallResult(outputs) | |||
| def _update_metadata(self, outputs): | |||
| def _update_metadata(self, outputs): # pragma: no cover | |||
| outputs.metadata = outputs.metadata.generate(outputs,) | |||
| def get_params(self) -> Params: | |||
| def get_params(self) -> Params: # pragma: no cover | |||
| if not self._fitted: | |||
| return Params( | |||
| input_column_names=self._input_column_names, | |||
| @@ -218,7 +218,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| target_columns_metadata_=self._target_columns_metadata | |||
| ) | |||
| def set_params(self, *, params: Params) -> None: | |||
| def set_params(self, *, params: Params) -> None: # pragma: no cover | |||
| self._input_column_names = params['input_column_names'] | |||
| self._training_indices = params['training_indices_'] | |||
| self._target_names = params['target_names_'] | |||
| @@ -231,7 +231,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| @classmethod | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): # pragma: no cover | |||
| if not hyperparams['use_semantic_types']: | |||
| return inputs, list(range(len(inputs.columns))) | |||
| @@ -248,7 +248,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| # return columns_to_produce | |||
| @classmethod | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: # pragma: no cover | |||
| column_metadata = inputs_metadata.query((metadata_base.ALL_ELEMENTS, column_index)) | |||
| accepted_structural_types = (int, float, numpy.integer, numpy.float64) | |||
| @@ -271,7 +271,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| @classmethod | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| @@ -293,7 +293,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: # pragma: no cover | |||
| outputs_metadata = metadata_base.DataMetadata().generate(value=outputs) | |||
| for column_index, column_metadata in enumerate(target_columns_metadata): | |||
| @@ -302,7 +302,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| return outputs_metadata | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: # pragma: no cover | |||
| outputs = d3m_dataframe(predictions, generate_metadata=True) | |||
| target_columns_metadata = self._copy_inputs_metadata(inputs.metadata, self._training_indices, outputs.metadata, self.hyperparams) | |||
| outputs.metadata = self._update_predictions_metadata(inputs.metadata, outputs, target_columns_metadata) | |||
| @@ -311,7 +311,7 @@ class HoltSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, Outputs, P | |||
| @classmethod | |||
| def _copy_inputs_metadata(cls, inputs_metadata: metadata_base.DataMetadata, input_indices: List[int], | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| for column_index in input_indices: | |||
| @@ -155,7 +155,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| self._inputs = inputs | |||
| self._fitted = False | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: # pragma: no cover | |||
| if self._fitted: | |||
| return CallResult(None) | |||
| @@ -174,7 +174,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| self.logger.warn("No input columns were selected") | |||
| return CallResult(None) | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: # pragma: no cover | |||
| self.logger.info('Holt Winters Smoothing Primitive called') | |||
| outputs = inputs | |||
| @@ -228,7 +228,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| @classmethod | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): # pragma: no cover | |||
| if not hyperparams['use_semantic_types']: | |||
| return inputs, list(range(len(inputs.columns))) | |||
| @@ -245,7 +245,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| # return columns_to_produce | |||
| @classmethod | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: # pragma: no cover | |||
| column_metadata = inputs_metadata.query((metadata_base.ALL_ELEMENTS, column_index)) | |||
| accepted_structural_types = (int, float, numpy.integer, numpy.float64) | |||
| @@ -268,7 +268,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| @classmethod | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| @@ -290,7 +290,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: # pragma: no cover | |||
| outputs_metadata = metadata_base.DataMetadata().generate(value=outputs) | |||
| for column_index, column_metadata in enumerate(target_columns_metadata): | |||
| @@ -299,7 +299,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| return outputs_metadata | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: # pragma: no cover | |||
| outputs = d3m_dataframe(predictions, generate_metadata=True) | |||
| target_columns_metadata = self._copy_inputs_metadata(inputs.metadata, self._training_indices, outputs.metadata, self.hyperparams) | |||
| outputs.metadata = self._update_predictions_metadata(inputs.metadata, outputs, target_columns_metadata) | |||
| @@ -308,7 +308,7 @@ class HoltWintersExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[ | |||
| @classmethod | |||
| def _copy_inputs_metadata(cls, inputs_metadata: metadata_base.DataMetadata, input_indices: List[int], | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| for column_index in input_indices: | |||
| @@ -151,7 +151,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| self._inputs = inputs | |||
| self._fitted = False | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: # pragma: no cover | |||
| if self._fitted: | |||
| return CallResult(None) | |||
| @@ -170,7 +170,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| self.logger.warn("No input columns were selected") | |||
| return CallResult(None) | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: # pragma: no cover | |||
| self.logger.info('Time Series Moving Average Primitive called') | |||
| @@ -195,10 +195,10 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| return base.CallResult(outputs) | |||
| def _update_metadata(self, outputs): | |||
| def _update_metadata(self, outputs): # pragma: no cover | |||
| outputs.metadata = outputs.metadata.generate(outputs,) | |||
| def get_params(self) -> Params: | |||
| def get_params(self) -> Params: # pragma: no cover | |||
| if not self._fitted: | |||
| return Params( | |||
| input_column_names=self._input_column_names, | |||
| @@ -216,7 +216,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| target_columns_metadata_=self._target_columns_metadata | |||
| ) | |||
| def set_params(self, *, params: Params) -> None: | |||
| def set_params(self, *, params: Params) -> None: # pragma: no cover | |||
| self._input_column_names = params['input_column_names'] | |||
| self._training_indices = params['training_indices_'] | |||
| self._target_names = params['target_names_'] | |||
| @@ -229,7 +229,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| @classmethod | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): # pragma: no cover | |||
| if not hyperparams['use_semantic_types']: | |||
| return inputs, list(range(len(inputs.columns))) | |||
| @@ -246,7 +246,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| # return columns_to_produce | |||
| @classmethod | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: # pragma: no cover | |||
| column_metadata = inputs_metadata.query((metadata_base.ALL_ELEMENTS, column_index)) | |||
| accepted_structural_types = (int, float, numpy.integer, numpy.float64) | |||
| @@ -269,7 +269,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| @classmethod | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| @@ -291,7 +291,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: # pragma: no cover | |||
| outputs_metadata = metadata_base.DataMetadata().generate(value=outputs) | |||
| for column_index, column_metadata in enumerate(target_columns_metadata): | |||
| @@ -300,7 +300,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| return outputs_metadata | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: # pragma: no cover | |||
| outputs = d3m_dataframe(predictions, generate_metadata=True) | |||
| target_columns_metadata = self._copy_inputs_metadata(inputs.metadata, self._training_indices, outputs.metadata, self.hyperparams) | |||
| outputs.metadata = self._update_predictions_metadata(inputs.metadata, outputs, target_columns_metadata) | |||
| @@ -309,7 +309,7 @@ class MovingAverageTransformerPrimitive(UnsupervisedLearnerPrimitiveBase[Inputs, | |||
| @classmethod | |||
| def _copy_inputs_metadata(cls, inputs_metadata: metadata_base.DataMetadata, input_indices: List[int], | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| for column_index in input_indices: | |||
| @@ -160,7 +160,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| self._inputs = inputs | |||
| self._fitted = False | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: | |||
| def fit(self, *, timeout: float = None, iterations: int = None)-> CallResult[None]: # pragma: no cover | |||
| if self._fitted: | |||
| return CallResult(None) | |||
| @@ -179,7 +179,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| self.logger.warn("No input columns were selected") | |||
| return CallResult(None) | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: | |||
| def produce(self, *, inputs: Inputs, timeout: float = None, iterations: int = None) -> base.CallResult[Outputs]: # pragma: no cover | |||
| self.logger.info('Simple Exponential Smoothing Primitive called') | |||
| outputs = inputs | |||
| @@ -202,13 +202,13 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| return base.CallResult(outputs) | |||
| def _update_metadata(self, outputs): | |||
| def _update_metadata(self, outputs): # pragma: no cover | |||
| outputs.metadata = outputs.metadata.generate(outputs,) | |||
| def get_params(self) -> Params: | |||
| def get_params(self) -> Params: # pragma: no cover | |||
| if not self._fitted: | |||
| return Params( | |||
| input_column_names=self._input_column_names, | |||
| @@ -226,7 +226,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| target_columns_metadata_=self._target_columns_metadata | |||
| ) | |||
| def set_params(self, *, params: Params) -> None: | |||
| def set_params(self, *, params: Params) -> None: # pragma: no cover | |||
| self._input_column_names = params['input_column_names'] | |||
| self._training_indices = params['training_indices_'] | |||
| self._target_names = params['target_names_'] | |||
| @@ -239,7 +239,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| @classmethod | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): | |||
| def _get_columns_to_fit(cls, inputs: Inputs, hyperparams: Hyperparams): # pragma: no cover | |||
| if not hyperparams['use_semantic_types']: | |||
| return inputs, list(range(len(inputs.columns))) | |||
| @@ -256,7 +256,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| # return columns_to_produce | |||
| @classmethod | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: # pragma: no cover | |||
| column_metadata = inputs_metadata.query((metadata_base.ALL_ELEMENTS, column_index)) | |||
| accepted_structural_types = (int, float, numpy.integer, numpy.float64) | |||
| @@ -279,7 +279,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| @classmethod | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: | |||
| def _get_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams) -> List[OrderedDict]: # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| @@ -301,7 +301,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: # pragma: no cover | |||
| outputs_metadata = metadata_base.DataMetadata().generate(value=outputs) | |||
| for column_index, column_metadata in enumerate(target_columns_metadata): | |||
| @@ -310,7 +310,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| return outputs_metadata | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: # pragma: no cover | |||
| outputs = d3m_dataframe(predictions, generate_metadata=True) | |||
| target_columns_metadata = self._copy_inputs_metadata(inputs.metadata, self._training_indices, outputs.metadata, self.hyperparams) | |||
| outputs.metadata = self._update_predictions_metadata(inputs.metadata, outputs, target_columns_metadata) | |||
| @@ -319,7 +319,7 @@ class SimpleExponentialSmoothingPrimitive(UnsupervisedLearnerPrimitiveBase[Input | |||
| @classmethod | |||
| def _copy_inputs_metadata(cls, inputs_metadata: metadata_base.DataMetadata, input_indices: List[int], | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): | |||
| outputs_metadata: metadata_base.DataMetadata, hyperparams): # pragma: no cover | |||
| outputs_length = outputs_metadata.query((metadata_base.ALL_ELEMENTS,))['dimension']['length'] | |||
| target_columns_metadata: List[OrderedDict] = [] | |||
| for column_index in input_indices: | |||
| @@ -203,18 +203,18 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| if len(self._training_indices) > 0: | |||
| # self._clf.fit(self._training_inputs) | |||
| self._fitted = True | |||
| else: | |||
| else: # pragma: no cover | |||
| if self.hyperparams['error_on_no_input']: | |||
| raise RuntimeError("No input columns were selected") | |||
| self.logger.warn("No input columns were selected") | |||
| if not self._fitted: | |||
| if not self._fitted: # pragma: no cover | |||
| raise PrimitiveNotFittedError("Primitive not fitted.") | |||
| sk_inputs = inputs | |||
| if self.hyperparams['use_semantic_types']: | |||
| if self.hyperparams['use_semantic_types']: # pragma: no cover | |||
| sk_inputs = inputs.iloc[:, self._training_indices] | |||
| output_columns = [] | |||
| if len(self._training_indices) > 0: | |||
| @@ -231,7 +231,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| outputs.columns = self._input_column_names | |||
| output_columns = [outputs] | |||
| else: | |||
| else: # pragma: no cover | |||
| if self.hyperparams['error_on_no_input']: | |||
| raise RuntimeError("No input columns were selected") | |||
| self.logger.warn("No input columns were selected") | |||
| @@ -261,7 +261,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| inputs_metadata = inputs.metadata | |||
| def can_produce_column(column_index: int) -> bool: | |||
| def can_produce_column(column_index: int) -> bool: # pragma: no cover | |||
| return cls._can_produce_column(inputs_metadata, column_index, hyperparams) | |||
| use_columns = [] | |||
| @@ -283,7 +283,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| # return columns_to_produce | |||
| @classmethod | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: | |||
| def _can_produce_column(cls, inputs_metadata: metadata_base.DataMetadata, column_index: int, hyperparams: Hyperparams) -> bool: # pragma: no cover | |||
| """ | |||
| Output whether a column can be processed. | |||
| Args: | |||
| @@ -316,7 +316,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| @classmethod | |||
| def _update_predictions_metadata(cls, inputs_metadata: metadata_base.DataMetadata, outputs: Optional[Outputs], | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: | |||
| target_columns_metadata: List[OrderedDict]) -> metadata_base.DataMetadata: # pragma: no cover | |||
| """ | |||
| Updata metadata for selected columns. | |||
| Args: | |||
| @@ -335,7 +335,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| return outputs_metadata | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: | |||
| def _wrap_predictions(self, inputs: Inputs, predictions: ndarray) -> Outputs: # pragma: no cover | |||
| """ | |||
| Wrap predictions into dataframe | |||
| Args: | |||
| @@ -352,7 +352,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| @classmethod | |||
| def _add_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams): | |||
| def _add_target_columns_metadata(cls, outputs_metadata: metadata_base.DataMetadata, hyperparams): # pragma: no cover | |||
| """ | |||
| Add target columns metadata | |||
| Args: | |||
| @@ -376,10 +376,10 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| return target_columns_metadata | |||
| def _write(self, inputs:Inputs): | |||
| def _write(self, inputs:Inputs): # pragma: no cover | |||
| inputs.to_csv(str(time.time())+'.csv') | |||
| def _get_sub_sequences_length(self, n_samples, window_size, step): | |||
| def _get_sub_sequences_length(self, n_samples, window_size, step): # pragma: no cover | |||
| """Pseudo chop a univariate time series into sub sequences. Return valid | |||
| length only. | |||
| Parameters | |||
| @@ -400,7 +400,7 @@ class SubsequenceSegmentationPrimitive(transformer.TransformerPrimitiveBase[Inpu | |||
| return valid_len | |||
| def _get_sub_matrices(self, X, window_size, step=1, flatten_order='F'): | |||
| def _get_sub_matrices(self, X, window_size, step=1, flatten_order='F'): # pragma: no cover | |||
| """ | |||
| Chop a multivariate time series into sub sequences (matrices). | |||
| Parameters | |||