module hackathon.perf2018

Inheritance diagram of ensae_projects.hackathon.perf2018

Short summary

module ensae_projects.hackathon.perf2018

Compute the performance for the hackathon 2018.

source on GitHub

Classes

class

truncated documentation

MLStoragePerf2018

Computes the performances the a hackathon.

MLStoragePerf2018Image

Overloads compute_perf for images. Example of use:

MLStoragePerf2018TimeSeries

Overloads compute_perf for timeseries. Example of use:

Methods

method

truncated documentation

__init__

__init__

__init__

_label_mapping

Computes the label based on a subfolder name.

_label_mapping

Computes the label based on a subfolder name.

_load_cached_performance

Retrieves performances already computed.

_load_cached_performance

Retrieves performances already computed.

_load_cached_performance

Retrieves performances already computed.

_load_ml_storage

Creates an instance of a MLStorage

_load_ml_storage

Creates an instance of a MLStorage

_load_ml_storage

Creates an instance of a MLStorage

_save_performance

Saves cached performance.

_save_performance

Saves cached performance.

_save_performance

Saves cached performance.

compute_perf

Computes the performances for every image and one particular model.

compute_perf

Computes the performances for every image and one particular model.

compute_perf

Computes the performances for every image and one particular model.

compute_performance

Computes the performance for the not cached one if use_cache is True.

compute_performance

Computes the performance for the not cached one if use_cache is True.

compute_performance

Computes the performance for the not cached one if use_cache is True.

Documentation

Compute the performance for the hackathon 2018.

source on GitHub

class ensae_projects.hackathon.perf2018.MLStoragePerf2018(storage, examples, cache_file='cache_file.csv')[source]

Bases: object

Computes the performances the a hackathon.

source on GitHub

Parameters
  • storage – storage location

  • examples – deep learning models

source on GitHub

__init__(storage, examples, cache_file='cache_file.csv')[source]
Parameters
  • storage – storage location

  • examples – deep learning models

source on GitHub

_load_cached_performance(cache_file=None)[source]

Retrieves performances already computed.

Parameters

cached_file – file

source on GitHub

_load_ml_storage(root)[source]

Creates an instance of a MLStorage based on a folder.

Parameters

root – folder

source on GitHub

_save_performance(df, cache_file=None)[source]

Saves cached performance.

Parameters
  • df – dataframe

  • cache_file – destination

source on GitHub

compute_perf(name)[source]

Computes the performances for every image and one particular model.

source on GitHub

compute_performance(use_cache=True, fLOG=None)[source]

Computes the performance for the not cached one if use_cache is True.

Parameters
  • use_cache – use cache

  • fLOG – logging function

Returns

dataframe

source on GitHub

class ensae_projects.hackathon.perf2018.MLStoragePerf2018Image(storage, examples, cache_file='cache_file.csv')[source]

Bases: ensae_projects.hackathon.perf2018.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)

source on GitHub

Parameters
  • storage – storage location

  • examples – deep learning models

source on GitHub

__init__(storage, examples, cache_file='cache_file.csv')[source]
Parameters
  • storage – storage location

  • examples – deep learning models

source on GitHub

_label_mapping(subs)[source]

Computes the label based on a subfolder name.

source on GitHub

compute_perf(name)[source]

Computes the performances for every image and one particular model.

source on GitHub

class ensae_projects.hackathon.perf2018.MLStoragePerf2018TimeSeries(storage, examples, cache_file='cache_file.csv')[source]

Bases: ensae_projects.hackathon.perf2018.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)

source on GitHub

Parameters
  • storage – storage location

  • examples – deep learning models

source on GitHub

__init__(storage, examples, cache_file='cache_file.csv')[source]
Parameters
  • storage – storage location

  • examples – deep learning models

source on GitHub

_label_mapping(subs)[source]

Computes the label based on a subfolder name.

source on GitHub

compute_perf(name)[source]

Computes the performances for every image and one particular model.

source on GitHub