Skip to content

Latest commit

 

History

History

utils

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

utils

contains different kind of helper functions and classes




implements abstract classes as support for the other algorithms - for example implementing the score() function for all classifiers and regressors.

Both possible use cases for Machine Learning algorithms are implemented, the abstract implementation of a standard Classifier and a standard Regressor, both used for Supervised Learning. Similar to sklearn the following functionalities are implemented

  • _classifier - the standart Classifier with
    • train()
    • predict()
    • score()
  • _regressor - the standard Regressor with
    • train()
    • predict()
    • score()

Furthermore added functionality:

  • convertSeconds() that converts seconds into hours, minutes and seconds




implements several loss-/activation-functions (for deep_learning) and the metrics for score()-evaluation

The following functionality is implemented here:

  • get_activation_function() providing different kinds of activation functions for the Layers of a Neural Networks. A short description about activation functions can be found here. The following ones are implemented:

    • Sigmoid
    • Tangens Hyperbolicus
    • Rectified Linear Unit
    • Leaky Rectified Linear Unit
    • Soft-Max
  • loss_function() provides different kind of loss functions used for the training of a Neural Network. A short introduction towards loss functions can be found here. The following of the presented functions are implemented:

    • Mean squared Error for Regression
    • Mean absolute Error for Regression
    • Mean squared logarithmic Error for Regression
    • Hinge for binary classification
    • Squared Hinge for binary classification
    • Cross Entropy for binary classification - here called Binary Cross Entropy
    • Categorical Cross Entropy for multi-class classification - here called Multi-Class Cross Entropy
    • Kullback-Leibler Divergence for multi-class classification

    Furthermore added are:

  • calc_rates() calculates the true positives, the false positives, the true negatives and the false negatives each class → What are these rates?

  • classifier_score() calculates possible evaluation metrics - described here - for a Classifier, including:

    • Recall
    • Precision
    • Accuracy
    • F1 score
    • Balanced Accuracy being similar to Accuracy but paying respect to an unbalanced number of samples for different classes
  • regressor_score() calculates possible evaluation metrics - described above - for a Regressor, including:

    • L1-norm
    • L2-norm
    • Mean squared Error
    • Mean absolute Error
    • Root mean squared Error




implements classes and functions for data preprocessing:

  • MinMaxScaler - Splits arrays or matrices into random train and test subsets, similar to MinMaxScaler by sklearn. Here you will find a brief introduction into the meaning of Scaling, Standardizing and Normalizing
  • train_test_split - implements a MinMaxScaler that scales all given data into the range from 0 to 1, similar to train_test_split by sklearn. Why splitting your dataset into train and test samples is important, can be found here.