SpaceandVectorobjects are not constrained on a 10,000 dimensionality anymore;- The
predictfunction inhdlib.model.classification.ClassificationModelnow returns the actual distances between the test samples and the class prototypes too; - The classical arithmetic has been moved to
hdlib.arithmetic; hdlib.arithmetic.quantumprovides the quantum arithmetic at the base of Quantum Hyperdimensional Computing;- The
hdlib.model.classificationmodule now contains a newQuantumClassificationModelclass; - New reasoning and classification examples about the Quantum Hyperdimensional Computing are available under the examples folder.
- The
Vectorclass is now inhdlib.vector; hdlib.model.MLModelis nowhdlib.model.classification.ClassificationModel;hdlib.graph.Graphis nowhdlib.model.graph.GraphModel;- The
hdlib.parsermodule has been suppressed and its functions have been moved to examples/chopin2/chopin2.py; - New
hdlib.model.graph.GraphModel._error_rateandhdlib.model.graph.GraphModel._predictstatic methods for the estimation of the model error rate and the evaluation of a graph model in multiprocessing; - New
hdlib.model.regression.RegressionModelandhdlib.model.clustering.ClusteringModelclasses for building regression and clustering models respectively; - New examples about the classification of chemical structures and the classification of viral species via graph encoding.
hdlib.model.graph.GraphModel.error_mitigationdoes not take into account for false positives;hdlib.model.graph.GraphModel.error_rateandhdlib.model.graph.GraphModel.predictnow check whether an edge exist using weight-specific thresholds.
- Replace
numpy.NINFwith-numpy.infas a change introduced in Numpy 2.0.
- Replace
numpy.Infwithnumpy.infas a change introduced in Numpy 2.0; hdlib.graphand the corresponding unittest are now working properly.
- The space dictionary as part of a
Spaceobject is now anOrderedDict, makingSpaceobjects iterable over their set of vectors; - Python examples under the
examplesfolder are now available as part of thehdlibpackage.
- Fix dumping and loading
VectorandSpaceobjects to and from pickle files; space.Space.bulk_insertfunction now checks whether the names of the input vectors are instances ofbool,int,float,str, andNonebefore creating and inserting vectors into the space;- Distance thresholds in
space.Space.findandspace.Space.find_allare now set tonumpy.Infby default.
- Add the
subtractionoperator to thearithmeticmodule; - Add
__sub__tospace.Vectorthat makes use ofarithmetic.subtractionto element-wise subtract two Vector objects; - Add
space.Vector.subtractionto element-wise subtract a vector from a Vector object inplace; - Add
graph.Graphto build vector-symbolic representations of directed and undirected, weighted and unweighted graphs; - Extend test/test.py with new unit tests.
- Add
__add__and__mul__tospace.Vector; model.MLModel.predictnow returns the model error rate.
model.Modelis nowmodel.MLModel;parser.kfolds_splithas been deprecated and removed;model.MLModel.cross_val_predictnow usessklearn.model_selection.StratifiedKFoldfor the generation of balanced folds;- Fix the order of the test real labels before computing the model metrics in examples/chopin2/chopin2.py.
- Add examples/chopin2/chopin2_iris.sh as a test case for examples/chopin2/chopin2.py;
- Add new unit tests to test/test.py.
space.Space.bulk_inserthas been refactored to make use ofspace.Space.insert;parser.load_datasetnow throws aValueErrorin case of non-numerical datasets;- Add missing
import osinspace.Model.
model.Model.fitnow correctly generates both bipolar and binary level vectors;space.Vector.distautomatically converts the cosine similarity into a distance measure;model.Model.predictandmodel.Model.error_rateare now compatible with all the supported distance metrics (euclidean, hamming, and cosine).
- Fix the retraining process in
model.Model.predict.
examples/chopin2/chopin2.pynow reports the Accuracy, F1, Precision, Recall, and the Matthews correlation coefficient for each of the folds in addition to the average of these scores as evaluation metrics of the hyperdimensional computing models;model.Modelclass functions now raise different exceptions based on multiple checks on the input parameters.
- The
model.Model.stepwise_regressionfunction now report the importance corresponding to the best score; - The
model.Model._init_fit_predictfunction usesaverage="weighted"for computing a score different from the accuracy to account for label imbalance; examples/chopin2/chopin2.pynow computes different scores on the resulting predictions, prints the list of selected features based on the best score, and finally reports the confusion matrices.
- Add
error_rateasmodel.Modelclass method for computing the error rate of a classification model.
- The
model.Model.predictfunction computes the error rate before retraining the classification model.
- Fix the retraining process in
model.Model.predictto avoid overfitting.
hdlib.
- Fix the initialization of Vector objects with a specific seed;
model.Model._init_fit_predictandmodel.Model._stepwise_regression_iterare now private;- Improving docstring adopting the numpydoc documentation format.
- Fix the break condition in
model.Model.stepwise_regressionfor both thebackwardandforwardmethods.
- Add
stepwise_regressionasmodel.Modelclass method for performing the feature selection as backward variable elimination or forward variable selection.
- Add
bind,bundle, andpermuteasVectorclass methods for applying arithmetic operations inplace; - Rename
split_datasetin theparsermodule intokfolds_split; - Add
percentage_splitfunction to theparsermodule; - Integrate chopin2 ML model into the
modelmodule withe theModelclass.
- Add
parsermodule with utility functions for dealing with input datasets; - Check if the input pickle file exists before initializing
VectorandSpaceobjects withfrom_file; - Report
VectorandSpaceobjects information when callingprint; - Add
examples/chopin2/chopin2.py: reimplementation of the chopin2 ML model withhdlib.
- Tags are maintained as sets when applying arithmetic operators.
- Check for version compatibility when loading a pickle file;
- Add
normalize()function to theVectorclass; - Link vectors in space with
parentsandchildrensets as class attributes; - Add
link()andset_root()functions to theSpaceclass.
- New distance metrics:
cosine,hamming, andeuclidean; - Tags are inherited after applying the arithmetic operators;
- Unit tests for
VectorandSpaceclasses and forbundle,bind, andpermutearithmetic operators; What is the Dollar of Mexico?as a unit test.
- Vectors can be tagged;
- Tags can be used to retrieve groups of Vectors in the Space with the
getmethod of theSpaceclass; - The performances of the
removeandfindAllmethods of theSpaceclass have been improved.
First public release of hdlib.
Hyperdimensional Computing Library for building Vector Symbolic Architectures in Python 3