Ad

Saturday, March 2, 2019

Udacity Machine Learning Nanodegree Mega Review Part 2

Lesson 2 Introduction to Regression
See more in the series visit the main course outline page



Cross validation: any train test validation split should be representative of the real world dataset. Else the model is invalid. Can compare stats, representation, distribution.  IID independently identically distributed, drawn from same distribution. Fundamental assumptions of algorithms.

Lesson 3 More Regression

Section by Georgia Tech, professor also led courses for ML for finance. He's really good. Much better than many Georgia Tech instructors who gave contents for Udacity.

.2 Parametric regression
Basic line is y=mx+b
Parameters are m,b
There are regions of the data the line cannot track because it's just a line. We can then use higher degree polynomial.
y = m_2 * x**2 + m_1 * x + b
m_2,m_1, b are the parameters.

Lesson 3 Supervised Learning
Lesson 3 More Regressions
.3 K Nearest Neighbors
Data centric approach, instance based approach. Example historic data, weather prediction based on weather data.
Identify related datapoints, then what to do? : use the mean of their y values, or prediciton values. voting

Kernel Regression: weigh each data point based its distance. KNN each data point is weighted equally.

Parametric vs Non Parametric
Yes, the cannon ball distance can be best estimated using a parametric model, as it follows a well-defined trajectory.


On the other hand, the behavior of honey bees can be hard to model mathematically. Therefore, a non-parametric approach would be more suitable.

Biased means theres a formula for it. It's biased towards the math formula. There's no formula for the other method, so it's unbiased.

Parametric don't have to store original data, space efficient, however if there's new data, we cannot update it. Training is slow, querying is fast.

Non parametric querying is slow. Need to store all data points. Easily add new data points. (Kind of like Neo4j). Training is fast. Avoid assuming type of model such as linear or quadratic. If complex, we don't need to assume.

.7 Quiz : which problems are regression useful
.8  Quiz: Are polynoials linears: is polynomial regression still linear?
yes: the space of polynomials is linear in its coeffecients.

Lesson 4 Regressions in sklearn
.1 Quiz Continuous Output Quiz : 

Udacity Machine Learning Nanodegree Mega Review Part 8

Markov Decision Process


See more in the series visit the main course outline page

Important
Lesson 2 Markov Decision Process
.5 Markov Decision Process - 1: single agent, there are STATES s - a set of tokens that represent every state one can be in - which part of the grid I am in - the entire grid minus blocked states, (x,y) coordinates, process for making decisions, MODEL T(s,a,s')~Pr(s'|s,a)

.6 Markov Decision Process - 2:

Action things you can do in a particular STATE: UP DOWN LEFT RIGHT
Action is also a function of state A(s), or a set of actions - A

Model aka the transition model describes the rule of the world. How to play the game.

The transition Model is a function of two variables state, action, next state aka state_prime.

S' can equal to S : means to stay.

The transition model outputs the probability one would end up at S' given that person is transitioning from S with action a

Deterministic case: means there is no noise. Take every action with certainty: 100%. In nondeterministic, action execute faithfully 80% of time, 0.8, 0.1, 0.1,

Model describes the rule of the game. Also captures what happens if you do something. Physics of the world.
Pr(S'|S,A)
Transition models are probablistic by nature
.7 Markov Decision Process - 3: Markovian property, Markov means you don't have to condition on everything pass the most recent state - Markov only the present matters. Only depends on current state s. Pr(s'|s,a) there's only one dependency on s not s1 s2 s3.

You can turn anything into markovian process by making sure the current state remembers anything from the past.

Second property of MDP: nothing ever changes, things are stationery, these rules don't change over time.

