Skip to content

Commit

Permalink
joss rev 3
Browse files Browse the repository at this point in the history
  • Loading branch information
enricgrau committed Oct 31, 2023
1 parent d7a10d4 commit 55996ba
Show file tree
Hide file tree
Showing 26 changed files with 1,001 additions and 145 deletions.
Binary file modified docs/_images/ex4_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ex4_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ex4_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ex8_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ex8_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 1 addition & 8 deletions docs/_sources/definitions.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
Definitions
===========

Spectroscopy studies the interaction between light and matter, and when analyzing this type of data, it is
all about change. Spectral data will show as an accumulation of peaks, and these will vary in shape, symetry, intensity,
position and convolutions. The most subtle changes can mean significant property differences in the
measured material, but also big changes could mean little (Vickerman & Gilmore, 2009). Thus, studying what these
changes mean and how they occur is paramount. This is also true when using machine learning for spectroscopic data;
change in spectral features remains the most important thing. Here we define 4 techniques included in **pudu** that
evaluate ML models in terms of change, aiming to help scientists to further analyze their spectroscopic data beyond
the ML results.
Spectroscopy studies the interaction between light and matter, and when analyzing this type of data, it is all about change. Spectral data will show as an accumulation of peaks, and these will vary in shape, symmetry, intensity, position and convolutions. The most subtle changes can mean significant property differences in the measured material, but also big changes could mean little (Vickerman & Gilmore, 2009). Thus, studying what these changes mean and how they occur is paramount. This is also true when using machine learning (ML) for spectroscopic data; change in spectral features remains the most important thing. Here we define four techniques included in **pudu** that evaluate ML models in terms of change, aiming to help scientists to further analyze their spectroscopic data beyond the ML results.


Importance
Expand Down
35 changes: 10 additions & 25 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
Examples
--------

These examples show common use cases and scenarios for **pudu**. Most examples use spectroscopic data, and some
of them complement with images to show 2-D capability. The later data is the mnist database and is downloadable
from the code itself. For the spectral data, parameters, and sample models please download the
`data <https://github.com/pudu-py/pudu/tree/main/examples/data>`_ folder included in the
`examples <https://github.com/pudu-py/pudu/tree/main/examples>`_ folder from the repository.
These examples show use cases and scenarios for **pudu**. Most examples use spectroscopic data, and some of them complement with images to show 2-D capability. The later data is the `MNIST` database and it downloads from the code itself using `keras`. The spectral data, parameters, and sample models can be found on the `data <https://github.com/pudu-py/pudu/tree/main/examples/data>`_ folder included in the `examples <https://github.com/pudu-py/pudu/tree/main/examples>`_ folder from the repository. To make sure you comply with all the libraries used in these examples, please use the additional requirements included in `examples/examples_requirements.txt`.


Example 1: PC-LDA with Scikit-learn for classification of spectroscopic data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In this example, a PC-LDA cascaded algorithm built with Scikit-learn is evaluated using LIME and pudu. Both
methods show vastly different results. After setting up pudu allows to perform additional analysis and plotting
the results with single-line commands.
In this example, a PC-LDA cascaded algorithm built with `Scikit-learn` is evaluated using `LIME` and `pudu`. The data set used by the model are Raman and Photoluminescence spectras merged into a single vector as features and performance as open circuit voltage (Voc) data as target for classification. These are measured from CIGSe photovoltaic cells from a combinatorial sample. `pudu`, in contrast to `LIME`, clearly highlights important sections of the spectras normally related to Voc.

.. literalinclude:: ../examples/example_pclda.py
:linenos:
Expand All @@ -33,7 +27,7 @@ the results with single-line commands.
:scale: 50 %
:align: center
:alt:

.. figure:: images/ex1_4.png
:scale: 50 %
:align: center
Expand All @@ -49,9 +43,7 @@ the results with single-line commands.
Example 2: Regression for predicition of open circuit voltage of solar cells with RBFN
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Regression can be an important method for spectrocopy. Here, a Radial Basis Funtion Network is trained with localreg
to perform high-accuracy preduction of VOC with spectral areas calculated beforehand. pudu is used to analyze how
the regression behaves according to these areas.
Regression can be an important method for spectroscopy, especially when specific values, beyond classification, are of interest. Here, a Radial Basis Function Network (RBFN) is trained with `localreg` to perform the prediction of open circuit voltage (Voc) with spectral areas calculated from Raman and Photoluminescence spectras. These data are obtained from photovoltaic CIGSe cells from a combinatorial sample. The example shows which of these areas have more impact in the prediction and also how they interact with each other.

.. literalinclude:: ../examples/example_rbnf.py
:language: python
Expand Down Expand Up @@ -80,7 +72,7 @@ the regression behaves according to these areas.
Example 3: Handwritten numbers recognition using CNN with Keras and Mnist
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This example showcases 2-D capabilities of pudu with a CNN for MNIST, alongise with LIME and GRAD-CAM visualizatinos.
This example showcases 2-D capabilities of `pudu`. The example loads a pre-trained model for the classification of handwritten numbers from the MNIST dataset, alongside with LIME and GRAD-CAM visualizations.

