From 1345cf13634acf2cba579434feec1e3096c87ddc Mon Sep 17 00:00:00 2001 From: Franck Albinet Date: Thu, 23 Jan 2025 16:53:11 +0100 Subject: [PATCH] update readme --- README.md | 101 +++++++++++++++++++++++++++--------------------- nbs/index.ipynb | 72 +++++++++++++++++++--------------- nbs/sidebar.yml | 1 + 3 files changed, 99 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 1b97839..97ff8cf 100644 --- a/README.md +++ b/README.md @@ -3,47 +3,14 @@ -> A Python package providing scikit-learn compatible transforms for -> spectroscopic data preprocessing. +> Spectral Processing Tools for Soil Spectroscopy -It’s designed to work seamlessly with both MIR (Mid-Infrared) and VISNIR -(Visible-Near Infrared) spectral data. - -**WORK IN PROGRESS** - -## Installation - -``` bash -pip install soilspectfm -``` - -## Quick Start - -``` python -from soilspectfm.core import (SNV, - TakeDerivative, - ToAbsorbance, - Resample, - WaveletDenoise) - -from sklearn.pipeline import Pipeline -``` - -### Loading OSSL dataset - -Let’s use OSSL dataset as an example using -[SoilSpecData](https://fr.anckalbi.net/soilspecdata/) package. - -``` python -from soilspecdata.datasets.ossl import get_ossl -``` - -``` python -ossl = get_ossl() -mir_data = ossl.get_mir() -``` - -### Preprocessing pipeline +By translating specialized soil spectroscopy methods into the +[`scikit-learn`](https://scikit-learn.org/stable/) framework, +`SoilSpecTfm` and +[`SoilSpecData`](https://fr.anckalbi.net/soilspecdata/) connect this +niche domain with Python’s vast machine learning ecosystem, making +advanced ML/DL tools accessible to soil scientists. Implemented transforms developed so far include: @@ -55,9 +22,8 @@ Implemented transforms developed so far include: - [x] [`MSC`](https://franckalbinet.github.io/soilspectfm/core.html#msc): Multiplicative Scatter Correction - - [ ] `Detrend`: Detrend the spectrum (coming soon …) - - [ ] `ALS`: Asymmetric Least Squares detrend the spectrum (coming - soon …) + - [ ] `Detrend`: Detrend the spectrum (planned) + - [ ] `ALS`: Asymmetric Least Squares detrend the spectrum (planned) - **Derivatives**: @@ -65,7 +31,7 @@ Implemented transforms developed so far include: [`TakeDerivative`](https://franckalbinet.github.io/soilspectfm/core.html#takederivative): Take derivative (1st, 2nd, etc.) of the spectrum and apply Savitzky-Golay smoothing - - [ ] `GapSegmentDerivative`: (coming soon …) + - [ ] `GapSegmentDerivative`: (planned) - **Smoothing**: @@ -85,6 +51,53 @@ Implemented transforms developed so far include: [`Resample`](https://franckalbinet.github.io/soilspectfm/core.html#resample): Resample the spectrum to a new wavenumber range +**Key Features**: + +- Seamless integration with scikit-learn’s machine learning ecosystem +- Complement with [SoilSpecData](https://fr.anckalbi.net/soilspecdata/) + package for soil spectroscopy workflows +- Pipeline-ready transformers with consistent API + +All transformers follow scikit-learn conventions: + +- Implement fit/transform interface +- Support get_params/set_params for GridSearchCV +- Provide detailed documentation and examples + +## Installation + +``` bash +pip install soilspectfm +``` + +## Quick Start + +``` python +from soilspectfm.core import (SNV, + TakeDerivative, + ToAbsorbance, + Resample, + WaveletDenoise) + +from sklearn.pipeline import Pipeline +``` + +### Loading OSSL dataset + +Let’s use OSSL dataset as an example using +[SoilSpecData](https://fr.anckalbi.net/soilspecdata/) package. + +``` python +from soilspecdata.datasets.ossl import get_ossl +``` + +``` python +ossl = get_ossl() +mir_data = ossl.get_mir() +``` + +### Preprocessing pipeline + Transforms are fully compatible with [scikit-learn](https://scikit-learn.org/stable/) and can be used in a pipeline as follows: diff --git a/nbs/index.ipynb b/nbs/index.ipynb index 4442eee..26e9d3c 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -12,21 +12,59 @@ "metadata": {}, "source": [ "\n", - "> A Python package providing scikit-learn compatible transforms for spectroscopic data preprocessing. " + "> Spectral Processing Tools for Soil Spectroscopy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "It's designed to work seamlessly with both MIR (Mid-Infrared) and VISNIR (Visible-Near Infrared) spectral data." + "By translating specialized soil spectroscopy methods into the [`scikit-learn`](https://scikit-learn.org/stable/) framework, `SoilSpecTfm` and [`SoilSpecData`](https://fr.anckalbi.net/soilspecdata/) connect this niche domain with Python's vast machine learning ecosystem, making advanced ML/DL tools accessible to soil scientists." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "**WORK IN PROGRESS**" + "Implemented transforms developed so far include:\n", + "\n", + "- **Baseline corrections**:\n", + " \n", + " - [x] `SNV`: Standard Normal Variate\n", + " - [x] `MSC`: Multiplicative Scatter Correction\n", + " - [ ] `Detrend`: Detrend the spectrum (planned)\n", + " - [ ] `ALS`: Asymmetric Least Squares detrend the spectrum (planned)\n", + "\n", + "- **Derivatives**:\n", + " \n", + " - [x] `TakeDerivative`: Take derivative (1st, 2nd, etc.) of the spectrum and apply Savitzky-Golay smoothing\n", + " - [ ] `GapSegmentDerivative`: (planned)\n", + "\n", + "- **Smoothing**:\n", + " - [x] `WaveletDenoise`: Wavelet denoising\n", + " - [x] `SavGolSmooth`: Savitzky-Golay smoothing\n", + " \n", + "\n", + "- **Other transformations**:\n", + " - [x] `ToAbsorbance`: Transform the spectrum to absorbance\n", + " - [x] `Resample`: Resample the spectrum to a new wavenumber range\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Key Features**:\n", + "\n", + "- Seamless integration with scikit-learn's machine learning ecosystem\n", + "- Complement with [SoilSpecData](https://fr.anckalbi.net/soilspecdata/) package for soil spectroscopy workflows\n", + "- Pipeline-ready transformers with consistent API\n", + "\n", + "All transformers follow scikit-learn conventions:\n", + "\n", + "- Implement fit/transform interface\n", + "- Support get_params/set_params for GridSearchCV\n", + "- Provide detailed documentation and examples" ] }, { @@ -111,34 +149,6 @@ "### Preprocessing pipeline" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Implemented transforms developed so far include:\n", - "\n", - "- **Baseline corrections**:\n", - " \n", - " - [x] `SNV`: Standard Normal Variate\n", - " - [x] `MSC`: Multiplicative Scatter Correction\n", - " - [ ] `Detrend`: Detrend the spectrum (coming soon ...)\n", - " - [ ] `ALS`: Asymmetric Least Squares detrend the spectrum (coming soon ...)\n", - "\n", - "- **Derivatives**:\n", - " \n", - " - [x] `TakeDerivative`: Take derivative (1st, 2nd, etc.) of the spectrum and apply Savitzky-Golay smoothing\n", - " - [ ] `GapSegmentDerivative`: (coming soon ...)\n", - "\n", - "- **Smoothing**:\n", - " - [x] `WaveletDenoise`: Wavelet denoising\n", - " - [x] `SavGolSmooth`: Savitzky-Golay smoothing\n", - " \n", - "\n", - "- **Other transformations**:\n", - " - [x] `ToAbsorbance`: Transform the spectrum to absorbance\n", - " - [x] `Resample`: Resample the spectrum to a new wavenumber range\n" - ] - }, { "cell_type": "markdown", "metadata": {}, diff --git a/nbs/sidebar.yml b/nbs/sidebar.yml index def757b..3960328 100644 --- a/nbs/sidebar.yml +++ b/nbs/sidebar.yml @@ -6,3 +6,4 @@ website: contents: - 00_core.ipynb - 01_visualization.ipynb + - 02_utils.ipynb