Skip to content

Commit

Permalink
new experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultmax committed Jul 27, 2020
1 parent 3a20075 commit f4d77b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion evaluate_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
n_folds = 3
depas_to_score = ['Overall', 'Néonatologie', 'Ob/gyn', 'Oncologie', 'Pédiatrie']

anomaly_algorithm_rename_dict = {'LocalOutlierFactor(contamination={}, novelty=True)'.format(contamination_ratio):'LOF', 'IsolationForest(contamination={})'.format(contamination_ratio):'IF', 'OneClassSVM(nu={})'.format(contamination_ratio):'OC SVM gamma scale', 'OneClassSVM(gamma=\'auto\', nu={})'.format(contamination_ratio):'OC SVM gamma auto'}
anomaly_algorithm_rename_dict = {'LocalOutlierFactor(contamination={}, novelty=True)'.format(contamination_ratio):'LOF', 'IsolationForest(contamination={})'.format(contamination_ratio):'IF', 'OneClassSVM(nu={})'.format(contamination_ratio):'OC SVM', 'EllipticEnvelope(contamination={}'.format(contamination_ratio):'EE'}

x_axis_name_in_figure = 'Components'
algorith_name_in_figure = 'Alg'
Expand Down Expand Up @@ -55,6 +55,7 @@ def make_variance_graphs(df):
sns.set(style="whitegrid", font_scale=2)
f = sns.catplot(font_scale = 2, x=x_axis_name_in_figure, y="Explained variance ratio", data=graph_df, kind='point')
f.set_xticklabels(rotation=35, horizontalalignment='right')
plt.ylim(0,1)
plt.savefig(os.path.join(data_dir, 'variance_ratio_results.png'))


Expand Down
2 changes: 1 addition & 1 deletion train_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
contamination_ratio = 0.2
param_grid = dict(
tsvd__n_components = [8,16,32,124,256,512,1024],
anomaly_algorithm = [IsolationForest(contamination=contamination_ratio)]#, OneClassSVM(nu=contamination_ratio, gamma='scale')], #EllipticEnvelope(contamination=contamination_ratio), OneClassSVM(nu=contamination_ratio, gamma='auto'), LocalOutlierFactor(novelty=True, contamination=contamination_ratio),
anomaly_algorithm = [IsolationForest(contamination=contamination_ratio), OneClassSVM(nu=contamination_ratio)], #EllipticEnvelope(contamination=contamination_ratio) , LocalOutlierFactor(novelty=True, contamination=contamination_ratio),
)
tsvd_n_components = 256

Expand Down

0 comments on commit f4d77b6

Please sign in to comment.