Fanova
A Rust implementation of fANOVA (functional analysis of variance)
Install / Use
/learn @sile/FanovaREADME
fanova
A Rust fANOVA (functional analysis of variance) implementation.
fANOVA provides a way to calculate feature importance.
Examples
use fanova::{FanovaOptions, RandomForestOptions};
use rand::{Rng, SeedableRng};
let mut feature1 = Vec::new();
let mut feature2 = Vec::new();
let mut feature3 = Vec::new();
let mut target = Vec::new();
let mut rng = rand::rngs::StdRng::seed_from_u64(0);
for _ in 0..100 {
let f1 = rng.gen();
let f2 = rng.gen();
let f3 = rng.gen();
let t = f1 + f2 * 2.0 + f3 * 3.0;
feature1.push(f1);
feature2.push(f2);
feature3.push(f3);
target.push(t);
}
let mut fanova = FanovaOptions::new()
.random_forest(RandomForestOptions::new().seed(0))
.fit(vec![&feature1, &feature2, &feature3], &target).unwrap();
let importances = (0..3)
.map(|i| fanova.quantify_importance(&[i]).mean)
.collect::<Vec<_>>();
assert_eq!(
importances,
vec![0.02744461966313835, 0.22991883769286145, 0.6288784011550144]
);
References
Related Skills
node-connect
352.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
