Skip to content

Commit

Permalink
Add website to infrastructure (#87)
Browse files Browse the repository at this point in the history
* Move all crates into `algorithms`, add website

* Disable github actions for drafts

* Fix workspace paths pointing to subfolders

* Add front page and zola workflow

* Add name to website workflow

* Run and deploy on all branches

* Add workflow exclude non forks

* Bundle stylesheets into a single file

* Use relative links in the header

* Try influence of `get_url`

* Add relative links to items

* Use https in `get_url`

* Use relative url in link as well

* Add release news and pages with content

* Add news about new website

* Add snippets for front-page

 * use section infrastructure for automatic highlighting
 * the trait constraint in `src/metrics_regression.rs` is relaxed

* Add workflow for rustdoc generation

* Add rustdoc job to zola build&deploy

* Don't upload all target artifacts

* Don't use wildcards in copy operation

* Wordings and correct rustdoc link

* Add initial support for smaller devices

* Improve SASS files of mobile website

* Scale title for mobile devices

* Improve website for mobile devices

* Fix compile errors

* Rename website workflow to docs

* Some wordings

* Avoid expansive cross-validation in tests

* Suppress warning for PCC in `linfa-datasets`

* Address answers in PR

 * link website in README
 * make table horizontally scrollable in mobile version
 * update elasticnet example
 * update `base_url` link in configuration

* Update announcement

* Remove PCC tests until we have fixed seed
  • Loading branch information
bytesnake authored Mar 8, 2021
1 parent d0363a1 commit c8acc78
Show file tree
Hide file tree
Showing 159 changed files with 1,879 additions and 63 deletions.
1 change: 1 addition & 0 deletions .github/workflows/checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
check:
name: check
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
strategy:
matrix:
toolchain:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
on: [push, pull_request]


name: Codequality Lints

jobs:
codequality:
name: codequality
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
strategy:
matrix:
toolchain:
Expand Down Expand Up @@ -41,6 +43,7 @@ jobs:
coverage:
name: coverage
runs-on: ubuntu-18.04
if: github.event.pull_request.draft == false
container:
image: rustmath/mkl-rust:1.43.0
options: --security-opt seccomp=unconfined
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# build and deploy on master push, otherwise just try to build the page
on:
push:
branches:
- master
pull_request:

name: Build website with Zola, build rust docs and publish to GH pages

jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master' && github.repository == 'rust-ml/linfa'
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Build only'
uses: shalzz/zola-deploy-action@master
env:
BUILD_DIR: docs/website/
TOKEN: ${{ secrets.TOKEN }}
BUILD_ONLY: true

build_and_deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.repository != 'rust-ml/linfa'
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, rust-src

- name: Build Documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps

- name: Copy Rust Documentation to Zola
run: cp -R "target/doc/" "docs/website/static/rustdocs/"

- name: 'Build and deploy'
uses: shalzz/zola-deploy-action@master
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: docs/website/
TOKEN: ${{ secrets.TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
testing:
name: testing
runs-on: ubuntu-18.04
if: github.event.pull_request.draft == false
container:
image: rustmath/mkl-rust:1.43.0
options: --security-opt seccomp=unconfined
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ poetry.lock
*.ipynb

*.json

# Generated artifacts of website (with Zola)
docs/website/public/*
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ linfa-datasets = { version = "0.3.0", path = "datasets", features = ["winequalit

[workspace]
members = [
"linfa-clustering",
"linfa-reduction",
"linfa-kernel",
"linfa-linear",
"linfa-logistic",
"linfa-trees",
"linfa-svm",
"linfa-hierarchical",
"linfa-ica",
"linfa-bayes",
"linfa-elasticnet",
"algorithms/linfa-clustering",
"algorithms/linfa-reduction",
"algorithms/linfa-kernel",
"algorithms/linfa-linear",
"algorithms/linfa-logistic",
"algorithms/linfa-trees",
"algorithms/linfa-svm",
"algorithms/linfa-hierarchical",
"algorithms/linfa-ica",
"algorithms/linfa-bayes",
"algorithms/linfa-elasticnet",
"datasets",
]

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

[![crates.io](https://img.shields.io/crates/v/linfa.svg)](https://crates.io/crates/linfa)
[![Documentation](https://docs.rs/linfa/badge.svg)](https://docs.rs/linfa)
[![DocumentationLatest](https://img.shields.io/badge/docs-latest-blue)](https://rust-ml.github.com/linfa/rustdocs/linfa/)
[![Codequality](https://github.com/rust-ml/linfa/workflows/Codequality%20Lints/badge.svg)](https://github.com/rust-ml/linfa/actions?query=workflow%3A%22Codequality+Lints%22)
[![Run Tests](https://github.com/rust-ml/linfa/workflows/Run%20Tests/badge.svg)](https://github.com/rust-ml/linfa/actions?query=workflow%3A%22Run+Tests%22)

<strong>
<a href="https://rust-ml.github.io/linfa/">Website</a> | <a href="https://rust-ml.zulipchat.com">Community chat</a>
</strong>

> _**linfa**_ (Italian) / _**sap**_ (English):
>
> The **vital** circulating fluid of a plant.
Expand All @@ -16,9 +21,6 @@

Kin in spirit to Python's `scikit-learn`, it focuses on common preprocessing tasks and classical ML algorithms for your everyday ML tasks.

_Documentation_: [latest](https://docs.rs/linfa)
_Community chat_: [Zulip](https://rust-ml.zulipchat.com/)

## Current state

Where does `linfa` stand right now? [Are we learning yet?](http://www.arewelearningyet.com/)
Expand Down
5 changes: 2 additions & 3 deletions linfa-bayes/Cargo.toml → algorithms/linfa-bayes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ ndarray = { version = "0.13" , features = ["blas", "approx"]}
ndarray-stats = "0.3"
thiserror = "1"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }

[dev-dependencies]
approx = "0.3"
linfa = { version = "0.3.0", path = ".." }
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["winequality"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["winequality"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sprs = "0.7"
num-traits = "0.1.32"
rand_isaac = "0.2.0"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }
partitions = "0.2.4"

[dev-dependencies]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ num-traits = "0.2"
approx = "0.3.2"
thiserror = "1"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }

[dev-dependencies]
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["diabetes"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["diabetes"] }
ndarray-rand = "0.11"
rand_isaac = "0.2"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fn main() -> Result<()> {

// train pure LASSO model with 0.1 penalty
let model = ElasticNet::params()
.penalty(0.1)
.penalty(0.3)
.l1_ratio(1.0)
.fit(&train)?;

Expand All @@ -18,7 +18,7 @@ fn main() -> Result<()> {

// validate
let y_est = model.predict(&valid);
println!("predicted variance: {}", valid.r2(&y_est).unwrap());
println!("predicted variance: {}", valid.r2(&y_est)?);

Ok(())
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ categories = ["algorithms", "mathematics", "science"]
ndarray = { version = "0.13", default-features = false }
kodama = "0.2"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }
linfa-kernel = { version = "0.3.0", path = "../linfa-kernel" }

[dev-dependencies]
rand = "0.7"
ndarray-rand = "0.11"
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["iris"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["iris"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion linfa-ica/Cargo.toml → algorithms/linfa-ica/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ndarray-stats = "0.3"
num-traits = "0.2"
rand_isaac = "0.2.0"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }

[dev-dependencies]
ndarray-npy = { version = "0.5", default-features = false }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ sprs = { version = "0.9.3", default-features = false }
hnsw = "0.6"
space = "0.10"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ argmin = {version="0.3.1", features=["ndarrayl"]}
serde = { version = "1.0", default-features = false, features = ["derive"] }
thiserror = "1"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }

[dev-dependencies]
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["diabetes"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["diabetes"] }
approx = "0.3.2"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ num-traits = "0.2"
argmin = {version="0.3.1", features=["ndarrayl"]}
serde = "1.0"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }

[dev-dependencies]
approx = "0.3.2"
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["winequality"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["winequality"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ ndarray-linalg = "0.12"
ndarray-rand = "0.11"
num-traits = "0.2"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }
linfa-kernel = { version = "0.3.0", path = "../linfa-kernel" }

[dev-dependencies]
rand = { version = "0.7", features = ["small_rng"] }
ndarray-npy = { version = "0.5", default-features = false }
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["iris"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["iris"] }
approx = { version = "0.3", default-features = false, features = ["std"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions linfa-svm/Cargo.toml → algorithms/linfa-svm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ ndarray-rand = "0.11"
num-traits = "0.1.32"
thiserror = "1"

linfa = { version = "0.3.0", path = ".." }
linfa = { version = "0.3.0", path = "../.." }
linfa-kernel = { version = "0.3.0", path = "../linfa-kernel" }

[dev-dependencies]
linfa-datasets = { version = "0.3.0", path = "../datasets", features = ["winequality", "diabetes"] }
linfa-datasets = { version = "0.3.0", path = "../../datasets", features = ["winequality", "diabetes"] }
rand_isaac = "0.2"
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c8acc78

Please sign in to comment.