In [11]:
import pandas as pd
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
In [3]:
from sklearn.preprocessing import normalize, minmax_scale
In [4]:
df = pd.read_csv('datasets/dataset2.csv')
In [5]:
df['average_montly_hours'][:10]
Out[5]:
In [6]:
hours = df['average_montly_hours'].values
It is also known as least absolute deviations (LAD), least absolute errors (LAE). It is basically minimizing the sum of the absolute differences (S) between the target value (Yi) and the estimated values (f(xi))
To understand easily, its just adding all the values in the array and dividing each of it using the sum
In [22]:
result = np.array(minmax_scale(df['average_montly_hours'].astype(float).values.reshape(1,-1), axis=1).reshape(-1,1))
In [26]:
result
Out[26]:
In [25]:
stats.describe(result)
Out[25]: