puqi commited on
Commit
daa5b98
·
1 Parent(s): f84b879

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -1
app.py CHANGED
@@ -32,4 +32,29 @@ data.target_train = data.load_npy_file('train_target_small.npy')
32
  data.input_val = data.load_npy_file('val_input_small.npy')
33
  data.target_val = data.load_npy_file('val_target_small.npy')
34
 
35
- st.markdown('Streamlit bb')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  data.input_val = data.load_npy_file('val_input_small.npy')
33
  data.target_val = data.load_npy_file('val_target_small.npy')
34
 
35
+
36
+ const_model = data.target_train.mean(axis = 0)
37
+ X = data.input_train
38
+ bias_vector = np.ones((X.shape[0], 1))
39
+ X = np.concatenate((X, bias_vector), axis=1)
40
+ mlr_weights = np.linalg.inv(X.transpose()@X)@X.transpose()@data.target_train
41
+ data.set_pressure_grid(data_split = 'val')
42
+
43
+ const_pred_val = np.repeat(const_model[np.newaxis, :], data.target_val.shape[0], axis = 0)
44
+ print(const_pred_val.shape)
45
+
46
+ # Multiple Linear Regression
47
+ X_val = data.input_val
48
+ bias_vector_val = np.ones((X_val.shape[0], 1))
49
+ X_val = np.concatenate((X_val, bias_vector_val), axis=1)
50
+ mlr_pred_val = X_val@mlr_weights
51
+ print(mlr_pred_val.shape)
52
+
53
+ # Load your prediction here
54
+
55
+ # Load predictions into data_utils object
56
+ data.model_names = ['const', 'mlr'] # add names of your models here
57
+ preds = [const_pred_val, mlr_pred_val] # add your custom predictions here
58
+ data.preds_val = dict(zip(data.model_names, preds))
59
+
60
+ st.markdown('Streamlit c')