-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.py
73 lines (67 loc) · 3.45 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import os
import pandas as pd
from datetime import datetime, timedelta
from reportgen import FiddlerReportGenerator, OutputTypes
from reportgen.analysis_modules import ProjectSummary, PerformanceAnalysisSpec, FailureCaseAnalysis, FeatureImpact
FRoG = FiddlerReportGenerator(url='http://demo.fiddler.ai',
org_id='demo',
auth_token=os.getenv('fiddler_api_key'),
author='Bashir R'
)
FRoG.generate_report(project_id='imdb_rnn',
analysis_modules=[ProjectSummary(start_time_delta='120D',
failed_cases=True,
alert_details=False)
],
output_path='imdb'
)
FRoG.generate_report(project_id='lending2',
analysis_modules=[ProjectSummary(start_time_delta='120D',
failed_cases=True)
],
output_path='lending2'
)
# ------------------------------- old user interface ----------------------------
# import fiddler as fdl
# print(f"Running client version {fdl.__version__}")
# api = fdl.FiddlerApi(url='http://demo.fiddler.ai', org_id='demo', auth_token=os.getenv('fiddler_api_key'))
# ------------------------ example 1 ------------------------
# generate_report(fiddler_api=api,
# analysis_modules=[ProjectSummary(project_id="imdb_rnn",
# start_time_delta='30D'),
# FeatureImpact(project_id="imdb_rnn"),
# FailureCaseAnalysis(project_id="imdb_rnn"),
# ],
# output_type=OutputTypes.DOCX,
# output_path='imdb',
# author='Bashir R'
# )
# # ------------------------ example 2 ------------------------
# generate_report(fiddler_api=api,
# analysis_modules=[ProjectSummary(project_id="lending",
# start_time_delta='30D',
# ),
# FeatureImpact(project_id="lending"),
# FailureCaseAnalysis(project_id="lending"),
# ],
# output_type=OutputTypes.DOCX,
# output_path='lending',
# author='Bashir R'
# )
# # ------------------------ example 3 ------------------------
# analysis1 = PerformanceAnalysisSpec(model_id='logreg_all',
# metric='accuracy',
# interval_length='6D',
# segment_col='home_ownership'
# )
#
# generate_report(fiddler_api=api,
# analysis_modules=[ProjectSummary(project_id="lending",
# start_time_delta='30D',
# performance_analysis=[analysis1],
# )
# ],
# output_type=OutputTypes.DOCX,
# output_path='lending',
# author='Bashir R'
# )