Teko's ML training program

Machine learning crash course

2. First step with TensorFlow

Presented by Thuc NC and Thanh NTD

### Content 1. A `numpy` tutotial 2. Introduction to `pandas` 3. TensorFlow toolkits introduction 4. Example with TensorFlow

A numpy tutotial

NumPy is the fundamental package for scientific computing with Python, containing:
  • a powerful N-dimensional array object
  • sophisticated (broadcasting) functions
  • tools for integrating C/C++ and Fortran code
  • useful linear algebra, Fourier transform, and random number capabilities

A numpy tutotial

  • Compare to Python list: faster, more convenient, more compact, with more functionality
  • Check out the notebook at out git repo here
  • Open numpy_tutorial.ipynb with Jupyter notebook

Introduction to pandas

  • Pandas is a python library for data analysis and modeling
  • Data structure with rows and columns called data frame that looks similar to a table
  • Many ML frameworks support pandas data structures as inputs
  • Excel (~5MB) --> Pandas (~5GB) --> Distributed (spark...)

Learning objectives

  • Gain an introduction to the DataFrame and Series data structures
  • Access and manipulate data within a DataFrame and Series
  • Import CSV data into a pandas DataFrame
  • Reindex a DataFrame to shuffle data

Programing example

  • Check out the notebook at out git repo here
  • Open pandas_tutorial.ipynb with Jupyter notebook

What is TensorFlow?

A computational framework for building machine learning models

  • TensorFlow provides a variety of different toolkits that allow you to construct models at your preferred level of abstraction

tf.estimator API

Will be the majority of exercises in Machine Learning Crash Course


import tensorflow as tf

# Set up a linear classifier.
classifier = tf.estimator.LinearClassifier(feature_columns)

# Train the model on some example data.
classifier.train(input_fn=train_input_fn, steps=2000)

# Use it to predict.
predictions = classifier.predict(input_fn=predict_input_fn)
  						

Programming exercise with TensorFlow

  • Use the LinearRegressor class in TensorFlow to predict median housing price
  • Evaluate the accuracy of a model's predictions using Root Mean Squared Error (RMSE)
  • Improve the accuracy of a model by tuning its hyperparameters

Programing demo

  • Check out the notebook at out git repo here
  • Open MLCC_first_steps_with_tensor_flow.ipynb with Jupyter notebook
## Thank you!