Skip to content

Commit fab8a01

Browse files
committed
docs: πŸ“ update
1 parent 6f31ab2 commit fab8a01

File tree

8 files changed

+9671
-1
lines changed

8 files changed

+9671
-1
lines changed

β€Žbinfo.ipynb

Lines changed: 2074 additions & 0 deletions
Large diffs are not rendered by default.

β€Žstats_utils/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from stats_utils import confidence_ellipse
2-
from stats_utils import fetch_data
2+
from stats_utils import fetch_data
3+
from stats_utils.rnd_matrix import rnd_replace_with_const
4+
from stats_utils.record_rnd import record_by_time

β€Žstats_utils/assign_matrix.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import itertools
2+
import pandas as pd
3+
4+
5+
def assign_matrix(*cols):
6+
'''
7+
Assigns a 0-1 matrix for each cols
8+
'''
9+
list_0_1 = [*product([0, 1], repeat=len(cols))]
10+
assign_df = pd.DataFrame(list_0_1, columns=cols)
11+
12+
return assign_df

β€Žstats_utils/record_rnd.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import numpy as np
2+
from datetime import datetime
3+
import pathlib
4+
5+
def record_by_time(func_name, first_arg, output):
6+
hour = datetime.now().hour
7+
minute = datetime.now().minute
8+
9+
record_path = f'./record/{func_name}'
10+
11+
pathlib.Path(f'{record_path}').mkdir(parents=True, exist_ok=True)
12+
np.savetxt(f'{record_path}/{first_arg}_{hour}_{minute}.txt', X=output)
13+

β€Žstats_utils/rnd_matrix.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import numpy as np
2+
from skfake.record_rnd import *
3+
4+
5+
def rnd_replace_with_const(n_groups, n_samples, constant=0, col_ind=0, sort=-1, seed=None, record=None):
6+
if seed:
7+
np.random.seed(seed)
8+
rnd_matrix = np.random.rand(n_groups, n_samples)
9+
if sort:
10+
rnd_matrix.sort(axis=sort)
11+
12+
the_col = np.ones(n_groups) * constant
13+
rnd_matrix[:, col_ind] = the_col
14+
15+
if record == 'time':
16+
record_by_time(rnd_2d_from.__name__, n_groups, output)
17+
18+
return rnd_matrix

β€Žtutoroal.ipynb

Lines changed: 245 additions & 0 deletions
Large diffs are not rendered by default.

β€Žzuoye/HW2-555-yxb.ipynb

Lines changed: 3144 additions & 0 deletions
Large diffs are not rendered by default.

β€Žzuoye/HW2-555_3.1.ipynb

Lines changed: 4162 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
Β (0)