Friday, November 10, 2017

Deep Learning Basic Concepts


Pruning :  Pruning is a technique in machine learning that reduces the size of decision trees by removing section of the tree that provided little power to classify instances. Pruning reduces the complexity of the final classifier and hence improves the predictive accuracy by the reduction of over-fitting.


Over-Fitting: In the process of over-fitting , the performance of the training examples still increases but the performances of the unseen data becomes worse.

    Usually a learning algorithm is trained using some set of "trained data". Exemplary situations of which the desired output is known. The goal is that the algorithm will also perform well in predicting the output when fed "validation data" that was not encountered during its training.

    Making the function more complex will improve the performance in trained data set but it will effect the more error rate ( or less prediction)  rate in unseen data. This situation called Over-Fitting.


Supervised Learning: A Supervised learning algorithm analyzes the training data and produces the inferred function, which can be used for mapping new examples. An optimal scenario will allow for the algorithm to correctly determine the class labels for unseen instances.  This requires the learning algorithm to generalize from the training data to unseen situations in a reasonable way.


https://dataaspirant.com/2014/09/19/supervised-and-unsupervised-learning/


Unsupervised Learning:  Its a type of  machine learning algorithm used to draw inferences from data-sets consisting of input data without labeled responses . The most common unsupervised learning is cluster analysis, which is used for exploratory  data analysis and find hidden pattern or grouping in data.


Logistic Regression :  The logistic regression is one member of supervised classification algorithm family. The building block concepts of logistic regression can be helpful in deep learning while building the neural networks.
 
     Logistic regression classifier is more like a linear classifier which uses the calculated digits (score) to predict the target class.

    Logistic regression model will take the feature values and calculate the probabilities using sigmoid or softmax functions.

    The  sigmoid function used for binary classification problems and Sofmax function used for multi-classification problems.

https://dataaspirant.com/2014/10/02/linear-regression/

https://dataaspirant.com/2017/03/02/how-logistic-regression-model-works/

http://dataaspirant.com/2017/04/15/implement-logistic-regression-model-python-binary-classification/

https://dataaspirant.com/2017/03/07/difference-between-softmax-function-and-sigmoid-function/



Learning Python

Some of simple new features in Python that are not exist in C:

Getting integer result with devision :

x = 50 / 6  = > x = 8.333  (float value)

If we want integer operation try with "//" mark.

x = 50//6 = 8


int(A) => returns error 


Name = "Michael Jackson"

Name[0]: M
Name[14] : n

We can also use negative indexing for strings.

Name[-15]:M
Name[-1]: n


String Slicing:
Name[0:4] = Mich
Name[8:12]= Jack

String Stride:



Name[::2] = "McalJcsn"  => 2 indicates every 2nd variable.


String Stride and Slice:


Namw[0:5:2]="Mca"

0:5 means = [0:5) = It includes 0 and excludes 5. So consider only 0 to 4 .

[0:5:2] means Slice with 0 to 4 and stride with every 2nd variable with that slice limit.


Tuples :
Tuples are written as comma separated elements within parentheses.

Tuples are immutable.   



Ratings[2] = 4 gives error. Tuples are immutable . We can not change values in Tuples.

Due to immutable property of Tuple , if we want to manipulate tuple we need to create new Tuple.


Lists:

Lists are mutable. Lists are represented in Square Brackets.

Extend method will add as separate elements in the final list. See "pop" and 10 become separate elements in the list.

Append method will add as list as single element. See ["pop" ,10] becomes a list in the list at 3rd position.

List cloning:
A = [ "Cloning" , test , 10 , 2.1]
B = A   => Both A and B referring to the same list . Both are having same reference.

B = A [ : ]

Here Both A and B having same list elements because B formed by new copy of the elements from A. 


Sets:
Sets are created using Curly Brackets. 


Dictionaries:

dir(NameofObject): Will return the list of attributes in that class.