Skip to content

Commit 23b3699

Browse files
committed
Release 0.3
1 parent aab3817 commit 23b3699

27 files changed

+83
-77
lines changed

.github/DEVELOPERS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Smartcore: Introduction to modules
1+
# smartcore: Introduction to modules
2+
3+
Important source of information:
4+
* [Rust API guidelines](https://rust-lang.github.io/api-guidelines/about.html)
25

36
## Walkthrough: traits system and basic structures
47

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [0.3] - 2022-11
88

99
## Added
10+
- WARNING: Breaking changes!
1011
- Seeds to multiple algorithims that depend on random number generation.
1112
- Added feature `js` to use WASM in browser
1213
- Drop `nalgebra-bindings` feature
13-
- Complete refactoring with *extensive API changes* that includes:
14+
- Complete refactoring with **extensive API changes** that includes:
1415
* moving to a new traits system, less structs more traits
1516
* adapting all the modules to the new traits system
1617
* moving towards Rust 2021, in particular the use of `dyn` and `as_ref`
@@ -19,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1920
## BREAKING CHANGE
2021
- Added a new parameter to `train_test_split` to define the seed.
2122

22-
## [0.2.1] - 2022-05-10
23+
## [0.2.1] - 2021-05-10
2324

2425
## Added
2526
- L2 regularization penalty to the Logistic Regression

Cargo.toml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
[package]
22
name = "smartcore"
3-
description = "The most advanced machine learning library in rust."
3+
description = "Machine Learning in Rust."
44
homepage = "https://smartcorelib.org"
5-
version = "0.4.0"
6-
authors = ["SmartCore Developers"]
5+
version = "0.3.0"
6+
authors = ["smartcore Developers"]
77
edition = "2021"
88
license = "Apache-2.0"
99
documentation = "https://docs.rs/smartcore"
1010
repository = "https://github.com/smartcorelib/smartcore"
1111
readme = "README.md"
1212
keywords = ["machine-learning", "statistical", "ai", "optimization", "linear-algebra"]
1313
categories = ["science"]
14+
exclude = [
15+
".github",
16+
".gitignore",
17+
"smartcore.iml",
18+
"smartcore.svg",
19+
]
1420

1521
[dependencies]
1622
approx = "0.5.1"
@@ -23,10 +29,10 @@ rand_distr = { version = "0.4", optional = true }
2329
serde = { version = "1", features = ["derive"], optional = true }
2430

2531
[features]
26-
default = ["serde", "datasets"]
32+
default = []
2733
serde = ["dep:serde"]
2834
ndarray-bindings = ["dep:ndarray"]
29-
datasets = ["dep:rand_distr", "std"]
35+
datasets = ["dep:rand_distr", "std", "serde"]
3036
std = ["rand/std_rng", "rand/std"]
3137
# wasm32 only
3238
js = ["getrandom/js"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2019-present at SmartCore developers (smartcorelib.org)
189+
Copyright 2019-present at smartcore developers (smartcorelib.org)
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://smartcorelib.org">
3-
<img src="smartcore.svg" width="450" alt="SmartCore">
3+
<img src="smartcore.svg" width="450" alt="smartcore">
44
</a>
55
</p>
66
<p align = "center">
@@ -18,4 +18,4 @@
1818
-----
1919
[![CI](https://github.com/smartcorelib/smartcore/actions/workflows/ci.yml/badge.svg)](https://github.com/smartcorelib/smartcore/actions/workflows/ci.yml)
2020

21-
To start getting familiar with the new Smartcore v0.5 API, there is now available a [**Jupyter Notebook environment repository**](https://github.com/smartcorelib/smartcore-jupyter). Please see instructions there, contributions welcome see [CONTRIBUTING](.github/CONTRIBUTING.md).
21+
To start getting familiar with the new smartcore v0.5 API, there is now available a [**Jupyter Notebook environment repository**](https://github.com/smartcorelib/smartcore-jupyter). Please see instructions there, contributions welcome see [CONTRIBUTING](.github/CONTRIBUTING.md).

smartcore.svg

Lines changed: 1 addition & 1 deletion
Loading

src/algorithm/neighbour/cover_tree.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct Node {
6464
max_dist: f64,
6565
parent_dist: f64,
6666
children: Vec<Node>,
67-
scale: i64,
67+
_scale: i64,
6868
}
6969

7070
#[derive(Debug)]
@@ -84,7 +84,7 @@ impl<T: Debug + PartialEq, D: Distance<T>> CoverTree<T, D> {
8484
max_dist: 0f64,
8585
parent_dist: 0f64,
8686
children: Vec::new(),
87-
scale: 0,
87+
_scale: 0,
8888
};
8989
let mut tree = CoverTree {
9090
base,
@@ -245,7 +245,7 @@ impl<T: Debug + PartialEq, D: Distance<T>> CoverTree<T, D> {
245245
max_dist: 0f64,
246246
parent_dist: 0f64,
247247
children: Vec::new(),
248-
scale: 100,
248+
_scale: 100,
249249
}
250250
}
251251

@@ -306,7 +306,7 @@ impl<T: Debug + PartialEq, D: Distance<T>> CoverTree<T, D> {
306306
max_dist: 0f64,
307307
parent_dist: 0f64,
308308
children,
309-
scale: 100,
309+
_scale: 100,
310310
}
311311
} else {
312312
let mut far: Vec<DistanceSet> = Vec::new();
@@ -375,7 +375,7 @@ impl<T: Debug + PartialEq, D: Distance<T>> CoverTree<T, D> {
375375
max_dist: self.max(consumed_set),
376376
parent_dist: 0f64,
377377
children,
378-
scale: (top_scale - max_scale),
378+
_scale: (top_scale - max_scale),
379379
}
380380
}
381381
}

src/cluster/kmeans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! these re-calculated centroids becoming the new centers of their respective clusters. Next all instances of the training set are re-assigned to their closest cluster again.
1212
//! This iterative process continues until convergence is achieved and the clusters are considered settled.
1313
//!
14-
//! Initial choice of K data points is very important and has big effect on performance of the algorithm. SmartCore uses k-means++ algorithm to initialize cluster centers.
14+
//! Initial choice of K data points is very important and has big effect on performance of the algorithm. smartcore uses k-means++ algorithm to initialize cluster centers.
1515
//!
1616
//! Example:
1717
//!
@@ -74,7 +74,7 @@ pub struct KMeans<TX: Number, TY: Number, X: Array2<TX>, Y: Array1<TY>> {
7474
k: usize,
7575
_y: Vec<usize>,
7676
size: Vec<usize>,
77-
distortion: f64,
77+
_distortion: f64,
7878
centroids: Vec<Vec<f64>>,
7979
_phantom_tx: PhantomData<TX>,
8080
_phantom_ty: PhantomData<TY>,
@@ -313,7 +313,7 @@ impl<TX: Number, TY: Number, X: Array2<TX>, Y: Array1<TY>> KMeans<TX, TY, X, Y>
313313
k: parameters.k,
314314
_y: y,
315315
size,
316-
distortion,
316+
_distortion: distortion,
317317
centroids,
318318
_phantom_tx: PhantomData,
319319
_phantom_ty: PhantomData,

src/dataset/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Datasets
22
//!
3-
//! In this module you will find small datasets that are used in SmartCore mostly for demonstration purposes.
3+
//! In this module you will find small datasets that are used in smartcore mostly for demonstration purposes.
44
pub mod boston;
55
pub mod breast_cancer;
66
pub mod diabetes;

src/ensemble/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! set and then aggregate their individual predictions to form a final prediction. In classification setting the overall prediction is the most commonly
88
//! occurring majority class among the individual predictions.
99
//!
10-
//! In SmartCore you will find implementation of RandomForest - a popular averaging algorithms based on randomized [decision trees](../tree/index.html).
10+
//! In smartcore you will find implementation of RandomForest - a popular averaging algorithms based on randomized [decision trees](../tree/index.html).
1111
//! Random forests provide an improvement over bagged trees by way of a small tweak that decorrelates the trees. As in bagging, we build a number of
1212
//! decision trees on bootstrapped training samples. But when building these decision trees, each time a split in a tree is considered,
1313
//! a random sample of _m_ predictors is chosen as split candidates from the full set of _p_ predictors.

0 commit comments

Comments
 (0)