Docs /Templates/ sinapsis-sktime

MCDCNNClassifierSKTimeWrapper

sinapsis-sktimeSKTimedynamicinferencemodelsprediction

Python template · sinapsis_sktime.templates.sktime_classifiers

Overview

Template for SkTime classification model training and inference for the deep_learning module.

MCDCNNClassifier — inherited documentation

Multi Channel Deep Convolutional Neural Classifier, as described in [1]_.

Adapted from the implementation of Fawaz et. al https://github.com/hfawaz/dl-4-tsc/blob/master/classifiers/mcdcnn.py

Parameters ---------- n_epochs : int, optional (default=120) The number of epochs to train the model. batch_size : int, optional (default=16) The number of samples per gradient update. kernel_size : int, optional (default=5) The size of kernel in Conv1D layer. pool_size : int, optional (default=2) The size of kernel in (Max) Pool layer. filter_sizes : tuple, optional (default=(8, 8)) The sizes of filter for Conv1D layer corresponding to each Conv1D in the block. dense_units : int, optional (default=732) The number of output units of the final Dense layer of this Network. This is NOT the final layer but the penultimate layer. conv_padding : str or None, optional (default="same") The type of padding to be applied to convolutional layers. pool_padding : str or None, optional (default="same") The type of padding to be applied to pooling layers. loss : str, optional (default="categorical_crossentropy") The name of the loss function to be used during training, should be supported by keras. activation : str, optional (default="sigmoid") The activation function to apply at the output. List of available activation functions: https://keras.io/api/layers/activations/ activation_hidden : string or a tf callable, default="relu" Activation function used in the hidden layers. List of available activation functions: https://keras.io/api/layers/activations/ use_bias : bool, optional (default=True) Whether bias should be included in the output layer. metrics : None or string, optional (default=None) The string which will be used during model compilation. If left as None, then "accuracy" is passed to ``model.compile()``. optimizer: None or keras.optimizers.Optimizer instance, optional (default=None) The optimizer that is used for model compiltation. If left as None, then ``keras.optimizers.SGD`` is used with the following parameters - ``learning_rate=0.01, momentum=0.9, weight_decay=0.0005``. callbacks : None or list of keras.callbacks.Callback, optional (default=None) The callback(s) to use during training. random_state : int, optional (default=0) The seed to any random action.

References ---------- .. [1] Zheng et. al, Time series classification using multi-channels deep convolutional neural networks, International Conference on Web-Age Information Management, Pages 298-310, year 2014, organization: Springer.

Examples -------- >>> from sktime.classification.deep_learning.mcdcnn import MCDCNNClassifier >>> from sktime.datasets import load_unit_test >>> X_train, y_tain = load_unit_test(split="train") >>> mcdcnn = MCDCNNClassifier() # doctest: +SKIP >>> mcdcnn.fit(X_train, y_train) # doctest: +SKIP MCDCNNClassifier(...)

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-sktime==1.0.0
uv pip install sinapsis-sktime==1.0.0
uv add sinapsis-sktime==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
root_dir
str
Optional
Default: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
model_save_pathRequired
Path where the trained model will be saved. mcdcnnclassifier_init n_epochs <class 'int'>: default: 120 batch_size <class 'int'>: default: 16 kernel_size <class 'int'>: default: 5 pool_size <class 'int'>: default: 2… Read full field description

Path where the trained model will be saved. mcdcnnclassifier_init n_epochs <class 'int'>: default: 120 batch_size <class 'int'>: default: 16 kernel_size <class 'int'>: default: 5 pool_size <class 'int'>: default: 2 filter_sizes <class 'tuple'>: default: (8, 8) dense_units <class 'int'>: default: 732 conv_padding <class 'str'>: default: same pool_padding <class 'str'>: default: same loss <class 'str'>: default: categorical_crossentropy activation <class 'str'>: default: sigmoid activation_hidden <class 'str'>: default: relu use_bias <class 'bool'>: default: True callbacks <class 'NoneType'>: default: None metrics <class 'NoneType'>: default: None optimizer <class 'NoneType'>: default: None random_state <class 'int'>: default: 0

str
Required
Default: null
mcdcnnclassifier_initRequired
MCDCNNClassifierAttributes
Required
Default: null
loss
str
Optional
Default: "categorical_crossentropy"
metrics
NoneType
Optional
Default: null
n_epochs
int
Optional
Default: 120
use_bias
bool
Optional
Default: true
callbacks
NoneType
Optional
Default: null
optimizer
NoneType
Optional
Default: null
pool_size
int
Optional
Default: 2
activation
str
Optional
Default: "sigmoid"
batch_size
int
Optional
Default: 16
dense_units
int
Optional
Default: 732
kernel_size
int
Optional
Default: 5
conv_padding
str
Optional
Default: "same"
filter_sizes
tuple
Optional
Default: [8,8]
pool_padding
str
Optional
Default: "same"
random_state
int
Optional
Default: 0
activation_hidden
str
Optional
Default: "relu"

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "MCDCNNClassifierSKTimeWrapper"
    class_name: "MCDCNNClassifierSKTimeWrapper"
    attributes:
      root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
      model_save_path: "<required>"
      mcdcnnclassifier_init:
        loss: "categorical_crossentropy"
        metrics: null
        n_epochs: 120
        use_bias: true
        callbacks: null
        optimizer: null
        pool_size: 2
        activation: "sigmoid"
        batch_size: 16
        dense_units: 732
        kernel_size: 5
        conv_padding: "same"
        filter_sizes: {}
        pool_padding: "same"
        random_state: 0
        activation_hidden: "relu"

Inheritance

Immediate parent: sinapsis_sktime.templates.sktime_classifiers.SKTimeDeepLearningClassifiers

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_BUILD_DOCS · defined elsewhere