Skip to content

Commit 767301c

Browse files
Merge pull request #196 from dpr1005/development
Improved code quality and its documentation
2 parents 0dd7544 + ca00cc8 commit 767301c

28 files changed

+1374
-473
lines changed

docs/anexos.pdf

159 KB
Binary file not shown.

docs/anexos.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
\usepackage{lmodern} % scalable font
99
\usepackage{microtype}
1010
\usepackage{placeins}
11+
\usepackage{adjustbox}
1112
\usepackage{tabularx}
1213
\usepackage{placeins}
1314

15+
% Moneda
16+
\usepackage{eurosym}
17+
1418
\RequirePackage{booktabs}
1519
\RequirePackage[table]{xcolor}
1620
\RequirePackage{xtab}

docs/bibliografiaAnexos.bib

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,22 @@ @misc{Travis-CI-LOG-UBUMLaaS
210210

211211
@misc{PyPI, title={Python Package Index}, url={https://pypi.org/}, note={https://pypi.org/}}
212212

213-
@misc{NearestNeighbors, title={Scikit-Learn Nearest Neighbors}, url={https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html}, note={sklearn.neighbors.NearestNeighbors}}
213+
@misc{NearestNeighbors, title={Scikit-Learn Nearest Neighbors}, url={https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html}, note={sklearn.neighbors.NearestNeighbors}}
214+
215+
@misc{SalarioJunior, title={Salario medio Programador Junior España}, url={https://es.indeed.com/career/programador-junior/salaries}, note={https://es.indeed.com/career/programador-junior/salaries}}
216+
217+
@misc{SalarioInvestigador, title={Salario medio Investigador España}, url={https://es.indeed.com/career/investigador/salaries}, note={https://es.indeed.com/career/investigador/salaries}}
218+
219+
@misc{ss_cotizacion,
220+
author = "Ministerio de Empleo y Seguridad Social",
221+
title = {Bases y tipos de cotización 2022},
222+
url = {https://www.seg-social.es/wps/portal/wss/internet/Trabajadores/CotizacionRecaudacionTrabajadores/36537}
223+
}
224+
225+
@misc{softwareLicense, title={What is a Software License?}, url={https://snyk.io/learn/what-is-a-software-license/}, author={Synk}}
226+
227+
@misc{JLA, title={JLA - Find and compare software licenses}, url={https://joinup.ec.europa.eu/collection/eupl/solution/joinup-licensing-assistant/jla-find-and-compare-software-licenses}, author={European Union}}
228+
229+
@misc{CC0, title={Creative Commons - Public Domain}, url={https://wiki.creativecommons.org/wiki/CC0}, note={https://wiki.creativecommons.org/wiki/CC0}}
230+
231+
@misc{CCBYNCND40, title={Creative Commons - Public Domain}, url={https://creativecommons.org/licenses/by-nc-nd/4.0/deed.es}, note={https://creativecommons.org/licenses/by-nc-nd/4.0/deed.es}}

docs/img/anexos/plan/Licencias.png

63.7 KB
Loading
45.2 KB
Loading
54.5 KB
Loading

docs/tex/A_Plan_proyecto.tex

Lines changed: 293 additions & 71 deletions
Large diffs are not rendered by default.

docs/tex/D_Manual_programador.tex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ \subsubsection{Bibliotecas Python}
6868
\begin{table}[p]
6969
\centering
7070
\begin{tabular}{lcl}
71-
\textbf{Biblioteca} & \textbf{Versión} & \textbf{Descripción}\\
7271
\toprule
72+
\textbf{Biblioteca} & \textbf{Versión} & \textbf{Descripción}\\
73+
\midrule
7374
\rowcolor[HTML]{EFEFEF}
7475
\texttt{email-validator} & 1.1.1 & Validar direcciones de correo electrónico.\\
7576
\texttt{flask} & 1.1.1 & Web \textit{framework}.\\ \rowcolor[HTML]{EFEFEF}
@@ -100,7 +101,7 @@ \subsubsection{Bibliotecas Python}
100101
\texttt{whichcraft} & 0.4.1 & Funcionalidad \textit{shutil.which}. \\
101102
\bottomrule
102103
\end{tabular}
103-
\caption{Bibliotecas utilizadas y sus versiones.}\label{tab:bibliotecas-python-ubumlaas}
104+
\caption{Bibliotecas utilizadas por UBUMLaaS y sus versiones.}\label{tab:bibliotecas-python-ubumlaas}
104105
\end{table}
105106

106107
Las versiones indicadas en la tabla~\ref{tab:bibliotecas-python-ubumlaas} son las que se han utilizado para el desarrollo del proyecto, se pueden actualizar a versiones futuras, siempre y cuando sean compatibles entre sí.
@@ -329,18 +330,19 @@ \subsubsection{Bibliotecas Python}
329330
\begin{table}[]
330331
\centering
331332
\begin{tabular}{lcl}
332-
\textbf{Biblioteca} & \textbf{Versión} & \textbf{Descripción}\\ \rowcolor[HTML]{EFEFEF}
333333
\toprule
334+
\textbf{Biblioteca} & \textbf{Versión} & \textbf{Descripción}\\ \rowcolor[HTML]{EFEFEF}
335+
\midrule
334336
\rowcolor[HTML]{EFEFEF}
335337
\texttt{matplotlib} & 3.4.3 & Representación gráfica. \\
336338
\textbf{\texttt{numpy}} & 1.20.3 & Computación de \textit{arrays}. \\ \rowcolor[HTML]{EFEFEF}
337-
\textbf{\texttt{pandas}} & 1.3.4 & Estructuras de datos \\
339+
\textbf{\texttt{pandas}} & 1.3.4 & Estructuras de datos. \\
338340
\textbf{\texttt{scikit-learn}} & 0.24.2 & Módulos de minería de datos y ML. \\ \rowcolor[HTML]{EFEFEF}
339341
\textbf{\texttt{scipy}} & 1.7.1 & Módulos científicos. \\
340342
\texttt{yagmail} & 0.15.277 & Cliente de GMAIL. \\
341343
\bottomrule
342344
\end{tabular}
343-
\caption{Bibliotecas utilizadas y sus versiones.}\label{tab:bibliotecas-python-is-ssl}
345+
\caption{Bibliotecas utilizadas por IS-SSL y sus versiones.}\label{tab:bibliotecas-python-is-ssl}
344346
\end{table}
345347

346348
Se recomienda el uso de un entorno de desarrollo de \texttt{Conda}, se facilitan ficheros de configuración tanto para \texttt{Conda} como para instalación con \texttt{PIP}.

instance_selection/_CNN.py

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,31 @@
33
# @Filename: CNN.py
44
# @Author: Daniel Puente Ramírez
55
# @Time: 19/11/21 07:13
6-
# @Version: 4.0
6+
# @Version: 5.0
77

88
import numpy as np
99
import pandas as pd
1010

1111
from .utils import transform, delete_multiple_element
1212

1313

14-
def check_store(store, sample, store_classes):
15-
euc = []
16-
for s in store:
17-
euc.append(np.linalg.norm(s - sample))
18-
euc = np.array(euc)
19-
euc_nn = np.amin(euc)
20-
index_nn = np.ravel(np.where(euc == euc_nn))
21-
return store_classes[index_nn[0]]
14+
class CNN:
2215

16+
"""
17+
Hart, P. (1968). The condensed nearest neighbor rule (corresp.). IEEE
18+
transactions on information theory, 14(3), 515-516.
2319
24-
class CNN:
20+
Parameters
21+
----------
22+
23+
"""
2524

2625
def __init__(self):
26+
"""A constructor for the class."""
2727
self.x_attr = None
2828

2929
def filter(self, samples, y):
3030
"""
31-
Hart, P. (1968). The condensed nearest neighbor rule (corresp.). IEEE
32-
transactions on information theory, 14(3), 515-516.
33-
3431
Implementation of The Condensed Nearest Neighbor Rule
3532
3633
The first sample of each class is placed in *store*. Thus we only have
@@ -48,6 +45,7 @@ def filter(self, samples, y):
4845
Extracted from:
4946
The condensed nearest neighbor rule. IEEE Transactions on Information
5047
Theory ( Volume: 14, Issue: 3, May 1968)
48+
5149
:param samples: DataFrame.
5250
:param y: DataFrame.
5351
:return: the input dataset with the remaining samples.
@@ -61,7 +59,7 @@ def filter(self, samples, y):
6159
handbag = []
6260

6361
for sample_class, sample in zip(samples.target, samples.data):
64-
nn_class = check_store(store, sample, store_classes)
62+
nn_class = self._check_store(store, sample, store_classes)
6563

6664
if nn_class == sample_class:
6765
handbag.append((sample_class, sample))
@@ -75,7 +73,7 @@ def filter(self, samples, y):
7573
indexes = []
7674
for index, s2 in enumerate(handbag):
7775
sample_class, sample = s2
78-
nn_class = check_store(store, sample, store_classes)
76+
nn_class = self._check_store(store, sample, store_classes)
7977
if nn_class != sample_class:
8078
store.append(sample)
8179
store_classes.append(sample_class)
@@ -88,3 +86,24 @@ def filter(self, samples, y):
8886
int))
8987

9088
return samples, y
89+
90+
@staticmethod
91+
def _check_store(store, sample, store_classes):
92+
"""
93+
> The function takes in a sample, a store of samples, and the classes of
94+
the store of samples. It then calculates the Euclidean distance
95+
between the sample and each sample in the store. It then returns the
96+
class of the sample in the store that is closest to the sample
97+
98+
:param store: the list of samples that have been stored
99+
:param sample: the sample we want to classify
100+
:param store_classes: the classes of the samples in the store
101+
:return: The class of the nearest neighbor.
102+
"""
103+
euc = []
104+
for s in store:
105+
euc.append(np.linalg.norm(s - sample))
106+
euc = np.array(euc)
107+
euc_nn = np.amin(euc)
108+
index_nn = np.ravel(np.where(euc == euc_nn))
109+
return store_classes[index_nn[0]]

0 commit comments

Comments
 (0)