<jupyter_start><jupyter_text><jupyter_code>!nvcc --version
from google.colab import drive
drive.mount('/content/drive')
import pandas as pd
import os
import numpy as np
from glob import glob
from matplotlib import pyplot as plt
import seaborn as sns
from random import randint
from glob import glob
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from sklearn.metrics import mean_squared_error
from tensorflow.keras.optimizers import Adam
df = pd.read_csv('/content/drive/MyDrive/WiproCompetetion/train.csv')
df.head()
y1 = df['Clearsky DHI']
y2=df['Clearsky DNI']
y3=df['Clearsky GHI']
X_train = df.drop(['Clearsky DHI', 'Clearsky DNI', 'Clearsky GHI','Year','Month','Day','Minute','Cloud Type','Wind Direction','Temperature','Fill Flag'], axis=1)
model1 = keras.Sequential()
model1.add(layers.Dense(300, activation="relu"))
model1.add(layers.Dense(200, activation="relu"))
model1.add(layers.Dense(100, activation="relu"))
model1.add(layers.Dense(50, activation="relu"))
model1.add(layers.Dense(25, activation="relu"))
model1.add(layers.Dense(1, activation='relu'))
model2 = keras.Sequential()
model2.add(layers.Dense(300, activation="relu"))
model2.add(layers.Dense(200, activation="relu"))
model2.add(layers.Dense(100, activation="relu"))
model2.add(layers.Dense(50, activation="relu"))
model2.add(layers.Dense(25, activation="relu"))
model2.add(layers.Dense(1, activation='relu'))
model3 = keras.Sequential()
model3.add(layers.Dense(300, activation="relu"))
model3.add(layers.Dense(200, activation="relu"))
model3.add(layers.Dense(100, activation="relu"))
model3.add(layers.Dense(50, activation="relu"))
model3.add(layers.Dense(25, activation="relu"))
model3.add(layers.Dense(1, activation='relu'))
model1
model2
model3
from sklearn.model_selection import train_test_split                    
from sklearn.neural_network import MLPRegressor   
model1 = MLPRegressor(solver='lbfgs',alpha=0.001,hidden_layer_sizes=(150,))
model2 = MLPRegressor(solver='lbfgs',alpha=0.001,hidden_layer_sizes=(150,))
model3 = MLPRegressor(solver='lbfgs',alpha=0.001,hidden_layer_sizes=(150,))

model1.fit(X_train,y1)
model2.fit(X_train,y2)
model3.fit(X_train,y3)
model1.score(X_train,y1)
pre=model1.predict(X_train)
pre.size
#Compile and train
model1.compile(optimizer=Adam(learning_rate=0.0001), 
              loss='mse',
              metrics=['mae',keras.metrics.RootMeanSquaredError()])

history = model1.fit(X_train,y1, epochs=100, batch_size=64)
#Compile and train
model2.compile(optimizer=Adam(learning_rate=0.0001), 
              loss='mse',
              metrics=['mae',keras.metrics.RootMeanSquaredError()])

history2 = model2.fit(X_train,y2, epochs=100, batch_size=64)
keras.backend.clear_session()
tf.keras.backend.clear_session()
#Compile and train
model3.compile(optimizer=Adam(learning_rate=0.0001), 
              loss='mse',
              metrics=['mae',keras.metrics.RootMeanSquaredError()])

history3 = model3.fit(X_train,y3, epochs=100, batch_size=64)
model1.evaluate(X_train,y1, verbose=1)
model2.evaluate(X_train,y2, verbose=1)
model3.evaluate(X_train,y3, verbose=1)
preds = model1.predict(X_train)
preds
test = pd.read_csv('/content/drive/MyDrive/WiproCompetetion//test.csv')
test.head()
X_test = test.drop(['Clearsky DHI', 'Clearsky DNI', 'Clearsky GHI','Year','Month','Day','Minute','Cloud Type','Wind Direction','Temperature','Fill Flag'], axis=1)
xpred=test[['Clearsky DHI', 'Clearsky DNI', 'Clearsky GHI']]
from tensorflow.python.keras.backend import dtype
model.summary()
tpred=model.predict(X_test)
tpred.transpose()

print(tpred.shape)
out = pd.DataFrame(tpred, columns = ['Clearsky DHI'])
out2=
out<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15680954964731417, 'fraction_numerical': 0.042322300596852956, 'mean_word_length': 6.946120689655173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '466861', 'license': 'MIT', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1340, 'n_words': 221, 'path': 'WiproCompANN.ipynb', 'repo_name': 'skaran786/Wipro-s-Sustainability-Machine-Learning-Challenge', 'size': '3686'}