Thursday, August 1, 2019

Introducing Machine Learning!

             My dad had me do another free Python course on Udacity this month, and I've found it very enlightening. It's opened my eyes to infinitely more Python possibilities using math machine learning, which showed me how  to teach a computer program to learn and adapt to data.
             One of the many things I learned from this course was the concept of bias-variance. A bias computer program entirely ignores its data, while a variance program abides very strictly to its data. Both properties don't work when they're extreme. A completely bias program doesn't work because when the computer doesn't use it's data, because the output will be completely random. A completely variance program doesn't work because it obeys its data so strictly that it can't adapt to new situations. That's why computer programs need the amount of bias and the amount of variance to be almost even.



              Another part of machine learning I learned about was decision trees. As the name goes, the model branches out like a tree to show different possibilities. It's useful for mapping out how a program should run, and helping me consider different possibilities.

             I also learned the difference between continuous and discrete data. Discrete data is limited by certain values, and it therefore countable. Continuous data can take on any value in a certain range. Because the amount of values in that range is infinite, this data isn't countable.
            I also learned about overfitting, which is when a data analysis is matched up too well with the data, making it inaccurate. This is because when a line fits too well with it's data, adding new data will make the line inaccurate.
             I learned about confusion matrices. A confusion matrix is a type of table I can use to check the performance of a classifying model. It's a summary of predicted and actual results, used to find out the performance of a model.
             Another thing I learned was cross validation, which is a method to test the performance of a model. It's done by dividing the set of data into two parts, training and testing. The model is trained with the training set and tested with the testing set to check that the model works.
             I learned lots of math in this course, which made this course extremely unique. While other courses taught me how to write in Python and use that knowledge to make programs, this course taught me some of the math behind the programming. 





Sunday, July 28, 2019

My Third Python Course


             The third Udacity course my dad had me take gave me lots of new Python knowledge. It blended my two last courses  and filled me with new knowledge, and helping me to understand Python better.
             I think this course was really engaging and I learned lots. I liked how some of it was review and some of it was new, because it made me think in different ways.
             I learned how to use Booleans, which are a kind of data that compare using true or false. There's <  for less than, > for greater than, <= for less than or equal to, >= for greater than or equal to, == for equal to, and != for not equal to. This can be used in lots of ways, like for checking whether an answer is right or wrong, or if an object is one or the other.
             I learned about break, too. The break keyword will stop a loop once the program detects that a certain condition has been met. 
             I also learned about variable scope, which refers to specific parts of a program a certain variable can be used in. For example, a variable created inside a function can only be used inside that function. But if a variable is created outside a function, it can be used anywhere in the program, which I thought was interesting.
             What I also learned was lists, types of data that can be defined as variables that have inside them a list of strings. It's defined with square brackets, and always has in it data separated by commas. They have a specific order, and can be looked up by their number in their sequence.
             One thing my second course taught that this course didn't was how to connect python with the outside world, like opening up web browsers, but this course was nevertheless extremely fun and useful, and it makes me very excited for whatever I will learn next.
List Example

Saturday, July 6, 2019

Project Idea

             Since I learned so much about Python through my Udacity courses, my dad suggested that I share some of the enriching ways to code that I learned. So, in this post I will walk through how I would program my computer to alert me on the day a movie I want to watch comes out in theaters, an idea I got from my second Udacity course.
             As an example, I will code the program to alert me in four days by opening a browser that shows the date that the movie comes out.
Step 1
             The first thing I will do is use a really useful function called "webbrowser.open," which will control the browser that will come up when the movie comes out. I've used youtube as an example, but a more specific link can be put there instead.
Step 2
             When I've tested this code and made sure that it works, I will move on to control how long the program will wait before opening this browser. I will use the "time.sleep" function to make the program wait for eight seconds first, to test the program easier.
Step 3
             Once I'm sure that the program works, I will now make the program wait four days. Since the computer counts time in seconds, I multiply the numbers to make the program wait the right length.
             If I want to have the program remind me every day after that for four days, I can also add a loop to my code.
Step 4
             There are lots of other ways to use these same functions, and that's one of lots of reasons I like Python. Making this code reminds me of all the possibilities learning Python opens up, and it makes me feel empowered.


             

Wednesday, June 19, 2019

