module ml.competitions#

Short summary#

module ensae_projects.ml.competitions

Compute metrics in for a competition

source on GitHub

Functions#

function

truncated documentation

AUC

Compute the AUC.

AUC_multi

Compute the AUC.

AUC_multi_multi

Compute the AUC.

main_codalab_wrapper_binary_classification

adapt the tempate available at evaluate.py

main_codalab_wrapper_multi_classification

adapt the tempate available at evaluate.py

private_codalab_wrapper_binary_classification

Wraps the function following the guidelines User_Building a Scoring Program for a Competition. …

private_codalab_wrapper_multi_classification

Wraps the function following the guidelines User_Building a Scoring Program for a Competition. …

Documentation#

Compute metrics in for a competition

source on GitHub

ensae_projects.ml.competitions.AUC(answers, scores)#

Compute the AUC.

Parameters:
  • answers – expected answers 0 (false), 1 (true)

  • scores – score obtained for class 1

Returns:

number

source on GitHub

ensae_projects.ml.competitions.AUC_multi(answers, scores, ignored=None)#

Compute the AUC.

Parameters:
  • answers – expected answers class as a string

  • scores – prediction and score (class, score)

  • ignored – ignored class

Returns:

number

source on GitHub

ensae_projects.ml.competitions.AUC_multi_multi(nb, answers, scores, ignored=None)#

Compute the AUC.

Parameters:
  • nb – number of observations

  • answers – expected answers, list of tuple of classes as a string

  • scores – prediction and score (class, score)

  • ignored – ignored class

Returns:

number

Dummy expected classes (both classes):

endettement    4.0
surendettement    4.0
surendettement    4.0
surendettement    4.0

Dummy predicted answers:

2.0    endettement    0.48775936896183714    0.5033579692108108
5.0    microcredit social    0.16592396695909017    0.8643847837801871
5.0    microcredit personnel    0.7962830470795325    0.6233706526012659
3.0    impayes    0.17370233487556486    0.779432954126955

source on GitHub

ensae_projects.ml.competitions.main_codalab_wrapper_binary_classification(fct, metric_name, argv, truth_file='truth.txt', submission_file='answer.txt', output_file='scores.txt')#

adapt the tempate available at evaluate.py

source on GitHub

ensae_projects.ml.competitions.main_codalab_wrapper_multi_classification(fct, variables_name, argv, truth_file='truth.txt', submission_file='answer.txt', output_file='scores.txt')#

adapt the tempate available at evaluate.py

source on GitHub

ensae_projects.ml.competitions.private_codalab_wrapper_binary_classification(fct, metric_name, fold1, fold2, f1='answer.txt', f2='answer.txt', output='scores.txt', use_print=False)#

Wraps the function following the guidelines User_Building a Scoring Program for a Competition. It replicates the example available at competition-examples/hello_world.

Parameters:
  • fct – function to wrap

  • metric_name – metric name

  • fold1 – folder which contains the data for folder containing the truth

  • fold2 – folder which contains the data for folder containing the data

  • f1 – filename for the truth

  • f2 – filename for the produced answers

  • output – produces an output with the expected results

  • use_print – display intermediate results

Returns:

metric

source on GitHub

ensae_projects.ml.competitions.private_codalab_wrapper_multi_classification(fct, variables_name, fold1, fold2, f1='answer.txt', f2='answer.txt', output='scores.txt', use_print=False, ignored=None)#

Wraps the function following the guidelines User_Building a Scoring Program for a Competition. It replicates the example available at competition-examples/hello_world.

Parameters:
  • fct – function to wrap

  • variables_name – variables names

  • fold1 – folder which contains the data for folder containing the truth

  • fold2 – folder which contains the data for folder containing the data

  • f1 – filename for the truth

  • f2 – filename for the produced answers

  • output – produces an output with the expected results

  • use_print – display intermediate results

  • ignored – ignored labels

Returns:

metric

source on GitHub