Reward : R(s) for being in a state, R(s,a) reward for being in a state and take an action,  R(s,a,s') being in a state take an action and end up in s'. All mathematically equivalent. Intuition:
Green or goal is great. Want to be there. Red is punishment, restricted area. Encompasses the domain knowledge. Usefulness of entering that state.

.8 Markov Decision Process - 4: MDP describes a problem, the solution is described in Pi or policy. Pi(s) --> a takes in a state, and outputs the action to take. It's a solution to the MDP.

Pi* or policy star is the optimal policy that maximizes your long term reward across time.

Autoencoder Decoder Notes Cheatsheet from Udacity Deep Learning Nanodegree


  • Auto encoder decoder are two neural networks that are trained to encode, and then decode the input based on training data and examples. The goal is to compress with little loss and decode to get as close to the original as possible while getting performance gain and efficiency. 
  • Encode is to obtain a compressed representation of the input
  • Decode is takes the representation from encoders and try to reconstruct the original input
  • A compressed representation can save space, time, and improve performance of  storage, serving and other computer, network tasks 
  • The depth dimensions should change as follows: 784 inputs > encoding_dim > 784 outputs.

Machine Learning & Deep Learning Extra Curricular Reading List


  • Best LSTM articles Article 1 Lecture on LSTM  Article 2 Article 3
  • LSTM overview
  • https://pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.html
  • https://pytorch.org/docs/stable/_modules/torch/nn/modules/rnn.html
  • https://pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.html
  • https://towardsdatascience.com/understanding-bidirectional-rnn-in-pytorch-5bd25a5dd66
  • This Is How Google Rejected Me Just To Tell Me “Yes” The Year After https://blog.pramp.com/this-is-how-google-rejected-me-just-to-tell-me-yes-the-year-after-d1c49dc53f88
  • Introduction to Recurrent Neural Network (important, high quality) https://www.cpuheater.com/deep-learning/introduction-to-recurrent-neural-networks-in-pytorch/
  • Highly recommended article on learning rate
  • Uniqtech Co Data Science Bootcamp


Neo4j Building the BBC GoodFoods Graph (Neo4j Online Meetup #51) Notes Transcript Lessons Learned









Building the BBC GoodFoods Graph (Neo4j Online Meetup #51) Food Data great for testing out all important neo4j features. Great dataset for illustrating Neo4j's capability for name entity management, master data management, knowledge graph. First look for an API for the data. Almost people scrape if not available. Beautiful Soup. Hard to ID ingredient, trained a ML to recognize that. Nice JSON object in Page Source. On the top of the page. Cool tip to scrape. File with a stream of JSON one per recipe. Decode using a library from JavaScript code and JSON to Python Dictionary. Some exception handling if no data, can skip recipe. Use apcjones.com to construct the graph. Design a graph model first: model the data also needs to find out what question do we want to ask the data. Neo4j easy to change. Don't have to get the model right the first time. Materials available in github. Also a browser guide. Tool called arrows:Create node, entities, the nouns in the data. First node Recipe. Click into the apcjones node, add title as property example title: Chocolate Cake. https://youtu.be/nEIJmH6FIjs?t=643


Tools for Finding a Job in the Silicon Valley

Disclaimer: this is an article on cool and fun tools and best practice, tips to find you find a good job in Silicon Valley especially among the tech unicorns. This is a personal blog and I am not a career counselor. That being said, I have been to tons of company events and can give some good insights.

For recent graduates:

Best Practice & Extra Tips:
  • Feeling stuck in your mid career? Need a renewal? Haven't worked for a while? Consider being a part-time student for a master degree, or an online degree, but look for jobs at the same time. Don't just get one degree after another. Trust me I know how nice that is. I did it. But it can also be a trap.
  • For new moms: some corporate responsibility programs offer career job positions who women who have left work for child rearing. For example, Lending Club's recent job post on LinkedIn (Feb 2019) "The Path Forward Return to Work program at LendignClub is a 16- week paid returnship for ... mother". Google "return to work", "returnship".

Tools for interview preps:
  • Pramp for technical interviews, data science and product management

Udacity Machine Learning Nanodegree Mega Review Part 9

Udacity Machine Learning Nanodegree (MLND) Capstone Project Guidelines

See more in the series visit the main course outline page

Capstone Proposal
Technical proposal highlighing the real world problem, research done so far, and your research and approach in the field. Identify the correct datasets. Use Kaggle or DevPost to identify a problem. Proposal has to match final project. Kaggle might have already defined some of the requirements. Basic datasets like the MNIST cannot be used. Can use a representative sample of a large dataset. In essence Kaggle is the fastest. Discuss each section of the proposal. Be as detailed as possible. The requirement is high. As always Rubric is the most important evaluation criteria. Provide all important supplement materials.

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid