Education


python_machine_learning

Earlier this year, Packt Publishing asked me to be a technical reviewer of one of their upcoming books, “Building Machine Learning Systems with Python” by Willi Richert and Luis Pedro Coelho. Now the book is available for purchase and they have asked me to write a little about it. I haven’t read through the finished product myself, so I don’t know if the authors followed any of my advice, but I should note that English appeared to be their second language, so the book will likely be a little rough.

However, the content is interesting and I thought it was fairly comprehensive. They appeared to know what they were talking about. A lot of this book is over my head as I am not a scientist or engineer in the topic that this book covers. Basically, this book is about data mining using scikit-learn, mahotas and jug. You will learn about such heady topics as computer vision, basket analysis, how to classify data, etc.

You can check the book out on Packt’s website or on Amazon.

UPDATE (2013-08-22) – One of the authors commented on this post to let me know that they’ve cleaned up the text.

My wife teaches 3rd grade math and she recently learned about the process of obtaining the digital root of numbers. The digital root is a single digit number found by summing the individual digits. So for 15, you would add 1+5 to get 6. Thus 6 is the digital root of 15. The trainer that my wife worked with explained that you can check your answers using the digital root, which will give children another way to find out if their answer is correct. Here is an example:

15   1 + 5 = 6
+12   1 + 2 = 3
      6 + 3 = 9
----
 27   2 + 7 = 9

So here we have two operands: 15 and 12. If you add those together, you get 27. To check your answer using the digital root, you add the individual digits in the two operands as above. So 15 becomes 1+5 or 6 and 12 becomes 1+2 or 3. Then you add those two roots together to get 9. Then you check your answer by adding up its digits, which in this case is 2+7 which equals 9. The rules are slightly different for subtraction, multiplication and division. We’ll be looking at addition, subtraction and multiplication. We are skipping division because I haven’t found a good explanation for how it works and I don’t want to just use formulas that I can’t explain.

At this point you’re probably wonder where Python comes in. We’ll use wxPython to create a simple GUI that will allow us to see how this works. Let’s start coding! (more…)

I first heard about Blaze from NumPy’s original developer’s blog back in December 2012. A few days ago, InformationWeek announced that DARPA was funding the project to the tune of $3 million dollars to get some big data libraries written for Python. There will be two new projects, Blaze and Bokeh. Blaze will be an extension of NumPy and SciPy and make those libraries big data friendly. The Bokeh project will be for big data visualization.

Blaze will be open source. You can read more about it here. I was unable to find a specific link to the Bokeh project.

Python provides a very powerful logging library in its standard library. A lot of programmers use print statements for debugging (myself included), but you can also use logging to do this. It’s actually cleaner to use logging as you won’t have to go through all your code to remove the print statements. In this tutorial we’ll cover the following topics:

  • Creating a simple logger
  • How to log from multiple modules
  • Log formatting
  • Log configuration

By the end of this tutorial, you should be able to confidently create your own logs for your applications. Let’s get started! (more…)

SQLite is a self-contained, server-less, config-free transactional SQL database engine. Python gained the sqlite3 module all the way back in version 2.5 which means that you can create SQLite database with any current Python without downloading any additional dependencies. Mozilla uses SQLite databases for its popular Firefox browser to store bookmarks and other various pieces of information. In this article you will learn the following:

  • How to create a SQLite database
  • How to insert data into a table
  • How to edit the data
  • How to delete the data
  • Basic SQL queries

This article will be similar in function to the recent SQLAlchemy tutorial that appeared on this site earlier this month. If you want to inspect your database visually, you can use the SQLite Manager plugin for Firefox or if you like the command line, you can use SQLite’s command line shell (more…)

This blog ran an article about wxPython, SQLAlchemy, CRUD and MVC earlier this month. The program that we created in that post was dubbed “MediaLocker”, whether or not it was explicitly stated as such. Anyway, since then, I have received a couple comments about improving the program. One came from Michael Bayer, one of the creative minds behind SQLAlchemy itself and the other comments came from Werner Bruhin, a nice guy who haunts the wxPython mailing list, helping new users. So I went about creating an improved version of the code following their advice. Werner then improved it a bit more. So in this article, we will be looking at improving the code, first with my example and then with his. Enough talk though; let’s get to the meat of story! (more…)

In this article, we will be creating a program to store our personal books or perhaps just the books you’ve read. It will demonstrate how to combine wxPython and SqlAlchemy, a SQL Object Relational Mapper (ORM). This program will also give you an introduction to the model-view-controller (MVC) and “create, read, update and destroy” (CRUD) methodologies. The aim is to show you how to create an application that can do the following:

  • Create a database (create)
  • Add records to that database (sort of create)
  • Display the records (read and view)
  • Modify records (update)
  • Delete records (destroy)

The order of this tutorial will follow MVC, so we will start with the model. The model is the basis for the GUI (the View) anyway, so it’s a good place to start. (more…)

It’s been a while since I have done any interesting Python links. I quit for a while because these things take a while to put together and few seemed interested, but I’ll give it another go. This week has a really interesting article on Python and robots. Jesse Noller has a fun article where he collects various Python stories too (I nabbed a couple of his picks for mine too because he was right: they are interesting!)

If you think I missed something awesome that happened in the Python world recently, let me know in the comments and maybe I’ll add it next time. Thanks for your support!

As PyCon approaches, the blogger community was invited to interview the speakers that are coming to the event. I chose Wesley Chun, writer of Core Python Programming and co-author of Python Web Development with Django. In this interview, I ask Wesley about his talk, Running Django Apps on Google App Engine and about PyCon in general. Let’s see what he has to say: (more…)

This weekly edition of Python News has quite the variety of topics. You can learn about how to create passwords, the new Enthought Python Distribution and about something called pylibftdi. Plus, I’ve added a section just for PyCon related stuff since they seem to be releasing a lot of info this month. For example, there’s an interview with Armin Ronacher (author of Flask) in that section.

PyCon News

So far no one has ever given me any leads for my next article, so that either means I’m doing something right or no one’s reading these posts. Well, as always, I will take a look at any links that my kind readers give me.

« Previous PageNext Page »