A Second Udacity Course


             This summer my dad had me start another free Python course on Udacity, called Programming Foundations with Python, and I finished it recently. This course was a lot shorter than my past one, but it wasn't any less exciting or fun. The course been an intriguing, learning-packed course for me, combining what I learned in my last course with new projects that relate more to the real world.
             What I really liked about this course was how everything was well explained, so I could really understand each lesson and really get engaged. I could follow each lesson without having to watch the video more than twice.
             The lessons were also well thought out, which was also very nice. Everything was explained in multiple ways to ensure that I understood what was going on, and the lessons were well organized.



             Taking this course made me think about all the possibilities out there, all the different kinds of ways I could use Python. It made computer science and artificial intelligence seem much less daunting and much more... possible. I would certainly recommend taking this free course.
             

Tuesday, May 28, 2019

Udacity!

             Months ago, my dad had me start an online learning course on a wonderful site called Udacity. I got started on a really cool course that teaches a programming language called Python, and it was really interesting. I learned a lot from it, even though it was very difficult. I know this information could be really useful in the future, and that make Python even more fascinating!
            Udacity has some free courses and some that cost money, so my dad set me up on an awesome free course introducing me to Python. The course was a little hard but very rewarding. The course was very engaging. It was really fun, solving problems using Python.
            I think the way the course worked was really clever. There were thirty lessons, teaching different enthralling aspects of Python. In each lesson, there were lots of videos showing how to do new things, and there were plenty of quizzes to test how much we learned. It was fun to use my knowledge, knowing that this could intensify into solving real world problems.
            I've finished the course now, and I feel really enlightened, even though I know how much I have yet to learn about computer science. It was cool to learn so much in what feels like such a short amount of time, and I am pleased in my progress in learning about programming so far.  I am excited for my next project, and I hope it's just as fascinating as my previous ones have been!

Friday, October 12, 2018

Rock, Paper, or Scissors?

             I recently worked on a MachineLearningForKids project that I thought was very interesting. The computer was supposed to be designed to recognize whether a hand was rock, paper or scissors. Then the computer was supposed to retaliate. At first, my idea was that I would get the computer to always win. 
             I started by downloading a worksheet, as usual. And I named my new, awesome project "Rock, Paper, Scissors" and started training it to recognize images.

             So the first part in training my computer was to get it to recognize what each hand gesture in the game "Rock, Paper, Scissors" looked like. So I worked on the basics of getting the computer trained to know what  "rock", "paper", and "scissors" hand gestures looked like. I made three bins, for rock, paper, and scissors. I used ten examples for each of the training bins and then hit the "train" button. Then the website said that I was out of API keys, so I had to stop my project for a while for more. 
             When I finally came back to my project, I trained it and started coding on Scratch. When I finished, it turned out that the computer couldn't support a file. Except the computer wouldn't say what the picture was. So I tried to delete all the "paper" pictures and get new ones, but that didn't work either. 
             I had been pretty sure that the problematic picture had been paper, but it wasn't. Or at least, I wouldn't know whether it was or not, because I had run out of API keys again. I sure ran out of keys faster than I anticipated. 
             Maybe I will have better luck next month. I know machine learning can be frustrating sometimes, but as long as I stick to it with determination, I won't let API keys stop me from a bright future in AI. 
             

Chat bots!

              I was on MachineLearningForKids today, and I worked on a project called Chat bots.  (The worksheet had no space between the chat and the bot, but blogger.com says I spell it wrong if I write it without a space.) The idea of the project was to have a sprite on Scratch that answered certain questions on a certain topic. My dad really wanted me to do this project, so I did.
The alligator was supposed to be a
branch, but it looked too much like a creature.
             The first thing I did on this project was create three bins. One of them was habits, one was appearance, and one was food. Since I was doing my project on griffins, I wrote questions about griffins into each bin, making sure they fit the category. Then I went to Learn and Test and hit the train button. 
             When my project was done training, I opened the project in Scratch and started working on the code and sprites. I made a griffin sprite, and a lot of backgrounds, with also a lot of code. Once I had finished that, I checked to see if the project worked. When it did, I showed it to my dad.
             My dad didn't like the project I made because it could only answer three types of questions, so I had to redo it with more answers and questions. For that I made another bin and called it "What." Then I added all the questions Dad had asked before, and added some more, so that if someone typed in something confusing the sprite would say, "What?!". I tested it again.
             This time, my project didn't work. It kept mixing up "Habits" and "What".  So I tried to see what the problem was. I couldn't find anything, so I retrained the project. Then it worked. 
             In the end, the project was really cool. When someone asked about a griffin's diet, I  made the griffins sprite explain the diet of a griffin, then I programmed it to appear to eat the screen. When the computer was asked a question  that was very weird, the griffin sprite would say, "What?!" I thought that was really awesome.