machine learning project in python for beginners

Here is the simple machine learning project in python for beginners, it is actually some machine learning application to predict 2BHK apartment price in a specified city.So first we should explain what is machine learning, it is actually a technique that enable a system to learn from data.In simple it will learn from the data you have given and tell u next data based on the learning.
To do machine learning project in python you have to download anaconda you can download it from the website www.anaconda.com based on python version you can download any of the release.Then double click and install in your sytem.after installing open anaconda and create a new file and name it as myfirstML.py (any name you can give)

SO Lets start coding

1) First we are importing pandas module see code

import pandas

Of course you will ask me what is pandas ,in simple pandas is a library used for data manipulations and analysis.

2) Next assign given data in variable ,we have data of last 10 year price of 2BHK apartment

See below test.csv file

2010,180000
2011,220000
2012,240000
2013,250000
2014,260000
2015,290000
2016,320000
2017,360000
2018,400000
2019,500000
2020,550000

url='test.csv'
names=['year','price-for-2BHK']

3) Read CSV with the help of pandas library function

datas= pandas.read_csv(url,names=names)

4) Read CSV with the help of pandas library function

datas= pandas.read_csv(url,names=names)

5) Print data and make sure that we are fecthing data in a variable correctly

print(datas[['price-for-2BHK']])

6) Assign year and price-for-2BHK in respective varibale x and y


x=datas[['year']];
        
y=datas[['price-for-2BHK']]

7) Import train_test_split and split data using train_test_split

train_test_split is a function in sklearn model selection for spiliting data arrays in to two subsets , for training data and for testing data with this function no need to divide the data manually


from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test =train_test_split(x,y,test_size=0.1,random_state=101)

8) import LinearRegression from sklearn.linear_model

LinearRegression is statistical method used to create a linear model.This model describe the relationship between a dependent variable y as function of one or more independent variable


from sklearn.linear_model import LinearRegression

9) Use LinearRegression() and fit method

LinearRegression is statistical method used to create a linear model.This model describe the relationship between a dependent variable y as function of one or more independent variable


model= LinearRegression()
model.fit(X_train,Y_train)

10) Finally predict the price based on the year

print(model.predict([[2030]]))

Output

2BHK price in 2030 :855446.85990338

See full code

import pandas
url="test.csv"
names=['year','price-for-2BHK']

datas= pandas.read_csv(url,names=names)

print(datas[['price-for-2BHK']])

x=datas[['year']];
        
y=datas[['price-for-2BHK']]

from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test =train_test_split(x,y,test_size=0.1,random_state=101)

from sklearn.linear_model import LinearRegression

model= LinearRegression()
model.fit(X_train,Y_train)

print(model.predict([[2030]]))

How to convert a integer value to word in python

To convert a integer value to word in python our aim is to convert 124 to “One Hundred Twenty Four”

Here is python code to convert integer value to word

def Towords(num):
	under_20 = ['Zero','One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen']
	tens = ['Twenty','Thirty','Forty','Fifty','Sixty','Seventy','Eighty','Ninety']
	above_100 = {100: 'Hundred',1000:'Thousand', 1000000:'Million', 1000000000:'Billion'}
	if num < 20:
		 return under_20[num]

	if num < 100:
		return tens[(int)(num/10)-2] + ('' if num%10==0 else ' ' + under_20[num%10])
	# find the appropriate pivot - 'Million' in 3,603,550, or 'Thousand' in 603,550
	pivot = max([key for key in above_100.keys() if key <= num])
	return Towords((int)(num/pivot)) + ' ' + above_100[pivot] + ('' if num%pivot==0 else ' ' + Towords(num%pivot))


print(Towords(124))

Output

One Hundred Twenty Four

How to convert a integer value to word in python

tiger view in 3d not working in my phone

tiger view in 3d not working my phone

View in 3d is a new feature in smart devices it allow you to view the animal in 3D format.But it is visible only in google core compatible mobile phone.Here is the list of mobile phone that will work view in 3d options

