SIMPLE Python Machine Learning Tutorial (Tensorflow & Linear Regression) - FULL CODE

preview_player
Показать описание
Using Tensorflow and Python to create a linear regression machine learning model to predict machine reliability from excel data.

All code from all my videos is posted on my GitHub account!

THANKS SO MUCH FOR ALL THE SUPPORT. 150+ SUBSCRIBERS (!!!!)

Thanks for watching this video. If you have any suggestions on what's next, please let me know!

Here's the spreadsheet if you would like to use it:

Here's the full code I said I would post in the description!
# Start training
with tf.Session() as sess:

# Run the initializer

# Fit all training data
for epoch in range(training_epochs):
for (x, y) in zip(train_X, train_Y):

# Display logs per epoch step
if (epoch+1) % display_step == 0:
print("Epoch:", '%04d' % (epoch+1), "error=", "{:.9f}".format(c), \

print("Optimization Finished!")

# Graphic display

# Testing example, as requested (Issue #2)

print("Testing... (Mean square loss Comparison)")
feed_dict={X: test_X, Y: test_Y}) # same function as cost above
print("Testing error=", testing_error)
print("Absolute mean square loss difference:", abs(
training_error - testing_error))

The full code can be found here:

*****************************************************************
Code from this tutorial and all my others can be found on my GitHub:

Check out my website:

If you liked the video - please hit the like button. It means more than you know. Thanks for watching!!

Useful Links
-----------------------------------------------------------------------------------------------------------------
Python Download:
(Remember Python 3 is the future!)

I use Atom Text Editor for all my tutorials
Atom Text Editor:

Packages I often use in Python tutorials:
-Pandas
-Numpy
-xlrd
-TensorFlow
-Matplotlib
-Django Framework
-Beautiful Soup
(Install through Terminal $pip3 install ....)

Other Useful Services sometimes featured:
-Amazon Web Services (AWS)
-Microsoft Azure
-Google Cloud
-Juypter Notebooks

Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!
Рекомендации по теме
Комментарии
Автор

I have watched many videos on this topic and by far this is the simplest yet best and covers all details. Thank you Derrick!!

manishshrivastava
Автор

To update the example we can change the line

import tensorflow as tf

to

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior().

Work for me.

Tks Derrick

LeoDMello
Автор

Bro, you just fit an entire course in under 10 minutes! lol. Thank you!

Kajan
Автор

Superb keep it up its very usefull for me.need more videos about machine learning

thavamanim
Автор

Can you do tutorial on Logistics Regression using tf?

ghzich
Автор

Thank you for these videos. These are really helpful.

somyamaniktala
Автор

Great Video!!! From what I understand, Linear regression could be considered as one of the initial steps taken towards learning ML. Me being a beginner, what would your suggestion be as the next step to this video which I should be learning? Any suggestions would be greatly appreciated.

jeffinalexgeorge
Автор

Is this a relatively low-level way of implementation? A higher-level method will be dealing with estimators right?

timsu
Автор

how to use machine learning for dynamic dataset by programming python?

hussainalaaedi
Автор

it appears that tensorflow has updated and this code no longer works, due to the fact that the placeholder function does not exist. I tried importing import tensorflow.raw_ops as tf but is still failed.

skippyflatrock
Автор

Thanks so much for all the brilliant tutorials, Derrick. You're a great instructor.
Could you help me out, here, when you have a minute, please?


I got this error when I ran my code:


AttributeError: module 'tensorflow' has no attribute 'placeholder'


So, I just replaced the code I had typed with your code (thank you so much!), and I got the same error.


Is there a quick solution for this or link you might recommend, please?


Again, thanks so much for all of your resources. They are priceless!


Cheers,


Ryan

RyanLBuchanan
Автор

You still have me lost. I have tried watching most of you videos. Can you please make a very dumbed down version of how to get tensorflow, pandas, etc in the same environment on PyCharm. I am using Python 3.7 and PyCharm 2019 community version. I am biologist trying to get into ML and python, so forgive me if I am lost on these topics.

t.t.cooperphd
Автор

hey men, can you tell what is the equation?

bernardoolisan
Автор

TensorFlow, can energize page element. For example if they have updated the id, can an element TensorFlow update that id?

mrpimpita
Автор

very bad video, you did not explain well

bernardoolisan