Update app.py
Browse files
app.py
CHANGED
@@ -22,9 +22,10 @@ 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 |
data['Hour'] = pd.to_datetime(data['Timestamp']).dt.hour
|
27 |
-
|
|
|
|
|
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()
|
|
|
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['Timestamp']).dt.hour
|
27 |
+
X = data[['Hour', 'Temperature', 'CloudCover']]
|
28 |
+
#,'DATE_TIME','PLANT_ID','SOURCE_KEY','DC_POWER','AC_POWER','DAILY_YIELD','TOTAL_YIELD'
|
29 |
y = data['SolarOutput']
|
30 |
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
|
31 |
model = LinearRegression()
|