# -*- coding: utf-8 -*-
"""
Created on Wed Nov 13 10:52:01 2019
%bhayya learnt this from
codebasicshub.com
@author: Vikrambhayya
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
df = pd.read_csv("C:\\Users\\Vikrambhayya\\Documents\\ML_b_1.csv")
df
""" matplotlib inline"""
plt.xlabel('Area (sq.ft)')
plt.ylabel('price (Rs)')
plt.scatter(df.Area,df.price)
"""plt.scatter(df.Area,df.price, color='red', marker ='+')"""
reg = linear_model.LinearRegression()
reg.fit(df[['Area']],df.price)
"""reg.coef_"""
"""reg.intercept_"""
d=pd.read_csv("C:/Users/Vikrambhayya/Documents/Areas_to_predict_b.csv")
d.head(3)
p=reg.predict(d)
d['prices_dharalu']=p
d.to_csv("C:\\Users\\Vikrambhayya\\Documents\\anchanA_7_b.csv")
"""d.to_csv("C:\\Users\\Vikrambhayya\\Documents\\anchanA_1_b.csv", index=False)"""
""" 100% working code above """
""" slight modification is done below (modified the 100% working code given above)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
df = pd.read_csv("C:\\Users\\Vikrambhayya\\Documents\\ML_b_1.csv")
df
plt.xlabel('vaiShAlyamu', fontsize=20)
plt.ylabel('dhara', fontsize=20)
plt.scatter(df.Area,df.price, color='red', marker ='+')
plt.plot(df.Area,reg.predict(df[['Area']]), color='blue')
d=pd.read_csv("C:/Users/Vikrambhayya/Documents/Areas_to_predict_b.csv")
d.head(3)
p=reg.predict(d)
d['prices_dharalu']=p
d.to_csv("C:\\Users\\Vikrambhayya\\Documents\\anchanA_4_b.csv", index=False)
"""# -*- coding: utf-8 -*-
"""
Created on Wed Nov 13 14:18:20 2019
@author:learnt from 'Deep learning part 2 codebasics website:
"""
import numpy as np
import matplotlib.pyplot as plt
""" matplotlib inline"""
import keras
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train.shape
x_test.shape
x_train[0]
plt.matshow(x_train[0])
y_train[0]
x_train=x_train/255
x_test=x_test/255
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
model=Sequential()
model.add(Flatten(input_shape=[28,28]))
model.add(Dense(200, activation='relu'))
model.add(Dense(10, activation='softmax'))
model.summary()
model.compile(loss="sparse_categorical_crossentropy",optimizer="adam", metrics=["accuracy"])
model.fit(x_train,y_train,epochs=5)
plt.matshow(x_test[0])
x_test.shape
yp = model.predict(x_test)
yp[0]
np.argmax(yp[0])
plt.matshow(x_test[1])
yp[1]
np.argmax(yp[1])
model.evaluate(x_test,y_test)
नमस्कार / నమస్కారము /ನಮಸ್ಕಾರ/ வணக்கம்/ নমস্কাৰ/ નમસ્તે/ ସୁପ୍ରଭାତ/ നമസ്കാരം
learnt from codebasics website
----
विक्रम कुमार
8331926163
8500386163(whatsapp only)