// // Cost.hpp // // Created by Marc Melikyan on 1/16/21. // #ifndef MLPP_COST_H #define MLPP_COST_H #include namespace MLPP{ class Cost{ public: // Regression Costs double MSE(std::vector y_hat, std::vector y); double MSE(std::vector> y_hat, std::vector> y); std::vector MSEDeriv(std::vector y_hat, std::vector y); std::vector> MSEDeriv(std::vector> y_hat, std::vector> y); double RMSE(std::vector y_hat, std::vector y); double RMSE(std::vector> y_hat, std::vector> y); std::vector RMSEDeriv(std::vector y_hat, std::vector y); std::vector> RMSEDeriv(std::vector> y_hat, std::vector> y); double MAE(std::vector y_hat, std::vector y); double MAE(std::vector> y_hat, std::vector> y); std::vector MAEDeriv(std::vector y_hat, std::vector y); std::vector> MAEDeriv(std::vector> y_hat, std::vector> y); double MBE(std::vector y_hat, std::vector y); double MBE(std::vector> y_hat, std::vector> y); std::vector MBEDeriv(std::vector y_hat, std::vector y); std::vector> MBEDeriv(std::vector> y_hat, std::vector> y); // Classification Costs double LogLoss(std::vector y_hat, std::vector y); double LogLoss(std::vector> y_hat, std::vector> y); std::vector LogLossDeriv(std::vector y_hat, std::vector y); std::vector> LogLossDeriv(std::vector> y_hat, std::vector> y); double CrossEntropy(std::vector y_hat, std::vector y); double CrossEntropy(std::vector> y_hat, std::vector> y); std::vector CrossEntropyDeriv(std::vector y_hat, std::vector y); std::vector> CrossEntropyDeriv(std::vector> y_hat, std::vector> y); double HuberLoss(std::vector y_hat, std::vector y, double delta); double HuberLoss(std::vector> y_hat, std::vector> y, double delta); std::vector HuberLossDeriv(std::vector y_hat, std::vector y, double delta); std::vector> HuberLossDeriv(std::vector> y_hat, std::vector> y, double delta); double HingeLoss(std::vector y_hat, std::vector y); double HingeLoss(std::vector> y_hat, std::vector> y); std::vector HingeLossDeriv(std::vector y_hat, std::vector y); std::vector> HingeLossDeriv(std::vector> y_hat, std::vector> y); double HingeLoss(std::vector y_hat, std::vector y, std::vector weights, double C); double HingeLoss(std::vector> y_hat, std::vector> y, std::vector> weights, double C); std::vector HingeLossDeriv(std::vector y_hat, std::vector y, double C); std::vector> HingeLossDeriv(std::vector> y_hat, std::vector> y, double C); double WassersteinLoss(std::vector y_hat, std::vector y); double WassersteinLoss(std::vector> y_hat, std::vector> y); std::vector WassersteinLossDeriv(std::vector y_hat, std::vector y); std::vector> WassersteinLossDeriv(std::vector> y_hat, std::vector> y); double dualFormSVM(std::vector alpha, std::vector> X, std::vector y); // TO DO: DON'T forget to add non-linear kernelizations. std::vector dualFormSVMDeriv(std::vector alpha, std::vector> X, std::vector y); private: }; } #endif /* Cost_hpp */