-
Notifications
You must be signed in to change notification settings - Fork 119
/
features.py
40 lines (32 loc) · 1.14 KB
/
features.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
import inspect
from sklego import meta, pipeline, pandas_utils, dummy, linear_model, mixture, \
naive_bayes, datasets, model_selection, preprocessing, metrics
def not_in(thing, *substrings):
for string in substrings:
if string in thing:
return False
return True
def print_classes(submodule):
for cls in dir(submodule):
if inspect.isclass(getattr(submodule, cls)):
if not_in(cls, 'Mixin', 'Base'):
if (cls[0].upper() == cls[0]) and (cls[0] != '_'):
print(f"{submodule.__name__}.{cls}")
def print_functions(submodule):
for cls in dir(submodule):
if inspect.isfunction(getattr(submodule, cls)):
if cls[0] != '_':
print(f"{submodule.__name__}.{cls}")
if __name__ == "__main__":
print_functions(datasets)
print_functions(pandas_utils)
print_classes(dummy)
print_classes(linear_model)
print_classes(naive_bayes)
print_classes(mixture)
print_classes(meta)
print_classes(preprocessing)
print_classes(model_selection)
print_classes(pipeline)
print_functions(pipeline)
print_functions(metrics)