{"id":21662774,"url":"https://github.com/soleinik/test-ml","last_synced_at":"2025-03-20T05:48:50.947Z","repository":{"id":224011494,"uuid":"741132665","full_name":"soleinik/test-ml","owner":"soleinik","description":"Rust, ML, trading...","archived":false,"fork":false,"pushed_at":"2024-02-25T23:18:27.000Z","size":127,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T07:27:34.275Z","etag":null,"topics":["clap-rs","linfa","ndarray","polars","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soleinik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-09T19:04:42.000Z","updated_at":"2024-03-31T19:48:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6d95bb6-887f-4728-9348-a495d2326116","html_url":"https://github.com/soleinik/test-ml","commit_stats":null,"previous_names":["soleinik/test-ml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soleinik%2Ftest-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soleinik%2Ftest-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soleinik%2Ftest-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soleinik%2Ftest-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soleinik","download_url":"https://codeload.github.com/soleinik/test-ml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244560373,"owners_count":20472219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clap-rs","linfa","ndarray","polars","rust","rust-lang"],"created_at":"2024-11-25T10:18:01.302Z","updated_at":"2025-03-20T05:48:50.930Z","avatar_url":"https://github.com/soleinik.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Machine Learning test project\n\n## About\nThe project's goal is to implement start to end file load with [polars](https://crates.io/crates/polars) and use [linfa](https://crates.io/crates/linfa) crates to learn and predict financial time series data, with [ndarray](https://crates.io/crates/ndarray) in between.\nProject is build from two parts [CLI](/ml-cli/) and [library](/ml-lib/). For now [data](/data/) is in local folder that shoud be substituted, in future, with a financial data fetching API (i.e. [yahoo_finance_api](https://crates.io/crates/yahoo_finance_api))\n\n\n## Status\nWork-in-progress. At this moment only (list what is implemented) \n\nCurrently, only the following Linfa's algorithms implemented\n- decision tree (`random forest`???), flags `-Ccdr`\n- SVM (upport vector machines), flags `-Ccss`\n\n\n  works, that can be invoked as follows\n```\n$ ./target/debug/ml-cli -Ccdr -h\n[r]andom forest learning algorithm\n\nUsage: ml-cli AlgoCategory SL DT {RF|-r}\n\nOptions:\n  -h, --help  Print help (see more with '--help')\n```\nactual run\n```\n./target/debug/ml-cli -Ccdr\naccuracy:1\npredicted:[1, 1, 1]\n```\n\nProgam will use time series data from [IBM, 5 years](./data/IBM-5y.csv) as base, [S\u0026P500, 5 years](./data/^GSPC-5y.csv) as suplementary and attempt to learn and predict closing price trend for next 3 days.\n\nNOTE: the goal is not actually make correct prediction, rather understand `polars`, `ndarray` and `linfa` interaction \n\n\n## Compiling from source code (via git)\n\n`test-ml` can be compiled directly from the git repository source code using the following method.\n\n\n```\n$ git clone https://github.com/soleinik/test-ml.git \u0026\u0026 cd test-ml\n[...]\n$ cargo build --release\n```\n\nIf successful, this will produce a `ml-cli` executable located at `./target/release/ml-cli`\n\nExecutable (for now) expects `./data` folder to be available relative to execution root `.`\n\n## Running:\n\n### `Cargo`\n```\n$ cargo run -- -h\n\nDemo CLI wrapper\n\nUsage: ml-cli [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  AlgoCategory, -C  Algorithm's [C]ategory\n  help              Print this message or the help of the given subcommand(s)\n\nOptions:\n  -v, --verbosity...  log level\n  -h, --help          Print help (see more with '--help')\n  -V, --version       Print version\n\n```\nand follow help prompts... `help` is context sencitive. The above snippet demonstrates generic help prompt. The following snippet demonstrates help items for `Algorithm's category` \n\n```\n$ cargo run -- -C -h\nAlgorithm's [C]ategory\n\nUsage: ml-cli {AlgoCategory|-C} \u003cCOMMAND\u003e\n\nCommands:\n  SL, -c             [s]upervised learning algorithms class\n  USL, -u            [u]nSupervised learning algorithm class\n  partial-fit, -f    Partial [f]it ML algorithms class\n  pre-processor, -p  [p]re Processors ML algorithms class\n  help               Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help  Print help\n\n```\n### Executable `ml-cli`\nWhen successfuly built, executable will be located in either `./target/debug` or `./target/release` folder, depends on `--debug`(default) or `--release` flag passed to `cargo build`. Move executable `ml-cli` together with `./data/*` forder into same location. After that invoke it as follows\n\n```\n$ ./ml-cli -h\nDemo CLI wrapper\n\nUsage: ml-cli [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  AlgoCategory, -C  Algorithm's [C]ategory\n  help              Print this message or the help of the given subcommand(s)\n\nOptions:\n  -v, --verbosity...  log level\n  -h, --help          Print help (see more with '--help')\n  -V, --version       Print version\n```\n\n\n\n## Development pre-requisites\n\nTo _build \u0026 run_ this project you need to have the following installed on your system:\n\n- Install **Rust** (latest stable) – [How to install Rust](https://www.rust-lang.org/en-US/install.html)\n- Install **rustfmt**: `rustup component add rustfmt`\n- Install **clippy**: `rustup component add clippy`\n\n\n### Format checking (rustfmt)\n\nMake sure your code is well-formatted by running:\n\n```\ncargo fmt\n```\n\n### Lint (clippy)\n\nLint your code (i.e. check it for common issues) with:\n\n```\ncargo clippy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoleinik%2Ftest-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoleinik%2Ftest-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoleinik%2Ftest-ml/lists"}