engr-awaisjamal commited on
Commit
2204b70
·
verified ·
1 Parent(s): 456a22b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -22,8 +22,9 @@ def load_file(uploaded_file):
22
 
23
  # Train the model if it doesn't already exist
24
  def train_model(data):
25
- data['Hour'] = pd.to_datetime(data['Timestamp']).dt.hour
26
- X = data[['Hour', 'Temperature', 'CloudCover']]
 
27
  y = data['SolarOutput']
28
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
29
  model = LinearRegression()
 
22
 
23
  # Train the model if it doesn't already exist
24
  def train_model(data):
25
+ # data['Hour'] = pd.to_datetime(data['Timestamp']).dt.hour
26
+ data['Hour'] = pd.to_datetime(data['DATE_TIME']).dt.hour
27
+ X = data[['Hour', 'Temperature', 'CloudCover','DATE_TIME','PLANT_ID','SOURCE_KEY','DC_POWER','AC_POWER','DAILY_YIELD','TOTAL_YIELD']]
28
  y = data['SolarOutput']
29
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
30
  model = LinearRegression()