sarapy 0.4.4__tar.gz → 0.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sarapy-0.4.4 → sarapy-0.4.5}/PKG-INFO +6 -1
- {sarapy-0.4.4 → sarapy-0.4.5}/README.md +5 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/pyproject.toml +1 -1
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/dataProcessing/OpsProcessor.py +7 -4
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/mlProcessors/PlantinClassifier.py +17 -14
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/version.py +1 -1
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy.egg-info/PKG-INFO +6 -1
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/__init__.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/dataProcessing/GeoProcessor.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/dataProcessing/TLMSensorDataProcessor.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/dataProcessing/TimeSeriesProcessor.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/dataProcessing/__init__.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/mlProcessors/PlantinFMCreator.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/mlProcessors/__init__.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/preprocessing/DistancesImputer.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/preprocessing/FertilizerImputer.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy/preprocessing/__init__.py +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy.egg-info/SOURCES.txt +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy.egg-info/dependency_links.txt +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy.egg-info/requires.txt +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/sarapy.egg-info/top_level.txt +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/setup.cfg +0 -0
- {sarapy-0.4.4 → sarapy-0.4.5}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sarapy
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
4
4
|
Home-page: https://github.com/lucasbaldezzari/sarapy
|
|
5
5
|
Author: Lucas Baldezzari
|
|
6
6
|
Author-email: Lucas Baldezzari <lmbaldezzari@gmail.com>
|
|
@@ -18,6 +18,11 @@ Requires-Dist: geopy
|
|
|
18
18
|
|
|
19
19
|
Library for processing SARAPICO project metadata of _AMG_.
|
|
20
20
|
|
|
21
|
+
#### Version 0.4.5
|
|
22
|
+
|
|
23
|
+
- Se modifica clase PlantinClassifier para que ahora tome un clasificador y lo use para clasificar operaciones.
|
|
24
|
+
- Se modifica OpsProcessor para poder obtener clasificaciones (y no matrices de características de plantin como se venía probando).
|
|
25
|
+
|
|
21
26
|
#### Version 0.4.4
|
|
22
27
|
|
|
23
28
|
- Se modifica fit() de PlantinFMCreator.
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Library for processing SARAPICO project metadata of _AMG_.
|
|
4
4
|
|
|
5
|
+
#### Version 0.4.5
|
|
6
|
+
|
|
7
|
+
- Se modifica clase PlantinClassifier para que ahora tome un clasificador y lo use para clasificar operaciones.
|
|
8
|
+
- Se modifica OpsProcessor para poder obtener clasificaciones (y no matrices de características de plantin como se venía probando).
|
|
9
|
+
|
|
5
10
|
#### Version 0.4.4
|
|
6
11
|
|
|
7
12
|
- Se modifica fit() de PlantinFMCreator.
|
|
@@ -22,8 +22,10 @@ class OpsProcessor():
|
|
|
22
22
|
- distanciaMedia: Distancia media entre operaciones.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
-
plclass_map = {"
|
|
25
|
+
plclass_map = {"classifier_file","imputeDistances", "distanciaMedia",
|
|
26
|
+
"umbral_precision"," dist_mismo_lugar", "max_dist",
|
|
26
27
|
"umbral_ratio_dCdP", "deltaO_medio"}
|
|
28
|
+
|
|
27
29
|
kwargs_plclass = {}
|
|
28
30
|
##recorro kwargs y usando plclass_map creo un nuevo diccionario con los valores que se pasaron
|
|
29
31
|
for key, value in kwargs.items():
|
|
@@ -145,8 +147,9 @@ class OpsProcessor():
|
|
|
145
147
|
if self.operationsDict[id_oprr]["first_day_op_classified"]:
|
|
146
148
|
classified_ops = classified_ops[1:]
|
|
147
149
|
|
|
148
|
-
plantinClassifications = np.vstack((plantinClassifications, classified_ops)) if plantinClassifications is not None else classified_ops
|
|
149
|
-
|
|
150
|
+
# plantinClassifications = np.vstack((plantinClassifications, classified_ops)) if plantinClassifications is not None else classified_ops
|
|
151
|
+
plantinClassifications = np.concatenate((plantinClassifications, classified_ops)) if plantinClassifications is not None else classified_ops
|
|
152
|
+
|
|
150
153
|
self.operationsDict[id_oprr]["first_day_op_classified"] = True
|
|
151
154
|
|
|
152
155
|
return plantinClassifications
|
|
@@ -276,7 +279,7 @@ if __name__ == "__main__":
|
|
|
276
279
|
index += random_value
|
|
277
280
|
|
|
278
281
|
# from sarapy.dataProcessing import OpsProcessor
|
|
279
|
-
op = OpsProcessor(imputeDistances = False)
|
|
282
|
+
op = OpsProcessor(classifier_file="examples\\pip_lda_imp.pkl", imputeDistances = False)
|
|
280
283
|
|
|
281
284
|
op.operationsDict
|
|
282
285
|
|
|
@@ -3,12 +3,17 @@ import numpy as np
|
|
|
3
3
|
from sklearn.base import BaseEstimator, TransformerMixin
|
|
4
4
|
from sklearn.pipeline import Pipeline
|
|
5
5
|
from sarapy.mlProcessors import PlantinFMCreator
|
|
6
|
+
import pickle
|
|
6
7
|
|
|
7
8
|
class PlantinClassifier(BaseEstimator, TransformerMixin):
|
|
8
9
|
"""Clase para implementar el pipeline de procesamiento de datos para la clasificación del tipo de operación para plantines."""
|
|
9
10
|
|
|
10
|
-
def __init__(self, **kwargs):
|
|
11
|
-
"""Constructor de la clase PlantinClassifier.
|
|
11
|
+
def __init__(self, classifier_file = "", **kwargs):
|
|
12
|
+
"""Constructor de la clase PlantinClassifier.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
- classifier_file: String con el nombre del archivo que contiene el clasificador entrenado. El archivo a cargar es un archivo .pkl.
|
|
16
|
+
"""
|
|
12
17
|
|
|
13
18
|
plclass_map = {"imputeDistances", "distanciaMedia", "umbral_precision"," dist_mismo_lugar", "max_dist",
|
|
14
19
|
"umbral_ratio_dCdP", "deltaO_medio"}
|
|
@@ -21,10 +26,12 @@ class PlantinClassifier(BaseEstimator, TransformerMixin):
|
|
|
21
26
|
kwargs_plfmc[key] = value
|
|
22
27
|
|
|
23
28
|
self._plantinFMCreator = PlantinFMCreator.PlantinFMCreator(**kwargs_plfmc)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(
|
|
27
|
-
|
|
29
|
+
#cargo el clasificador con pickle. Usamos try para capturar el error FileNotFoundError
|
|
30
|
+
try:
|
|
31
|
+
with open(classifier_file, 'rb') as file:
|
|
32
|
+
self._pipeline = pickle.load(file)
|
|
33
|
+
except FileNotFoundError:
|
|
34
|
+
print("El archivo no se encuentra en el directorio actual.")
|
|
28
35
|
|
|
29
36
|
def classify(self, newData):
|
|
30
37
|
"""Genera la clasificación de las operaciones para plantines.
|
|
@@ -36,8 +43,8 @@ class PlantinClassifier(BaseEstimator, TransformerMixin):
|
|
|
36
43
|
- 3: longitud de la operación
|
|
37
44
|
- 4: precision del GPS
|
|
38
45
|
"""
|
|
39
|
-
|
|
40
|
-
return self._pipeline.
|
|
46
|
+
feature_matrix = self._plantinFMCreator.fit_transform(newData)
|
|
47
|
+
return self._pipeline.predict(feature_matrix)
|
|
41
48
|
|
|
42
49
|
if __name__ == "__main__":
|
|
43
50
|
from sarapy.dataProcessing import OpsProcessor
|
|
@@ -60,9 +67,5 @@ if __name__ == "__main__":
|
|
|
60
67
|
break
|
|
61
68
|
index += random_value
|
|
62
69
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
op.updateOperationsDict(sample[12])
|
|
66
|
-
op.operationsDict
|
|
67
|
-
plantin_classifier = PlantinClassifier(imputeDistances = False)
|
|
68
|
-
plantin_classifier.classify(op.operationsDict["1"]["sample_ops"])
|
|
70
|
+
plantin_classifier = PlantinClassifier(classifier_file="examples\\pip_lda_imp.pkl",imputeDistances = False)
|
|
71
|
+
plantin_classifier.classify(sample[50][:,2:])
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
## Version of the package
|
|
2
|
-
__version__ = "0.4.
|
|
2
|
+
__version__ = "0.4.5"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sarapy
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
4
4
|
Home-page: https://github.com/lucasbaldezzari/sarapy
|
|
5
5
|
Author: Lucas Baldezzari
|
|
6
6
|
Author-email: Lucas Baldezzari <lmbaldezzari@gmail.com>
|
|
@@ -18,6 +18,11 @@ Requires-Dist: geopy
|
|
|
18
18
|
|
|
19
19
|
Library for processing SARAPICO project metadata of _AMG_.
|
|
20
20
|
|
|
21
|
+
#### Version 0.4.5
|
|
22
|
+
|
|
23
|
+
- Se modifica clase PlantinClassifier para que ahora tome un clasificador y lo use para clasificar operaciones.
|
|
24
|
+
- Se modifica OpsProcessor para poder obtener clasificaciones (y no matrices de características de plantin como se venía probando).
|
|
25
|
+
|
|
21
26
|
#### Version 0.4.4
|
|
22
27
|
|
|
23
28
|
- Se modifica fit() de PlantinFMCreator.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|