Commit Graph

42 Commits

Author SHA1 Message Date
Lorenzo
c45bab491a 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-08 11:29:56 -05:00
Lorenzo
a7fa0585eb 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-11-08 11:29:56 -05:00
Christos Katsakioris
01f753f86d Add serde for StandardScaler (#148)
* Derive `serde::Serialize` and `serde::Deserialize` for
  `StandardScaler`.
* Add relevant unit test.

Signed-off-by: Christos Katsakioris <ckatsak@gmail.com>

Signed-off-by: Christos Katsakioris <ckatsak@gmail.com>
2022-11-08 11:29:56 -05:00
Tim Toebrock
df766eaf79 Implementation of Standard scaler (#143)
* docs: Fix typo in doc for categorical transformer.
* feat: Add option to take a column from Matrix.
I created the method `Matrix::take_column` that uses the `Matrix::take`-interface to extract a single column from a matrix. I need that feature in the implementation of  `StandardScaler`.
* feat: Add `StandardScaler`.
Authored-by: titoeb <timtoebrock@googlemail.com>
2022-11-08 11:29:56 -05: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
gaxler
6b5bed6092 remove old 2021-02-09 22:01:59 -08:00
gaxler
af6ec2d402 rename categorical 2021-02-09 22:01:34 -08:00
gaxler
828df4e338 Use CategoryMapper to transform an iterator. No more passing iterator to SeriesEncoders 2021-02-03 13:42:27 -08:00
gaxler
374dfeceb9 No more SeriesEncoders. 2021-02-03 13:41:25 -08:00
gaxler
3cc20fd400 Move all functionality to CategoryMapper (one-hot and ordinal). 2021-02-03 13:39:26 -08:00
gaxler
700d320724 simplify SeriesEncoder trait 2021-02-03 10:45:25 -08:00
gaxler
ef06f45638 Switch to use SeriesEncoder trait 2021-02-02 18:21:06 -08:00
gaxler
237b1160b1 doc update 2021-02-02 18:20:27 -08:00
gaxler
d31145b4fe Define common series encoder behavior 2021-02-02 18:19:36 -08:00
gaxler
19ff6df84c Separate mapper object 2021-02-02 17:40:58 -08:00
gaxler
228b54baf7 fmt 2021-02-01 11:24:50 -08:00
gaxler
03b9f76e9f Doc+Naming Improvement 2021-02-01 11:24:20 -08:00
gaxler
a882741e12 If transform fails - fail before copying the whole matrix
(changed the order of coping, first do the categorical, than copy ther rest)
2021-02-01 11:20:03 -08:00
gaxler
f4b5936dcf fmt 2021-01-30 20:18:52 -08:00
gaxler
863be5ef75 style fixes 2021-01-30 20:09:52 -08:00
gaxler
ca0816db97 Clippy fixes 2021-01-30 19:55:04 -08:00
gaxler
2f03c1d6d7 module name change 2021-01-30 19:54:42 -08:00
gaxler
c987d39d43 tests + force Categorizable be RealNumber 2021-01-30 19:31:09 -08:00
gaxler
fd6b2e8014 Transform matrix 2021-01-30 19:29:58 -08:00
gaxler
cd5611079c Fit OneHotEncoder 2021-01-30 19:29:33 -08:00
gaxler
dd39433ff8 Categorizable trait defines logic of turning floats into hashable categorical variables. Since we only support RealNumbers for now, the idea is to treat round numbers as ordinal (or nominal if user chooses to ignore order) categories. 2021-01-30 18:48:23 -08:00
gaxler
3dc8a42832 Adapt column numbers to the new columns introduced by categorical variables. 2021-01-30 16:05:45 -08:00
gaxler
3480e728af Documentation updates 2021-01-30 16:04:41 -08:00
gaxler
f91b1f9942 fit SeriesOneHotEncoders to predefined columns 2021-01-27 19:37:54 -08:00
gaxler
5c400f40d2 Scaffold for turniing floats to hashable and fittinng to columns 2021-01-27 19:36:38 -08:00
gaxler
408b97d8aa Rename series encoder and move to separate module file 2021-01-27 19:31:14 -08:00
gaxler
6109fc5211 Renaming fit/transform for API compatibility. Also rename label to category. 2021-01-27 12:13:45 -08:00
gaxler
19088b682a remoe LabelDefinition, looks like unnecesery abstraction for now 2021-01-27 12:06:43 -08:00
gaxler
244a724445 Genertic make_one_hot. Current implementation returns BaseVector of RealNumber 2021-01-27 12:03:13 -08:00
gaxler
9833a2f851 codecov-fix 2021-01-26 10:03:33 -08:00
gaxler
7daf536aeb fixed docs 2021-01-26 09:15:24 -08:00
gaxler
0df797cbae fmt fix 2021-01-26 00:04:15 -08:00
gaxler
139bbae456 cliipy fixes 2021-01-26 00:01:20 -08:00
gaxler
dbca6d43ce fmt fix 2021-01-25 23:55:43 -08:00
gaxler
991631876e build one-hot encoder 2021-01-25 23:33:48 -08:00