karthickg12 commited on
Commit
64b9441
1 Parent(s): 401859d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -36
app.py CHANGED
@@ -32,42 +32,42 @@
32
  # st.write(pipe(t))
33
 
34
 
35
- import pandas as pd
36
- import numpy as np
37
- from ydata_synthetic.synthesizers.regular import RegularSynthesizer
38
- from ydata_synthetic.synthesizers import ModelParameters, TrainParameters
39
- import streamlit as st
40
- from os import getcwd
41
- text_file=st.file_uploader("Upload the Data File")
42
- st.write("-------------------------")
43
 
44
- if text_file is not None:
45
- df=pd.read_csv(text_file)
46
- dd_list=df.columns
47
- cat_cols=st.multiselect("Select the Categorical Columns",dd_list)
48
- num_cols=st.multiselect("Select the Numerical Columns",dd_list)
49
- Output_file=st.text_input('Enter Output File Name')
50
- s=st.number_input('Enter the Sample Size',1000)
51
- OP=Output_file + '.csv'
52
- sub=st.button('Submit')
53
- if sub:
54
- batch_size = 50
55
- epochs = 3
56
- learning_rate = 2e-4
57
- beta_1 = 0.5
58
- beta_2 = 0.9
59
 
60
- ctgan_args = ModelParameters(batch_size=batch_size,
61
- lr=learning_rate,
62
- betas=(beta_1, beta_2))
63
 
64
- train_args = TrainParameters(epochs=epochs)
65
- synth = RegularSynthesizer(modelname='ctgan', model_parameters=ctgan_args)
66
- synth.fit(data=df, train_arguments=train_args, num_cols=num_cols, cat_cols=cat_cols)
67
- df_syn = synth.sample(s)
68
- df_syn.to_csv(OP)
69
- c=getcwd()
70
- c=c + '/' + OP
71
- with open(c,"rb") as file:
72
- st.download_button(label=':blue[Download]',data=file,file_name=OP,mime="image/png")
73
- st.success("Thanks for using the app !!!")
 
32
  # st.write(pipe(t))
33
 
34
 
35
+ # import pandas as pd
36
+ # import numpy as np
37
+ # from ydata_synthetic.synthesizers.regular import RegularSynthesizer
38
+ # from ydata_synthetic.synthesizers import ModelParameters, TrainParameters
39
+ # import streamlit as st
40
+ # from os import getcwd
41
+ # text_file=st.file_uploader("Upload the Data File")
42
+ # st.write("-------------------------")
43
 
44
+ # if text_file is not None:
45
+ # df=pd.read_csv(text_file)
46
+ # dd_list=df.columns
47
+ # cat_cols=st.multiselect("Select the Categorical Columns",dd_list)
48
+ # num_cols=st.multiselect("Select the Numerical Columns",dd_list)
49
+ # Output_file=st.text_input('Enter Output File Name')
50
+ # s=st.number_input('Enter the Sample Size',1000)
51
+ # OP=Output_file + '.csv'
52
+ # sub=st.button('Submit')
53
+ # if sub:
54
+ # batch_size = 50
55
+ # epochs = 3
56
+ # learning_rate = 2e-4
57
+ # beta_1 = 0.5
58
+ # beta_2 = 0.9
59
 
60
+ # ctgan_args = ModelParameters(batch_size=batch_size,
61
+ # lr=learning_rate,
62
+ # betas=(beta_1, beta_2))
63
 
64
+ # train_args = TrainParameters(epochs=epochs)
65
+ # synth = RegularSynthesizer(modelname='ctgan', model_parameters=ctgan_args)
66
+ # synth.fit(data=df, train_arguments=train_args, num_cols=num_cols, cat_cols=cat_cols)
67
+ # df_syn = synth.sample(s)
68
+ # df_syn.to_csv(OP)
69
+ # c=getcwd()
70
+ # c=c + '/' + OP
71
+ # with open(c,"rb") as file:
72
+ # st.download_button(label=':blue[Download]',data=file,file_name=OP,mime="image/png")
73
+ # st.success("Thanks for using the app !!!")