-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_code.py
52 lines (31 loc) · 1.03 KB
/
run_code.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
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import Base_functions
import torch
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import random as random
import numpy.linalg as np_math
import networkx as nx
import sklearn
from sklearn.linear_model import LogisticRegression
import seaborn as sns
import seaborn as sns
import pandas as pd
import statsmodels.api as sm
from scipy import stats
from scipy.special import expit, logit
from scipy.special import comb
import sys
# In[16]:
G, X, B_true = Base_functions.Data_generator(num_groups = 3,
p_in_i = 1.5, p_out_i = 5, total_nodes = 99, cat_cont = 1)
# In[17]:
G, res, X_colors, node_dis, B, Q, positions = Base_functions.Vertex_Positions(G, step_size = 0.1, thresh = 0.000001, X = X,
gamma = 0.5, B_true = B_true, cat_cont = 1)
# In[19]:
nx.draw(G, pos = res, with_labels = False, node_color = X_colors, ax = None, cmap=plt.cm.Reds)
plt.savefig('plot.png')
# In[ ]: