module hackathon.perf2018
#
Short summary#
module ensae_projects.hackathon.perf2018
Compute the performance for the hackathon 2018.
Classes#
class |
truncated documentation |
---|---|
Computes the performances the a hackathon. |
|
Overloads compute_perf for images. Example of use: |
|
Overloads compute_perf for timeseries. Example of use: |
Methods#
method |
truncated documentation |
---|---|
Computes the label based on a subfolder name. |
|
Computes the label based on a subfolder name. |
|
Retrieves performances already computed. |
|
|
Retrieves performances already computed. |
|
Retrieves performances already computed. |
Creates an instance of a MLStorage … |
|
|
Creates an instance of a MLStorage … |
|
Creates an instance of a MLStorage … |
Saves cached performance. |
|
|
Saves cached performance. |
|
Saves cached performance. |
Computes the performances for every image and one particular model. |
|
Computes the performances for every image and one particular model. |
|
Computes the performances for every image and one particular model. |
|
Computes the performance for the not cached one if use_cache is True. |
|
|
Computes the performance for the not cached one if use_cache is True. |
|
Computes the performance for the not cached one if use_cache is True. |
Documentation#
Compute the performance for the hackathon 2018.
- class ensae_projects.hackathon.perf2018.MLStoragePerf2018(storage, examples, cache_file='cache_file.csv')#
Bases:
object
Computes the performances the a hackathon.
- Parameters:
storage – storage location
examples – deep learning models
- __init__(storage, examples, cache_file='cache_file.csv')#
- Parameters:
storage – storage location
examples – deep learning models
- _load_cached_performance(cache_file=None)#
Retrieves performances already computed.
- Parameters:
cached_file – file
- _load_ml_storage(root)#
Creates an instance of a MLStorage based on a folder.
- Parameters:
root – folder
- _save_performance(df, cache_file=None)#
Saves cached performance.
- Parameters:
df – dataframe
cache_file – destination
- compute_perf(name)#
Computes the performances for every image and one particular model.
- compute_performance(use_cache=True, fLOG=None)#
Computes the performance for the not cached one if use_cache is True.
- Parameters:
use_cache – use cache
fLOG – logging function
- Returns:
dataframe
- class ensae_projects.hackathon.perf2018.MLStoragePerf2018Image(storage, examples, cache_file='cache_file.csv')#
Bases:
MLStoragePerf2018
Overloads compute_perf for images. Example of use:
from ensae_projects.hackathon.perf2018 import MLStoragePerf2018Image mstorage = "storage_brgm" mexample = "hackathon_test/sample_labelled_test" mpref = MLStoragePerf2018Image(mstorage, mexample) mres = mpref.compute_performance(fLOG=print, use_cache=True) mres = mres.sort_values("precision", ascending=False) print(mres) mbody = "<html><body><h1>Hackathon EY-ENSAE 2018 - BRGM</h1>
- “
mcontent = “{0}{1}</body></html>”.format(mbody, mres.to_html()) with open(“brgm.html”, “w”, encoding=”utf-8”) as f:
f.write(mcontent)
- Parameters:
storage – storage location
examples – deep learning models
- __init__(storage, examples, cache_file='cache_file.csv')#
- Parameters:
storage – storage location
examples – deep learning models
- _label_mapping(subs)#
Computes the label based on a subfolder name.
- compute_perf(name)#
Computes the performances for every image and one particular model.
- class ensae_projects.hackathon.perf2018.MLStoragePerf2018TimeSeries(storage, examples, cache_file='cache_file.csv')#
Bases:
MLStoragePerf2018
Overloads compute_perf for timeseries.
Example of use:
from ensae_projects.hackathon.perf2018 import MLStoragePerf2018TimeSeries mstorage = "storage_microdon" mexample = "hackathon_test/sample_labelled_test" mpref = MLStoragePerf2018TimeSeries(mstorage, mexample) mres = mpref.compute_performance(fLOG=print, use_cache=True) mres = mres.sort_values("cor", ascending=False) print(mres) mbody = "<html><body><h1>Hackathon EY-ENSAE 2018 - Microdon</h1>
- “
mcontent = “{0}{1}</body></html>”.format(mbody, mres.to_html()) with open(“brgm.html”, “w”, encoding=”utf-8”) as f:
f.write(mcontent)
- Parameters:
storage – storage location
examples – deep learning models
- __init__(storage, examples, cache_file='cache_file.csv')#
- Parameters:
storage – storage location
examples – deep learning models
- _label_mapping(subs)#
Computes the label based on a subfolder name.
- compute_perf(name)#
Computes the performances for every image and one particular model.