- The space dictionary as part of a
Space
object is now anOrderedDict
, makingSpace
objects iterable over their set of vectors; - Python examples under the
examples
folder are now available as part of thehdlib
package.
- Fix dumping and loading
Vector
andSpace
objects to and from pickle files; space.Space.bulk_insert
function now checks whether the names of the input vectors are instances ofbool
,int
,float
,str
, andNone
before creating and inserting vectors into the space;- Distance thresholds in
space.Space.find
andspace.Space.find_all
are now set tonumpy.Inf
by default.
- Add the
subtraction
operator to thearithmetic
module; - Add
__sub__
tospace.Vector
that makes use ofarithmetic.subtraction
to element-wise subtract two Vector objects; - Add
space.Vector.subtraction
to element-wise subtract a vector from a Vector object inplace; - Add
graph.Graph
to 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.predict
now returns the model error rate.
model.Model
is nowmodel.MLModel
;parser.kfolds_split
has been deprecated and removed;model.MLModel.cross_val_predict
now usessklearn.model_selection.StratifiedKFold
for the generation of balanced folds;- Fix the order of the test real labels before computing the model metrics in examples/chopin2.py.
- Add examples/chopin2_iris.sh as a test case for examples/chopin2.py;
- Add new unit tests to test/test.py.
space.Space.bulk_insert
has been refactored to make use ofspace.Space.insert
;parser.load_dataset
now throws aValueError
in case of non-numerical datasets;- Add missing
import os
inspace.Model
.
model.Model.fit
now correctly generates both bipolar and binary level vectors;space.Vector.dist
automatically converts the cosine similarity into a distance measure;model.Model.predict
andmodel.Model.error_rate
are now compatible with all the supported distance metrics (euclidean, hamming, and cosine).
- Fix the retraining process in
model.Model.predict
.
examples/chopin2.py
now 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.Model
class functions now raise different exceptions based on multiple checks on the input parameters.
- The
model.Model.stepwise_regression
function now report the importance corresponding to the best score; - The
model.Model._init_fit_predict
function usesaverage="weighted"
for computing a score different from the accuracy to account for label imbalance; examples/chopin2.py
now 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_rate
asmodel.Model
class method for computing the error rate of a classification model.
- The
model.Model.predict
function computes the error rate before retraining the classification model.
- Fix the retraining process in
model.Model.predict
to avoid overfitting.
hdlib
.
- Fix the initialization of Vector objects with a specific seed;
model.Model._init_fit_predict
andmodel.Model._stepwise_regression_iter
are now private;- Improving docstring adopting the numpydoc documentation format.
- Fix the break condition in
model.Model.stepwise_regression
for both thebackward
andforward
methods.
- Add
stepwise_regression
asmodel.Model
class method for performing the feature selection as backward variable elimination or forward variable selection.
- Add
bind
,bundle
, andpermute
asVector
class methods for applying arithmetic operations inplace; - Rename
split_dataset
in theparser
module intokfolds_split
; - Add
percentage_split
function to theparser
module; - Integrate chopin2 ML model into the
model
module withe theModel
class.
- Add
parser
module with utility functions for dealing with input datasets; - Check if the input pickle file exists before initializing
Vector
andSpace
objects withfrom_file
; - Report
Vector
andSpace
objects information when callingprint
; - Add
examples/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 theVector
class; - Link vectors in space with
parents
andchildren
sets as class attributes; - Add
link()
andset_root()
functions to theSpace
class.
- New distance metrics:
cosine
,hamming
, andeuclidean
; - Tags are inherited after applying the arithmetic operators;
- Unit tests for
Vector
andSpace
classes and forbundle
,bind
, andpermute
arithmetic 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
get
method of theSpace
class; - The performances of the
remove
andfindAll
methods of theSpace
class have been improved.
First public release of hdlib
.
Hyperdimensional Computing Library for building Vector Symbolic Architectures in Python 3