Skip to content

Python API

Ivan Sahumbaiev edited this page Aug 11, 2017 · 1 revision

Python scripts correspond to classification procedure

Currently all machine learning is based on sklearn library.

  • Analysis class in data_learn module has implementation of conversion of .mat files to numpy array then stored to dictionary. Main function is classify with fields:
    • data - dictionary with fields normal and ad
    • keys - keys used to select data
    • classifier - string which selecting classifiers: 'svm' and 'knn'
    • k - number of classes, needed for 'knn' classifier. Default value - 2
    • training_split - how to split data [percentage, random_state]. Default value: [0.25, 42]
    • apply_pca - use PCA for feture reduction. Default: False
    • n_pca - number of PCA components: Default value: 10
    • printing - print results. Default value: True
    • scaling - use sklearn scaler, currently StandardScaler. Default value: False
    • useCache - use saved version of classifier in order to skip retraining. Default value: True
    • clf_cache_name - name which will be used during storing the classifier. Default value: 'clf'.
Clone this wiki locally