First Neural Network

It being 2017, there’s an insane amount of machine learning research in all sorts of directions and for all sorts of applications. Dealing with large amounts of data is exactly the purpose of machine learning, but ironically, sorting through all the noise of so much research makes the field difficult to enter without a guide. There have been several excellent guides written, and this is my process.

A few things are in agreement across the various help guides:

  • Anaconda is the best. Install it now and don’t ask questions. If some people disagree, that’s fine, but if you’re starting out, their quips with anaconda won’t apply to you. Installing the GUI version with Python 3 is a good starting point. All things are easily customizable later, so this doesn’t matter much.
  • PyTorch is the 2017 golden child, but being new, doesn’t have as much documentation yet. Starting out with something more documented will help; then you can go back to investigating PyTorch.
  • Keras is great for researchers, and you’ll need to choose TensorFlow or Theano as the back end. TensorFlow was designed to replace Theano and is a good starting choice if you’re undecided.
  • MachineLearningMastery.com is a fantastic source of tutorials. Several are linked below in a logical order.

 

Without further ado, here are a few tutorials that will let you get the basics down (all from Dr. Jason Brownlee at Machine Learning Mastery).

  • Set up python via anaconda
  • Machine Learning in Python (optional, or skip to Neural Network below)
    • In the #Load libraries module, replace this line:
      from pandas.tools.plotting import scatter_matrix
      with this one:
      from pandas.plotting import scatter_matrix
      …and that takes care of the FutureWarning error
    • I found that the SVM model was better than KNN (probably due to some package upgrades), so you can also add this code to your tutorial scripts to run that one:
      # Make predictions on validation dataset
      svm = SVC()
      svm.fit(X_train, Y_train)
      predictions = svm.predict(X_validation)
      print(accuracy_score(Y_validation, predictions))
      print(confusion_matrix(Y_validation, predictions))
      print(classification_report(Y_validation, predictions))
  • Set up Deep Learning
    • For OS X, install XCode if you get warnings.
    • This uses Keras + TensorFlow or Keras + Theano. I chose TensorFlow.
  • Neural Network tutorial
  • MNIST and CNNs
  • Using Keras on Amazon Web Services (AWS)

Leave a Reply

Your email address will not be published. Required fields are marked *