M L Tutorial

Machine Learning Tutorial – Numpy

Code : import pandas as detailsimport numpy as npdata={‘Father’:[10,20,40,50,6], #dictionary‘Son’:[1,3,6,9,9],}obj=details.DataFrame(data) _x_Mean=obj.loc[:,’Father’].mean()_y_Mean=obj.loc[:,’Son’].mean()print(“The Mean of Father : “+str(_x_Mean))print(“The Mean of Son : “+str(_y_Mean)) Father=[10,20,40,50,6]data=np.array(Father)print(data.mean()) Output : Numpy code Output : import numpy as npX=np.random.randn(3,2) #taking values rondomlyX=np.matrix(X)print() # print() used for new lineprint(“The Matrix x: “)print(X)print() Y=np.random.randn(2,2)Y=np.matrix(Y)print(“The Matrix Y: “)print(Y)print()print(“The Matrix XY: “) print(XY)print()print(“Arange :”)data=np.arange(16).reshape((4,4))print(data)print(data.T)print() print(X.mean())print()#printing minimum …

Machine Learning Tutorial – Numpy Read More »

Machine Learning Tutorial – Matplotlib, Bar, Graph, Pie Chart, Histogram

-Matlplotlib library was initially developed by john D.Hunter in the year 2003 and keep releasing the updated versions at regular intervals. 1.Basic ploting import matplotlib.pyplots as plt plt.plot[[2,4,5,6],[3,5,6,2]] plt.show() 2.Legends,Labels and Colors x1=([2,4,5,3,6]) y1=([4,6,7,2,1]) x2=([9,4,6,7,6]) y2=([4,6,5,1,0]) plt.plot(x1,y1,linestyle=’–‘,c=’r’,label=’Line 1′) plt.plot(x2,y2,linestyle=’-‘,c=’g’,label=’Line 2′) plt.legend() plt.title(“Matplotlib Demo”) plt.xlabel(“x-value”) plt.ylabel(“y-value”) plt.xticks([2,4,5,3,6]) plt.yticks([4,6,7,2,1]) plt.show() plt.savefig(“plots.img”) 3.Bar plot and histogram import numpy …

Machine Learning Tutorial – Matplotlib, Bar, Graph, Pie Chart, Histogram Read More »

Machine Learning Tutorial – Numpy

Python – Numpy -Numpy is a python library designed for scientific calculation while working with datasets.-It is originally developed by Travis Oliphant and later open-sourced under BSD-license-First developed in the year 2006 and keep updating the library at regular intervals of time.-Numpy is an abbreviation for Numerical Python working with numpy# installing numpypip install numpy …

Machine Learning Tutorial – Numpy Read More »

Scroll to Top