Jensen
A C++ toolkit for Convex Optimization (Logistic Loss, SVM, SVR, Least Squares etc.), Convex Optimization algorithms (LBFGS, TRON, SGD, AdsGrad, CG, Nesterov etc.) and Classifiers/Regressors (Logistic Regression, SVMs, Least Squares Regression etc.)
Install / Use
/learn @decile-team/JensenREADME
Jensen
Jensen: A toolkit with API support for Convex Optimization and Machine Learning For further documentation, please see https://arxiv.org/abs/1807.06574
License
Copyright (C) Rishabh Iyer, John T. Halloran, and Kai Wei Licensed under the Open Software License version 3.0 See COPYING or http://opensource.org/licenses/OSL-3.0
Contributors:
- Rishabh Iyer
- John Halloran
- Kai Wei
Features Supported
- Convex Function API
- Base class for convex optimization
L1LogistocLossandL2LogistocLoss,L1SmoothSVMLossandL2SmoothSVMLoss,L1HingeSVMLossandL2HingeSVMLoss,L1ProbitLossLossandL2ProbitLoss,L1HuberSVMLossandL2HuberSVMLoss,L1SmoothSVRLossandL2SmoothSVRLoss,L1HingeSVMLossandL2HingeSVMLoss
- Convex Optimization Algorithms API
Trust Region Newton(TRON)LBFGS AlgorithmLBFGS OWL(L1 regularization)Conjugate Gradient DescentDual Coordinate Descent for SVMs(SVCDual)Gradient DescentGradient Descent with Line SearchGradient Descent with Nesterov's algorithmGradient Descent with Barzilai-Borwein step sizeStochastic Gradient DescentStochastic Gradient Descent with AdaGradStochastic Gradient Descent with Dual AveragingStochastic Gradient Descent with Decaying Learning Rate
- ML Classification API
L1 Logistic Regression,L2 Logistic RegressionL1 Smooth SVML2 Smooth SVML2 Smooth SVM
- ML Regression API
L1 Linear RegressionL2 Linear RegressionL1 Smooth SVRsL2 Smooth SVRsL2 Hinge SVRs
Install and Build
- Install CMake
- Go to the main directory of jensen
- mkdir build
- cd build/
- cmake ..
- make
Once you run make, it should automatically build the entire library. Once the library is built, please try out the example codes in the build directory.
Test Code
To test the optimization algorithms please run the test executables: ./TestL1LogisticLoss ./TestL2LogisticLoss ./TestL1SmoothSVMLoss ./TestL2LeastSquaresLoss etc.
Examples
You can also play around with the examples for testing classification and regression models. You can try them out as: ./ClassificationExample -trainFeatureFile ../data/heart_scale.feat -trainLabelFile ../data/heart_scale.label -testFeatureFile ../data/heart_scale.feat -testLabelFile ../data/heart_scale.label Optionally you can also play around with the method (L1LR, L2LR etc.), the algtype (LBFGS, TRON etc.), the regularization and so on.
Related Skills
openhue
343.1kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
343.1kElevenLabs text-to-speech with mac-style say UX.
weather
343.1kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