Asus Zenfone AR
Asus Zenfone ARES
Google Nexus 5X
Google Nexus 6P
Google Pixel, Pixel XL
Google Pixel 2, Pixel 2 XL
Google Pixel 3, Pixel 3 XL
Nokia 6 (2018)
Nokia 6.1 Plus
Nokia 7 Plus
Nokia 8
Nokia 7.1
Nokia 8 Sirocco
Honor 8X
Honor View 10 Lite
Honor 10
Honor V20
Nova 3, Nova 3i
Huawei Mate 20 Lite
Huawei Mate 20 Pro
Huawei Mate 20 X
Nova 4
Huawei y9 (2019)
Huawei P20, P20 Pro
Huawei Mate RS Porsche Design
LG G6
LG G7 One
LG G7 ThinQ
LG V30, V30+, V30+ JOJO
LG V35 ThinQ
LG Q6
LG V40
LG Q8
Moto G5S Plus
Moto G6
Moto Z2 Force
Moto Z3
Moto Z3 Play
Moto Z2 Force
Moto X4
Moto One
Moto One Power
OnePlus 3T
OnePlus 5
OnePlus 6
OnePlus 6T
Samsung Galaxy A5 (2017)
Samsung Galaxy A7 (2017)
Samsung Galaxy A8, Samsung Galaxy A8+ (2018)
Samsung Galaxy Note 8
Samsung Galaxy S7, Galaxy S7 Edge
Samsung Galaxy S8, Galaxy S8+
Samsung Galaxy S9, Galaxy S9+
Galaxy Tab S3
Galaxy Tab S4
Xiaomi Mi Mix 2S
Xiaomi Mi 8
Xiaomi Mi 8 SE
Mi Mix 3
Pocofone F1
Vivo Nex S
Vivo Nex dual display
Sony Xperia XZ Premium
Xperia XZ1, Xperia XZ1 Compact
Xperia XZ2, Xperia XZ2 Compact, Xperia XZ2 Premium
Xperia XZ3


Here is the list of animals that can view in 3d

Lion
Tiger
Cheetah
Shark
Hedgehog
Duck
Emperor penguin
Wolf
Angler fish
Goat
Rottweiler
Snakes
Eagle
Brown bear
Alligator
Horse
Shetland pony
Macaw
Pug
Turtle
Cat
Octopus
Dog
Golden Retriever

Must watch English Travel Movies List

Here am exploring Must watch English Travel Movies List,following the list of movies you should watch before you die.

1) Eat Pray Love

Eat Pray Love is the one of the best travel movie, Elizabeth Gilbert’s embarks on a journey Through Italy , India and Bali in Indonesia an attempt to rediscover her true self.This movie is based on American author Elizabeth Gilbert book Eat Pray Love , The book remained on The New York Times Best Seller list for 187 weeks.It took three country Italy , India and Indonesia accordingly Eat ,Pray and Love.In Italy she tried and enjoyed all the food,In India she is trying to find out peach of mind through meditation,and lastly in Bali (Indonesia) she is enjoying the love.

Must watch English Movies List

2) Into the Wild

Into the Wild is a biographical adventure drama film written by Sean Penn.The script written based on the “Into the Wild” written by Jon Krakauer.McCandless hero in the movie travels into the wilderness and sets up a campsite in an abandoned city bus. At first, McCandless is content with the isolation, the beauty of nature around him, and the thrill of living off the land.

Into the Wild

3) The Beach

The Beach is a adventure film by Danny Boyle and based on Alex Garlan Novel “The Beach”.Leonardo DiCaprio play Lead role in this movie ,a young seeking adventure in Bangkok, he came to know about uninhabited and restricted island in the Gulf of Thailand with a beautiful hidden beach and lagoon.
The Beach

4) Before Sunrise

Before Sunrise is a romantic film directed by Richard Linklater, it explore the romatic love story of Jesse meets and Céline They meet on a train from Budapest.They both roam around in Vienna.After visiting a few landmarks in Vienna, they share a kiss at the top of the Wiener Riesenrad at sunset and start to feel a romantic connection.
Before Sunrise