Skip to content

Instantly share code, notes, and snippets.

View vivekpadia70's full-sized avatar
🏠
Working from home

vivekpadia70 vivekpadia70

🏠
Working from home
View GitHub Profile
knr = KNeighborsRegressor(weights='distance', n_neighbors=200)
knr.fit(X_train, Y_train)
print("KNN Score: ", knr.score(X_train, Y_train))
print("KNN Test Score: ", knr.score(X_test, Y_test))
sns.distplot(full_df['Price'])
plt.figure(figsize=(10,7), facecolor='w', edgecolor='k')
sns.violinplot(full_df['Regionname'], full_df['Price'])
plt.title("Violin plot for Regionname to Price")
plt.xticks(rotation=45)
plt.figure(figsize=(10,7), facecolor='w', edgecolor='k')
sns.violinplot(full_df['Type'], full_df['Price'])
plt.title("Violin plot for Type to Price")
plt.figure(figsize=(10,7), facecolor='w', edgecolor='k')
sns.scatterplot(full_df["Longtitude"], full_df["Lattitude"], hue=full_df["Price"], size=full_df["Landsize"])
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.2)
plt.title("Lattitude to Longitude with Price and Landsize")
plt.figure(figsize=(10,7), facecolor='w', edgecolor='k')
sns.scatterplot(full_df["Longtitude"], full_df["Lattitude"], hue=full_df["Type"])
plt.title("Lattitude to Longitude for Type of room")
plt.figure(figsize=(10,7), facecolor='w', edgecolor='k')
sns.scatterplot(full_df["Longtitude"], full_df["Lattitude"], hue=full_df["Regionname"])
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.2)
plt.title("Lattitude to Longitude for Regionname")
sns.heatmap(df.corr())
import numpy as np
import gym
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from rl.agents.dqn import DQNAgent
from rl.policy import EpsGreedyQPolicy
from rl.memory import SequentialMemory
ENV_NAME = 'Breakout-ram-v0'
# Get the environment
env = gym.make(ENV_NAME)
np.random.seed(33)
env.seed(33)
# Extract the number of actions available in Breakout, i.e. left and right
nb_actions = env.action_space.n