cnn module

This script provides a CNN to solve a classification problem.

The script receives the training and test datasets (labels and data) as well as the mRMR ranking to perform the classification. The optimisation of the parameters in the different models is carried out through a grid search, using sklearn.model_selection.GridSearchCV. Different subsets of features of the mRMR ranking are selected in order to determine which subset is the best.

cnn.create_model(n_filters=15, kernel_size=3)[source]

Create the CNN model.

Parameters:
  • n_filters (int) – Number of filters
  • kernel_size (int) – Kernel size

:return CNN model :rtype: keras.model.sequential

cnn.fit_model(model, data_train, data_test, labels_train, labels_test)[source]

Fit the model. The features of the dataset (mRMR ranking) are selected before fit the model

Parameters:

:return Accuracy :rtype: float