.. literalinclude:: ../examples/example_cnn_mnist.py
:language: python
Expand Down Expand Up @@ -109,9 +101,7 @@ This example showcases 2-D capabilities of pudu with a CNN for MNIST, alongise w
Example 4: How to call different masks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Masking allows you to cover your featuresof analysis. It serves the same purpose of `scope` but it works in a
structured and patterned way.
This example shows the use of `mask` options available.
Masking allows you to cover features from the analysis. It serves the same purpose of `scope` but it works in a structured and patterned way. This example shows the use of `mask` options available with a PC-LDA model using Raman and Photoluminescence spectras merged into a single vector as features and performance as open circuit voltage (Voc) data as target for classification. These are measured from CIGSe photovoltaic cells from a combinatorial sample.

.. literalinclude:: ../examples/example_masking.py
:language: python
Expand All @@ -135,8 +125,7 @@ This example shows the use of `mask` options available.
Example 5: How to call different perturbations
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Depending on the nature of the data and the problem, different perturbation functions and patterns
may be needed. **pudu** offers options to suit different scenarios. Some of the are shown in this example.
Depending on the nature of the data and the problem, different perturbation functions and patterns may be needed. `pudu` offers options to suit different scenarios. Some of the are shown in this example. This example uses a PC-LDA model that classifies Raman and Photoluminescence spectras merged into a single vector as features and performance as open circuit voltage (Voc) data as target. These are measured from CIGSe photovoltaic cells from a combinatorial sample.

.. literalinclude:: ../examples/example_perturbation.py
:language: python
Expand Down Expand Up @@ -165,9 +154,7 @@ may be needed. **pudu** offers options to suit different scenarios. Some of the
Example 6: Re-activations with 1-D CNN
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This examples show how to evaluate the re-activations on the activation maps for a CNN for classificatiion
of spectras according to VOC of photovoltaic samples. It also showcases the use of `relate`, `feature_report`,
`unit_report`, and `relate_report`.
This example shows how to evaluate the ` re-activations < https://pudu-py.github.io/pudu/definitions.html#activations-and-re-activaiton>`_ on the activation maps for a CNN for classification of four Raman and four Photoluminescence spectras (eight in total) merged together into a single vector according to the open circuit voltage (Voc) of photovoltaic CIGSe samples. It also showcases the use of `relate`, `feature_report`, `unit_report`, and `relate_report`.

.. literalinclude:: ../examples/example_activations_1d.py
:language: python
Expand Down Expand Up @@ -200,8 +187,7 @@ of spectras according to VOC of photovoltaic samples. It also showcases the use
Example 7: Re-activations with 2-D CNN
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This examples show how to evaluate the re-activations on the activation maps for a CNN for MNIST database.
It also showcases the use of `relate`, `feature_report`, `unit_report`, and `relate_report`.
This example shows how to evaluate the re-activations on the activation maps for a 2D CNN. The example loads a pre-trained model for the classification of handwritten numbers from the MNIST dataset. It also showcases the use of `relate`, `feature_report`, `unit_report`, and `relate_report`.

.. literalinclude:: ../examples/example_activations_2d.py
:language: python
Expand Down Expand Up @@ -239,8 +225,7 @@ It also showcases the use of `relate`, `feature_report`, `unit_report`, and `rel
Example 8: Selecting specific sections to evaluate
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To evaluate specific areas, peaks, and ranges, we can do it one-by-one and the put them all together in a vector
for plotting and/or normalizing. This can be done for `importance` and `speed` only.
To evaluate specific areas, peaks, and ranges, it is possible to be done one-by-one and then put them all together in a vector for plotting and/or normalizing. This can be performed for `importance` and `speed`. This example loads a pre-trained PC-LDA model built with `Scikit-learn` for classification of Raman and Photoluminescence spectras merged into a single vector as features according to performance as open circuit voltage (Voc).

.. literalinclude:: ../examples/example_specific_sections.py
:language: python
Expand Down
9 changes: 1 addition & 8 deletions docs/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,7 @@

<section id="definitions">
<h1>Definitions<a class="headerlink" href="#definitions" title="Permalink to this heading"></a></h1>
<p>Spectroscopy studies the interaction between light and matter, and when analyzing this type of data, it is
all about change. Spectral data will show as an accumulation of peaks, and these will vary in shape, symetry, intensity,
position and convolutions. The most subtle changes can mean significant property differences in the
measured material, but also big changes could mean little (Vickerman &amp; Gilmore, 2009). Thus, studying what these
changes mean and how they occur is paramount. This is also true when using machine learning for spectroscopic data;
change in spectral features remains the most important thing. Here we define 4 techniques included in <strong>pudu</strong> that
evaluate ML models in terms of change, aiming to help scientists to further analyze their spectroscopic data beyond
the ML results.</p>
<p>Spectroscopy studies the interaction between light and matter, and when analyzing this type of data, it is all about change. Spectral data will show as an accumulation of peaks, and these will vary in shape, symmetry, intensity, position and convolutions. The most subtle changes can mean significant property differences in the measured material, but also big changes could mean little (Vickerman &amp; Gilmore, 2009). Thus, studying what these changes mean and how they occur is paramount. This is also true when using machine learning (ML) for spectroscopic data; change in spectral features remains the most important thing. Here we define four techniques included in <strong>pudu</strong> that evaluate ML models in terms of change, aiming to help scientists to further analyze their spectroscopic data beyond the ML results.</p>
<section id="importance">
<h2>Importance<a class="headerlink" href="#importance" title="Permalink to this heading"></a></h2>
<p>Importance quantifies the relevance of the features according to the changes in the prediction according to
Expand Down
Loading

0 comments on commit 55996ba

Please sign in to comment.