Video on Machine Learning Algorithms in Tamil – இயந்திர வழிக் கற்றல் நெறிமுறைகள் அறிமுகம் – காணொளி

Introduction to Machine Learning Algorithms in Tamil
Simple Linear regression
Multiple Linear Regression

இயந்திர வழிக் கற்றல் நெறிமுறைகள் அறிமுகம்

மேலும் அறிய, பின் வரும் இணைப்புகள், நிரல்களைக் காண்க.

Machine Learning – பகுதி 4

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.

 import matplotlib.pyplot as plt x=[[6],[8],[10],[14],[18],[21]] y=[[7],[9],[13],[17.5],[18],[24]] plt.figure() plt.title('Pizza price statistics') plt.xlabel('Diameter (inches)') plt.ylabel('Price (dollars)') plt.plot(x,y,'.') plt.axis([0,25,0,25]) plt.grid(True) plt.show()

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.

 import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression x = [[6], [8], [10], [14], [18]] y = [[7], [9], [13], [17.5], [18]] model = LinearRegression() model.fit(x,y) plt.figure() plt.title('Pizza price statistics') plt.xlabel('Diameter (inches)') plt.ylabel('Price (dollars)') plt.plot(x,y,'.') plt.plot(x,model.predict(x),'–') plt.axis([0,25,0,25]) plt.grid(True) plt.show() print ("Predicted price = ",model.predict([[21]]))

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.

 from sklearn.linear_model import LinearRegression import numpy as np x = [[6], [8], [10], [14], [18]] y = [[7], [9], [13], [17.5], [18]] model = LinearRegression() model.fit(x,y) print ("Residual sum of squares = ",np.mean((model.predict(x)– y) ** 2)) print ("Variance = ",np.var([6, 8, 10, 14, 18], ddof=1)) print ("Co-variance = ",np.cov([6, 8, 10, 14, 18], [7, 9, 13, 17.5, 18])[0][1]) print ("X_Mean = ",np.mean(x)) print ("Y_Mean = ",np.mean(y))

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.

 from sklearn.linear_model import LinearRegression import numpy as np from numpy.linalg import inv,lstsq from numpy import dot, transpose x = [[6], [8], [10], [14], [18]] y = [[7], [9], [13], [17.5], [18]] model = LinearRegression() model.fit(x,y) x_test = [[8], [9], [11], [16], [12]] y_test = [[11], [8.5], [15], [18], [11]] print ("Score = ",model.score(x_test, y_test))

view raw

04_scoring.py

hosted with ❤ by GitHub

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.