CosmickVisions commited on
Commit
39392b6
·
verified ·
1 Parent(s): bcf8c81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -38
app.py CHANGED
@@ -736,44 +736,42 @@ elif app_mode == "Model Training":
736
  model_name = st.selectbox("Select Model", model_options, help="Choose a model.")
737
 
738
  if model_name == "Gradient Boosting":
739
- learning_rate = st.slider("Learning Rate", 0.01, 1.0, 0.1)
740
- n_estimators = st.slider("Number of Estimators", 10, 200, 100)
741
- max_depth = st.slider("Max Depth", 3, 20, 10)
742
- hyperparams = {
743
- 'learning_rate': learning_rate,
744
- 'n_estimators': n_estimators,
745
- 'max_depth': max_depth
746
- }
747
- elif model_name == "Neural Network":
748
- hidden_layers = st.slider("Number of Hidden Layers", 1, 5, 2)
749
- neurons_per_layer = st.slider("Neurons per Layer", 10, 200, 50)
750
- activation = st.selectbox("Activation Function",
751
- ["relu", "tanh", "sigmoid", "selu", "swish"])
752
- dropout_rate = st.slider("Dropout Rate", 0.0, 0.5, 0.2)
753
- initializer = st.selectbox("Weight Initializer",
754
- ["glorot_uniform", "he_normal", "lecun_uniform"])
755
- learning_rate = st.slider("Learning Rate", 0.0001, 0.1, 0.001, format="%.4f")
756
- optimizer_choice = st.selectbox("Optimizer",
757
- ["Adam", "Nadam", "RMSprop", "SGD"])
758
- batch_norm = st.checkbox("Batch Normalization", value=True)
759
- regularization = st.checkbox("L2 Regularization")
760
- epochs = st.slider("Epochs", 10, 200, 50)
761
- batch_size = st.slider("Batch Size", 16, 128, 32)
762
- hyperparams = {
763
- 'hidden_layers': hidden_layers,
764
- 'neurons_per_layer': neurons_per_layer,
765
- 'activation': activation,
766
- 'dropout_rate': dropout_rate,
767
- 'initializer': initializer,
768
- 'learning_rate': learning_rate,
769
- 'optimizer_choice': optimizer_choice,
770
- 'batch_norm': batch_norm,
771
- 'regularization': regularization,
772
- 'epochs': epochs,
773
- 'batch_size': batch_size,
774
- }
775
- else:
776
- hyperparams = {}
777
 
778
  # Train-Test Split
779
  st.subheader("✂️ Train-Test Split")
 
736
  model_name = st.selectbox("Select Model", model_options, help="Choose a model.")
737
 
738
  if model_name == "Gradient Boosting":
739
+ learning_rate = st.slider("Learning Rate", 0.01, 1.0, 0.1)
740
+ n_estimators = st.slider("Number of Estimators", 10, 200, 100)
741
+ max_depth = st.slider("Max Depth", 3, 20, 10)
742
+ hyperparams = {
743
+ 'learning_rate': learning_rate,
744
+ 'n_estimators': n_estimators,
745
+ 'max_depth': max_depth
746
+ }
747
+ elif model_name == "Neural Network":
748
+ hidden_layers = st.slider("Number of Hidden Layers", 1, 5, 2)
749
+ neurons_per_layer = st.slider("Neurons per Layer", 10, 200, 50)
750
+ activation = st.selectbox("Activation Function", ["relu", "tanh", "sigmoid", "selu", "swish"])
751
+ dropout_rate = st.slider("Dropout Rate", 0.0, 0.5, 0.2)
752
+ initializer = st.selectbox("Weight Initializer", ["glorot_uniform", "he_normal", "lecun_uniform"])
753
+ learning_rate = st.slider("Learning Rate", 0.0001, 0.1, 0.001, format="%.4f")
754
+ optimizer_choice = st.selectbox("Optimizer", ["Adam", "Nadam", "RMSprop", "SGD"])
755
+ batch_norm = st.checkbox("Batch Normalization", value=True)
756
+ regularization = st.checkbox("L2 Regularization")
757
+ epochs = st.slider("Epochs", 10, 200, 50)
758
+ batch_size = st.slider("Batch Size", 16, 128, 32)
759
+ hyperparams = {
760
+ 'hidden_layers': hidden_layers,
761
+ 'neurons_per_layer': neurons_per_layer,
762
+ 'activation': activation,
763
+ 'dropout_rate': dropout_rate,
764
+ 'initializer': initializer,
765
+ 'learning_rate': learning_rate,
766
+ 'optimizer_choice': optimizer_choice,
767
+ 'batch_norm': batch_norm,
768
+ 'regularization': regularization,
769
+ 'epochs': epochs,
770
+ 'batch_size': batch_size
771
+ }
772
+
773
+ else:
774
+ hyperparams = {}
 
 
775
 
776
  # Train-Test Split
777
  st.subheader("✂️ Train-Test Split")