Hoggorm is a Python package for explorative multivariate statistics in Python. It contains
- PCA (principal component analysis)
- PCR (principal component regression)
- PLSR (partial least squares regression)
- PLSR1 for single variable responses
- PLSR2 for multivariate responses
- matrix corrlation coefficients RV and RV2.
Unlike scikit-learn, whis is an excellent Python machine learning package focusing on classification and predicition, Hoggorm rather aims at understanding and interpretation of the variance in the data. Hoggorm also contains tools for prediction.
Make sure that Python 3.5 or higher is installed. A convenient way to install Python and many useful packages for scientific computing is to use the Anaconda distribution.
Installation and updates¶
Install Hoggorm easily from the command line from the PyPI - the Python Packaging Index.
pip install hoggorm
import hoggorm as ho # Compute PCA model with # - 5 components # - standardised/scaled variables # - KFold cross validation with 4 folds model = ho.nipalsPCA(arrX=myData, numComp=5, Xstand=True, cvType=["Kfold", 4]) # Extract results from PCA model scores = model.X_scores() loadings = model.X_loadings() cumulativeCalibratedExplainedVariance_allVariables = model.X_cumCalExplVar_indVar() cumulativeValidatedExplainedVariance_total = model.X_cumValExplVar()