-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efcd78a
commit be24e24
Showing
1 changed file
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,57 @@ | ||
import numpy as np | ||
import pandas as pd | ||
|
||
|
||
def _process_list(info, prefix): | ||
if not isinstance(info, str): | ||
info = info.__str__() | ||
|
||
info_list = info.split('\n') | ||
if len(info_list) > 1: | ||
lines = [] | ||
for it in info_list: | ||
lines.append(prefix + it) | ||
print('\n'.join(lines)) | ||
else: | ||
print(prefix + info) | ||
|
||
|
||
def part_print(info): | ||
print('='*4, info, '='*4) | ||
|
||
|
||
def print_h1(info): | ||
print('-', info) | ||
_process_list(info, '- ') | ||
|
||
|
||
def print_h2(info): | ||
print(' *', info) | ||
_process_list(info, ' * ') | ||
|
||
|
||
def print_h3(info): | ||
print(' +', info) | ||
_process_list(info, ' + ') | ||
|
||
|
||
def print_h4(info): | ||
print(' ~', info) | ||
_process_list(info, ' ~ ') | ||
|
||
|
||
if __name__ == "__main__": | ||
arr = np.array([1,2,3,3,3,1]) | ||
df = pd.DataFrame(arr) | ||
|
||
part_print('Label Distribution Check') | ||
print_h1('y train check') | ||
print_h2(df.value_counts()) | ||
print_h3('label 1 cnt valid') | ||
print_h3('label 2 cnt valid') | ||
|
||
print_h1('y valid check') | ||
print_h2(df.value_counts()) | ||
print_h3('label 1 cnt valid') | ||
print_h3('label 2 cnt valid') | ||
|
||
print_h1('y test check') | ||
print_h2(df.value_counts()) | ||
print_h3('label 1 cnt valid') | ||
print_h3('label 2 cnt valid') |