Skip to content
Snippets Groups Projects
Commit a2652ea7 authored by Baptiste Bauvin's avatar Baptiste Bauvin
Browse files

merge

parents 9746bf18 4a2b2ceb
Branches
No related tags found
No related merge requests found
...@@ -4,7 +4,9 @@ tests: ...@@ -4,7 +4,9 @@ tests:
tags: tags:
- docker - docker
script: script:
- pip3 install -e . --no-deps - export LC_ALL=$(locale -a | grep en_US)
- export LANG=$(locale -a | grep en_US)
- pip3 install -e .
- pytest-3 - pytest-3
coverage: '/^TOTAL.+?(\d+\%)$/' coverage: '/^TOTAL.+?(\d+\%)$/'
artifacts: artifacts:
......
...@@ -57,6 +57,7 @@ And the following python modules will be automatically installed : ...@@ -57,6 +57,7 @@ And the following python modules will be automatically installed :
* `pyyaml <https://pypi.org/project/PyYAML/>`_ - Used to read the config files, * `pyyaml <https://pypi.org/project/PyYAML/>`_ - Used to read the config files,
* `plotly <https://plot.ly/>`_ - Used to generate interactive HTML visuals, * `plotly <https://plot.ly/>`_ - Used to generate interactive HTML visuals,
* `tabulate <https://pypi.org/project/tabulate/>`_ - Used to generated the confusion matrix. * `tabulate <https://pypi.org/project/tabulate/>`_ - Used to generated the confusion matrix.
* `pyscm-ml <https://pypi.org/project/pyscm-ml/>`_ -
Installing Installing
......
...@@ -29,6 +29,7 @@ RUN apt-get install -y --no-install-recommends locales && \ ...@@ -29,6 +29,7 @@ RUN apt-get install -y --no-install-recommends locales && \
update-locale en_US.UTF-8 && \ update-locale en_US.UTF-8 && \
echo "export LC_ALL=$(locale -a | grep en_US)" >> /root/.bashrc && \ echo "export LC_ALL=$(locale -a | grep en_US)" >> /root/.bashrc && \
echo "export LANG=$(locale -a | grep en_US)" >> /root/.bashrc echo "export LANG=$(locale -a | grep en_US)" >> /root/.bashrc
ENV LANGUAGE'en_US:en'
COPY requirements.txt . COPY requirements.txt .
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
......
...@@ -11,3 +11,4 @@ pyyaml>=3.12 ...@@ -11,3 +11,4 @@ pyyaml>=3.12
plotly>=4.2.1 plotly>=4.2.1
matplotlib>=3.1.1 matplotlib>=3.1.1
tabulate>=0.8.6 tabulate>=0.8.6
pyscm-ml>=1.0.0
\ No newline at end of file
...@@ -129,7 +129,8 @@ def analyze_all(iter_results, stats_iter, directory, data_base_name, ...@@ -129,7 +129,8 @@ def analyze_all(iter_results, stats_iter, directory, data_base_name,
publish_all_sample_errors(error_analysis, directory, stats_iter, publish_all_sample_errors(error_analysis, directory, stats_iter,
sample_ids, labels, data_base_name, label_names) sample_ids, labels, data_base_name, label_names)
publish_feature_importances(feature_importances, directory, publish_feature_importances(feature_importances, directory,
data_base_name, feature_importances_stds) data_base_name, feature_importances_stds,
metric_scores=metrics_analysis)
plot_durations(duration_means, directory, data_base_name, duration_stds) plot_durations(duration_means, directory, data_base_name, duration_stds)
return results return results
......
...@@ -102,6 +102,7 @@ def publish_feature_importances(feature_importances, directory, database_name, ...@@ -102,6 +102,7 @@ def publish_feature_importances(feature_importances, directory, database_name,
def plot_feature_importances(file_name, feature_importance, def plot_feature_importances(file_name, feature_importance,
feature_std): # pragma: no cover feature_std): # pragma: no cover
s = feature_importance.sum(axis=1) s = feature_importance.sum(axis=1)
s = s[s!=0]
feature_importance = feature_importance.loc[s.sort_values(ascending=False).index] feature_importance = feature_importance.loc[s.sort_values(ascending=False).index]
feature_importance.to_csv(file_name + "_dataframe.csv") feature_importance.to_csv(file_name + "_dataframe.csv")
hover_text = [["-Feature :" + str(feature_name) + hover_text = [["-Feature :" + str(feature_name) +
...@@ -134,6 +135,8 @@ def plot_feature_relevance(file_name, feature_importance, ...@@ -134,6 +135,8 @@ def plot_feature_relevance(file_name, feature_importance,
feature_std, metric_scores): # pragma: no cover feature_std, metric_scores): # pragma: no cover
for metric, score_df in metric_scores.items(): for metric, score_df in metric_scores.items():
if metric.endswith("*"): if metric.endswith("*"):
if isinstance(score_df, dict):
score_df = score_df["mean"]
for score in score_df.columns: for score in score_df.columns:
if len(score.split("-"))>1: if len(score.split("-"))>1:
algo, view = score.split("-") algo, view = score.split("-")
......
...@@ -79,6 +79,7 @@ class TestFunctions(unittest.TestCase): ...@@ -79,6 +79,7 @@ class TestFunctions(unittest.TestCase):
'knn', 'knn',
'lasso', 'lasso',
'random_forest', 'random_forest',
'scm',
'sgd', 'sgd',
'svm_linear', 'svm_linear',
'svm_poly', 'svm_poly',
...@@ -90,6 +91,7 @@ class TestFunctions(unittest.TestCase): ...@@ -90,6 +91,7 @@ class TestFunctions(unittest.TestCase):
'gradient_boosting', 'gradient_boosting',
'knn', 'knn',
'random_forest', 'random_forest',
'scm',
'svm_linear', 'svm_linear',
'svm_poly', 'svm_poly',
'svm_rbf']) 'svm_rbf'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment