Category «Tensorflow»

keras-Tensorboard

Many times we need to visualize our model on Tensorboard, for this we have to save our model and at runtime check out the performance. Here is the code for a simple linear regression using Keras and tensorboard. import Libraries: import keras import numpy as np from pandas import read_csv from keras.models import Sequential from …

Heteroscedasticity (Heteroskedasticity)

Heteroscedasticity refers to the condition in which the variability of a variable is unequal across the range of values of a second variable that predicts it. A scatterplot of these variables will often create a cone-like shape, as the scatter (or variability) of the dependent variable (DV) widens or narrows as the value of the independent …

CNN

CNN stands for convolutional neural network. It is mostly used for developed for object recognition tasks such as handwritten digit recognition. There are four types of layers in a Convolutional Neural Network: 1. Convolutional Layers. 2. Pooling Layers. 3. Fully-Connected Layers. 4.Dropout layers. CNN is just a function which operates on another function in the below …

Gradient Descent

Gradient Descent Gradient Descent is an optimization algorithm that optimize the cost of the function.The goal is to continue to try different values for the coefficients, evaluate their cost and select new coefficients that have a slightly better (lower) cost. https://www.hackerearth.com/blog/machine-learning/3-types-gradient-descent-algorithms-small-large-data-sets/ https://medium.com/@zhaoyi0113/python-implementation-of-batch-gradient-descent-379fa19eb428 https://www.analyticsvidhya.com/blog/2017/03/introduction-to-gradient-descent-algorithm-along-its-variants/  

How to calculate score in Machine Learning

In order to calculate score of different types of Algorithm we use following types of methods, few methods from SkLearn library are mentioned below.   Scoring Function Comment Classification ‘accuracy’ metrics.accuracy_score ‘average_precision’ metrics.average_precision_score ‘f1’ metrics.f1_score for binary targets ‘f1_micro’ metrics.f1_score micro-averaged ‘f1_macro’ metrics.f1_score macro-averaged ‘f1_weighted’ metrics.f1_score weighted average ‘f1_samples’ metrics.f1_score by multilabel sample ‘neg_log_loss’ metrics.log_loss …

Classes in Python

A class is a wrapping of data member and  member function inside a single unit. Lets take an example of a Interest class in which we have members, principal, rate and time. We have member function as SimpleIntrest. class Interest(): rate=3.5 def __init__(self,p,t): #Data Members self.principal=p self.rate=self.rate self.time=t self.si=self.principal*self.rate*self.time/100 pass #Memeber Function def SimpleIntrest(self): print(self.si) …