Skip to content

Commit 70df9a8

Browse files
authored
Merge pull request #133 from smartcorelib/release-0.2.1
Release 0.2.1
2 parents 051023e + 7ea620e commit 70df9a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2421
-421
lines changed

.circleci/config.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: rand_distr
10+
versions:
11+
- 0.4.0

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, development ]
6+
pull_request:
7+
branches: [ development ]
8+
9+
jobs:
10+
tests:
11+
runs-on: "${{ matrix.platform.os }}-latest"
12+
strategy:
13+
matrix:
14+
platform: [
15+
{ os: "windows", target: "x86_64-pc-windows-msvc" },
16+
{ os: "windows", target: "i686-pc-windows-msvc" },
17+
{ os: "ubuntu", target: "x86_64-unknown-linux-gnu" },
18+
{ os: "ubuntu", target: "i686-unknown-linux-gnu" },
19+
{ os: "ubuntu", target: "wasm32-unknown-unknown" },
20+
{ os: "macos", target: "aarch64-apple-darwin" },
21+
]
22+
env:
23+
TZ: "/usr/share/zoneinfo/your/location"
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Cache .cargo and target
27+
uses: actions/cache@v2
28+
with:
29+
path: |
30+
~/.cargo
31+
./target
32+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
33+
restore-keys: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
34+
- name: Install Rust toolchain
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
toolchain: stable
38+
target: ${{ matrix.platform.target }}
39+
profile: minimal
40+
default: true
41+
- name: Install test runner for wasm
42+
if: matrix.platform.target == 'wasm32-unknown-unknown'
43+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
44+
- name: Stable Build
45+
uses: actions-rs/cargo@v1
46+
with:
47+
command: build
48+
args: --all-features --target ${{ matrix.platform.target }}
49+
- name: Tests
50+
if: matrix.platform.target == 'x86_64-unknown-linux-gnu' || matrix.platform.target == 'x86_64-pc-windows-msvc' || matrix.platform.target == 'aarch64-apple-darwin'
51+
uses: actions-rs/cargo@v1
52+
with:
53+
command: test
54+
args: --all-features
55+
- name: Tests in WASM
56+
if: matrix.platform.target == 'wasm32-unknown-unknown'
57+
run: wasm-pack test --node -- --all-features

