CS-101
Introduction to
Python and ML
Libraries
Python 101
Python is a widely used high-level programming language used for
general-purpose programming, created by Guido van Rossum and first
released in 1991. An interpreted language, Python has a design
philosophy which emphasizes code readability (notably using
whitespace indentation to delimit code blocks rather than curly
braces or keywords), and a syntax which allows programmers to
express concepts in fewer lines of code than possible in languages
such as C++ or Java. The language provides constructs intended to
enable writing clear programs on both a small and large scale.
Python features a dynamic type system and automatic memory
management and supports multiple programming paradigms, including
object-oriented, imperative, functional programming, and procedural
styles. It has a large and comprehensive standard library.
Advantages of python
Functions Defined
Compound Data Types
Intuitive Interpretation
Quick & Easy to Learn
All the Flow Youd Expect
Sample program
>>> def fib(n):
>>> a, b = 0, 1
>>> while a < n:
>>> print(a, end=' ')
>>> a, b = b, a+b
>>> print()
>>> fib(1000)
Pip ( https://pypi.python.org/pypi/pip )
pip is a package management system used to install and
manage software packages written in Python. Many packages
can be found in the Python Package Index (PyPI).
pip is a recursive acronym that can stand for either "Pip
Installs Packages" or "Pip Installs Python".
Numpy ( http://www.numpy.org/ )
NumPy is the fundamental package for scientific computing with Python. It
contains among other things:
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
Besides its obvious scientific uses, NumPy can also be used as an efficient
multi-dimensional container of generic data. Arbitrary data-types can be
defined. This allows NumPy to seamlessly and speedily integrate with a wide
variety of databases.
Pandas ( http://pandas.pydata.org/ )
pandas is a software library written for the Python
programming language for data manipulation and analysis. In
particular, it offers data structures and operations for
manipulating numerical tables and time series. pandas is
free software released under the three-clause BSD license.
The name is derived from the term "Panel data", an
econometrics term for multidimensional structured data sets.
Matplotlib ( http://matplotlib.org/ )
Matplotlib is a Python 2D plotting library which produces
publication quality figures in a variety of hardcopy formats
and interactive environments across platforms. Matplotlib
can be used in Python scripts, the Python and IPython shell,
the jupyter notebook, web application servers, and four
graphical user interface toolkits.
Sklearn ( http://scikit-learn.org/stable/ )
Simple and efficient tools for data mining and data
analysis
Accessible to everybody, and reusable in various contexts
Built on NumPy, SciPy, and matplotlib
Open source, commercially usable - BSD license
Vast resource for non neural machine learning algorithms.
TensorFlow ( https://www.tensorflow.org/ )
TensorFlow is an open source software library for numerical
computation using data flow graphs. Nodes in the graph represent
mathematical operations, while the graph edges represent the
multidimensional data arrays (tensors) communicated between
them. The flexible architecture allows you to deploy computation
to one or more CPUs or GPUs in a desktop, server, or mobile
device with a single API. TensorFlow was originally developed by
researchers and engineers working on the Google Brain Team
within Google's Machine Intelligence research organization for
the purposes of conducting machine learning and deep neural
networks research, but the system is general enough to be
applicable in a wide variety of other domains as well.
Theano ( https://github.com/Theano/Theano )
Theano is a Python library that allows you to define, optimize, and evaluate
mathematical expressions involving multi-dimensional arrays efficiently.
Theano features:
tight integration with NumPy Use numpy.ndarray in Theano-compiled
functions.
transparent use of a GPU Perform data-intensive calculations up to
140x faster than with CPU.(float32 only)
efficient symbolic differentiation Theano does your derivatives for
function with one or many inputs.
speed and stability optimizations Get the right answer for log(1+x)
even when x is really tiny.
dynamic C code generation Evaluate expressions faster.
extensive unit-testing and self-verification Detect and diagnose many
types of errors.