Commit Graph

25 Commits

Author SHA1 Message Date
morenol
ba75f9ffad chore: fix clippy (#283)
* chore: fix clippy


Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
2024-11-25 11:34:29 -04:00
Lorenzo
239c00428f Patch to version 0.4.0 (#257)
* uncomment test

* Add random test for logistic regression

* linting

* Bump version

* Add test for logistic regression

* linting

* initial commit

* final

* final-clean

* Bump to 0.4.0

* Fix linter

* cleanup

* Update CHANDELOG with breaking changes

* Update CHANDELOG date

* Add functional methods to DenseMatrix implementation

* linting

* add type declaration in test

* Fix Wasm tests failing

* linting

* fix tests

* linting

* Add type annotations on BBDTree constructor

* fix clippy

* fix clippy

* fix tests

* bump version

* run fmt. fix changelog

---------

Co-authored-by: Edmund Cape <edmund@Edmunds-MacBook-Pro.local>
2024-03-04 08:51:27 -05:00
morenol
c7353d0b57 Run cargo clippy --fix (#250)
* Run `cargo clippy --fix`
* Run `cargo clippy --all-features --fix`
* Fix other clippy warnings
* cargo fmt

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
2023-01-27 10:41:18 +00:00
Lorenzo (Mec-iS)
ba70bb941f Implement Display for NaiveBayes 2022-11-03 14:18:56 +00:00
Lorenzo
cfbd45bfc0 Support Wasi as target (#216)
* Improve features
* Add wasm32-wasi as a target
* Update .github/workflows/ci.yml
Co-authored-by: morenol <22335041+morenol@users.noreply.github.com>
2022-11-02 15:22:38 +00:00
Lorenzo
083803c900 Port ensemble. Add Display to naive_bayes (#208) 2022-10-31 17:35:33 +00:00
Lorenzo
52eb6ce023 Merge potential next release v0.4 (#187) Breaking Changes
* First draft of the new n-dimensional arrays + NB use case
* Improves default implementation of multiple Array methods
* Refactors tree methods
* Adds matrix decomposition routines
* Adds matrix decomposition methods to ndarray and nalgebra bindings
* Refactoring + linear regression now uses array2
* Ridge & Linear regression
* LBFGS optimizer & logistic regression
* LBFGS optimizer & logistic regression
* Changes linear methods, metrics and model selection methods to new n-dimensional arrays
* Switches KNN and clustering algorithms to new n-d array layer
* Refactors distance metrics
* Optimizes knn and clustering methods
* Refactors metrics module
* Switches decomposition methods to n-dimensional arrays
* Linalg refactoring - cleanup rng merge (#172)
* Remove legacy DenseMatrix and BaseMatrix implementation. Port the new Number, FloatNumber and Array implementation into module structure.
* Exclude AUC metrics. Needs reimplementation
* Improve developers walkthrough

New traits system in place at `src/numbers` and `src/linalg`
Co-authored-by: Lorenzo <tunedconsulting@gmail.com>

* Provide SupervisedEstimator with a constructor to avoid explicit dynamical box allocation in 'cross_validate' and 'cross_validate_predict' as required by the use of 'dyn' as per Rust 2021
* Implement getters to use as_ref() in src/neighbors
* Implement getters to use as_ref() in src/naive_bayes
* Implement getters to use as_ref() in src/linear
* Add Clone to src/naive_bayes
* Change signature for cross_validate and other model_selection functions to abide to use of dyn in Rust 2021
* Implement ndarray-bindings. Remove FloatNumber from implementations
* Drop nalgebra-bindings support (as decided in conf-call to go for ndarray)
* Remove benches. Benches will have their own repo at smartcore-benches
* Implement SVC
* Implement SVC serialization. Move search parameters in dedicated module
* Implement SVR. Definitely too slow
* Fix compilation issues for wasm (#202)

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
* Fix tests (#203)

* Port linalg/traits/stats.rs
* Improve methods naming
* Improve Display for DenseMatrix

Co-authored-by: Montana Low <montanalow@users.noreply.github.com>
Co-authored-by: VolodymyrOrlov <volodymyr.orlov@gmail.com>
2022-10-31 10:44:57 +00:00
Montana Low
764309e313 make default params available to serde (#167)
* add seed param to search params

* make default params available to serde

* lints

* create defaults for enums

* lint
2022-09-21 22:48:31 -04:00
Montana Low
48514d1b15 Complete grid search params (#166)
* grid search draft

* hyperparam search for linear estimators

* grid search for ensembles

* support grid search for more algos

* grid search for unsupervised algos

* minor cleanup
2022-09-21 20:34:21 +01:00
morenol
820201e920 Solve conflic with num-traits (#130)
* Solve conflic with num-traits

* Fix clippy warnings

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
2022-05-05 10:39:18 -04:00
Luis Moreno
0b3bf946df chore: fix clippy warnings 2021-06-05 01:41:40 -04:00
Luis Moreno
162bed2aa2 feat: added support to wasm (#94)
* test: run tests also in wasm targets

* fix: install rand with wasm-bindgen por wasm targets

* fix: use actual usize size to access buffer.

* fix: do not run functions that create files in wasm.

* test: do not run in wasm test that panics.

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
2021-04-28 15:58:39 -04:00
Luis Moreno
1b42f8a396 feat: Add getters for naive bayes structs (#74)
* feat: Add getters for GaussianNB

* Add classes getter to BernoulliNB

Add classes getter to CategoricalNB

Add classes getter to MultinomialNB

* Add feature_log_prob getter to MultinomialNB

* Add class_count to NB structs

* Add n_features getter for NB

* Add feature_count to MultinomialNB and BernoulliNB

* Add n_categories to CategoricalNB

* Implement feature_log_prob and category_count getter for CategoricalNB

* Implement feature_log_prob for BernoulliNB
2021-02-25 15:44:34 -04:00
Ben Cross
f1cf8a6f08 Added serde feature flags to tests 2021-01-18 10:32:35 +00:00
Ben Cross
762986b271 Cargo format 2021-01-17 21:37:30 +00:00
Ben Cross
e0d46f430b feat: Make SerDe optional 2021-01-17 21:35:03 +00:00
Volodymyr Orlov
810a5c429b feat: consolidates API 2020-12-24 18:36:23 -08:00
Volodymyr Orlov
d22be7d6ae fix: post-review changes 2020-12-24 13:47:09 -08:00
Volodymyr Orlov
dd341f4a12 feat: + builders for algorithm parameters 2020-12-23 12:29:39 -08:00
Volodymyr Orlov
a2be9e117f feat: + cross_validate, trait Predictor, refactoring 2020-12-22 15:41:53 -08:00
Luis Moreno
c9eb94ba93 Derive clone for NB Parameters 2020-12-18 00:39:54 -04:00
Volodymyr Orlov
5a185479a7 feat: NB documentation 2020-12-17 19:00:11 -08:00
morenol
9db993939e Add serde to CategoricalNB (#30)
* Add serde to CategoricalNB

* Implement PartialEq for CategoricalNBDistribution
2020-11-19 16:07:10 -04:00
morenol
72e9f8293f Use log likelihood to make calculations more stable (#28)
* Use log likelihood to make calculations more stable

* Fix problem with class_count in categoricalnb

* Use a similar approach to the one used in scikitlearn to define which are the possible categories of each feature.
2020-11-16 23:56:50 -04:00
morenol
3d4d5f64f6 feat: add Naive Bayes and CategoricalNB (#15)
* feat: Implement Naive Bayes classifier

* Implement CategoricalNB
2020-11-09 15:54:27 -04:00