.github/workflows/coverage.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ main, development ]
6+
pull_request:
7+
branches: [ development ]
8+
9+
jobs:
10+
coverage:
11+
runs-on: ubuntu-latest
12+
env:
13+
TZ: "/usr/share/zoneinfo/your/location"
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Cache .cargo
17+
uses: actions/cache@v2
18+
with:
19+
path: |
20+
~/.cargo
21+
./target
22+
key: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.toml') }}
23+
restore-keys: ${{ runner.os }}-coverage-cargo-${{ hashFiles('**/Cargo.toml') }}
24+
- name: Install Rust toolchain
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: nightly
28+
profile: minimal
29+
default: true
30+
- name: Install cargo-tarpaulin
31+
uses: actions-rs/install@v0.1
32+
with:
33+
crate: cargo-tarpaulin
34+
version: latest
35+
use-tool-cache: true
36+
- name: Run cargo-tarpaulin
37+
uses: actions-rs/cargo@v1
38+
with:
39+
command: tarpaulin
40+
args: --out Lcov --all-features -- --test-threads 1
41+
- name: Upload to codecov.io
42+
uses: codecov/codecov-action@v1
43+
with:
44+
fail_ci_if_error: true

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Lint checks
2+
3+
on:
4+
push:
5+
branches: [ main, development ]
6+
pull_request:
7+
branches: [ development ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
env:
13+
TZ: "/usr/share/zoneinfo/your/location"
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Cache .cargo and target
17+
uses: actions/cache@v2
18+
with:
19+
path: |
20+
~/.cargo
21+
./target
22+
key: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }}
23+
restore-keys: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }}
24+
- name: Install Rust toolchain
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
profile: minimal
29+
default: true
30+
- run: rustup component add rustfmt
31+
- name: Check formt
32+
uses: actions-rs/cargo@v1
33+
with:
34+
command: fmt
35+
args: --all -- --check
36+
- run: rustup component add clippy
37+
- name: Run clippy
38+
uses: actions-rs/cargo@v1
39+
with:
40+
command: clippy
41+
args: --all-features -- -Drust-2018-idioms -Dwarnings

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
## Added
10+
- L2 regularization penalty to the Logistic Regression
11+
- Getters for the naive bayes structs
12+
- One hot encoder
13+
- Make moons data generator
14+
- Support for WASM.
15+
16+
## Changed
17+
- Make serde optional
18+
19+
## [0.2.0] - 2021-01-03
20+
21+
### Added
22+
- DBSCAN
23+
- Epsilon-SVR, SVC
24+
- Ridge, Lasso, ElasticNet
25+
- Bernoulli, Gaussian, Categorical and Multinomial Naive Bayes
26+
- K-fold Cross Validation
27+
- Singular value decomposition
28+
- New api module
29+
- Integration with Clippy
30+
- Cholesky decomposition
31+
32+
### Changed
33+
- ndarray upgraded to 0.14
34+
- smartcore::error:FailedError is now non-exhaustive
35+
- K-Means
36+
- PCA
37+
- Random Forest
38+
- Linear and Logistic Regression
39+
- KNN
40+
- Decision Tree
41+
42+
## [0.1.0] - 2020-09-25
43+
44+
### Added
45+
- First release of smartcore.
46+
- KNN + distance metrics (Euclidian, Minkowski, Manhattan, Hamming, Mahalanobis)
47+
- Linear Regression (OLS)
48+
- Logistic Regression
49+
- Random Forest Classifier
50+
- Decision Tree Classifier
51+
- PCA
52+
- K-Means
53+
- Integrated with ndarray
54+
- Abstract linear algebra methods
55+
- RandomForest Regressor
56+
- Decision Tree Regressor
57+
- Serde integration
58+
- Integrated with nalgebra
59+
- LU, QR, SVD, EVD
60+
- Evaluation Metrics

Cargo.toml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "smartcore"
33
description = "The most advanced machine learning library in rust."
44
homepage = "https://smartcorelib.org"
5-
version = "0.2.0"
5+
version = "0.2.1"
66
authors = ["SmartCore Developers"]
77
edition = "2018"
88
license = "Apache-2.0"
@@ -19,20 +19,25 @@ nalgebra-bindings = ["nalgebra"]
1919
datasets = []
2020

2121
[dependencies]
22-
ndarray = { version = "0.14", optional = true }
22+
ndarray = { version = "0.15", optional = true }
2323
nalgebra = { version = "0.23.0", optional = true }
2424
num-traits = "0.2.12"
25-
num = "0.3.0"
26-
rand = "0.7.3"
27-
rand_distr = "0.3.0"
28-
serde = { version = "1.0.115", features = ["derive"] }
29-
serde_derive = "1.0.115"
25+
num = "0.4.0"
26+
rand = "0.8.3"
27+
rand_distr = "0.4.0"
28+
serde = { version = "1.0.115", features = ["derive"], optional = true }
29+
30+
[target.'cfg(target_arch = "wasm32")'.dependencies]
31+
getrandom = { version = "0.2", features = ["js"] }
3032

3133
[dev-dependencies]
3234
criterion = "0.3"
3335
serde_json = "1.0"
3436
bincode = "1.3.1"
3537

38+
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
39+
wasm-bindgen-test = "0.3"
40+
3641
[[bench]]
3742
name = "distance"
3843
harness = false

smartcore.svg

Lines changed: 3 additions & 3 deletions
Loading

src/algorithm/neighbour/bbd_tree.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ mod tests {
314314
use super::*;
315315
use crate::linalg::naive::dense_matrix::DenseMatrix;
316316

317+
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
317318
#[test]
318319
fn bbdtree_iris() {
319320
let data = DenseMatrix::from_2d_array(&[

0 commit comments

Comments
 (0)