use numpy::{PyArray1, PyReadonlyArray2};
use pyo3::prelude::*;
#[pyclass(name = "KMeans")]
pub struct PyKMeans {
n_clusters: usize,
}
#[pymethods]
impl PyKMeans {
#[new]
fn new(n_clusters: usize) -> Self {
Self { n_clusters }
}
fn fit(&mut self, _x: PyReadonlyArray2<f64>) -> PyResult<()> {
let _clusters = self.n_clusters;
Ok(())
}
fn predict(&self, _x: PyReadonlyArray2<f64>, py: Python<'_>) -> PyResult<Py<PyArray1<i32>>> {
Ok(PyArray1::from_vec(py, vec![0i32]).unbind())
}
}
#[pyclass(name = "DBSCAN")]
pub struct PyDBSCAN {
eps: f64,
}
#[pymethods]
impl PyDBSCAN {
#[new]
fn new(eps: f64) -> Self {
Self { eps }
}
fn fit(&mut self, _x: PyReadonlyArray2<f64>) -> PyResult<()> {
let _epsilon = self.eps;
Ok(())
}
fn predict(&self, _x: PyReadonlyArray2<f64>, py: Python<'_>) -> PyResult<Py<PyArray1<i32>>> {
Ok(PyArray1::from_vec(py, vec![0i32]).unbind())
}
}