ot16 commited on
Commit
a839728
1 Parent(s): e7be86c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py CHANGED
@@ -386,6 +386,13 @@ elif app_mode == "Prediction":
386
 
387
  # Display the plot within the Streamlit app
388
  st.pyplot(fig)
 
 
 
 
 
 
 
389
 
390
  # - - - - - - - - - - - - - - DECISION TREE REGRESSOR
391
  st.subheader('Decision Tree Regressor')
@@ -472,11 +479,32 @@ elif app_mode == "Prediction":
472
  0.8520, 1.1060, 0.1560, 0.1560, 0.2480, 0.2530, 0.1470, 0.1440, 0.2080]
473
  }
474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
  df = pd.DataFrame(data)
476
 
477
  # Display DataFrame as a table
478
  st.table(df)
479
 
480
  # - - - - - - - - - - - - -
 
 
481
  st.subheader('Feature Importance')
482
  st.image('newplot.png')
 
386
 
387
  # Display the plot within the Streamlit app
388
  st.pyplot(fig)
389
+
390
+ mse = metrics.mean_squared_error(y_test, y_pred)
391
+ r2_score = metrics.r2_score(y_test, y_pred)
392
+
393
+ st.write(f"Mean Squared Error: {mse}")
394
+ st.write(f"R-squared: {r2_score}")
395
+ st.write("------------------------------------")
396
 
397
  # - - - - - - - - - - - - - - DECISION TREE REGRESSOR
398
  st.subheader('Decision Tree Regressor')
 
479
  0.8520, 1.1060, 0.1560, 0.1560, 0.2480, 0.2530, 0.1470, 0.1440, 0.2080]
480
  }
481
 
482
+ #Code for Best Models - PyCaret/MLFlow
483
+ #!pip install pycaret --quiet
484
+ #!pip install datasets --quiet
485
+ #!pip install mlflow --quiet
486
+
487
+ # Load the dataset from PyCaret
488
+ #from pycaret.datasets import get_data
489
+ #from pycaret.regression import setup, compare_models
490
+
491
+ # Load the 'diamond' dataset
492
+ #data = tech_df[cols]
493
+
494
+ # Initialize setup
495
+ #s = setup(data, target='NetProfitMargin_ratio', transform_target=True, log_plots=True, experiment_name='test1')
496
+
497
+ # Compare regression models
498
+ #best_model = compare_models()
499
+
500
+
501
  df = pd.DataFrame(data)
502
 
503
  # Display DataFrame as a table
504
  st.table(df)
505
 
506
  # - - - - - - - - - - - - -
507
+ st.subheader("Old Feature Importance")
508
+ st.image('features_importance.png')
509
  st.subheader('Feature Importance')
510
  st.image('newplot.png')