Skip to main content

Machine learning : Random Forest Regression machinelearningtechnilesh

 Machine Learning :Part 4: Random Forest Regression ( Last Regression model )


We were learn all the stuff regrading the Machine learning . 
For Video Lecture on Machine Learning : Decision Go at bottom or google codewithnilesh.


Random Forest tree ( regression ) technilesh - bytecode.technilesh.com



Actually The
Random Forest Regression ( Tree )  is collection of many Regression model and the collection of Decision Trees . The Random Forest Regression is part of  Ensemble Learning . The Ensemble learning is collection of many models and collection of process to get accurate and prediction.

In Forest Tree model the NO of Decision tree is directly propositional to the accuracy of prediction.




Step 1 : Data Preprocessing :

Initially Import all Libraries like Pandas , numpy , matlibplot pyplot & Sklearn
using the pandas take data and classify in to dependent and independent variable.

Code :

Garry Raut ( Machine learner

import numpy as np 
import pandas as pd
import matplotlib.pyplot as plt

dataset = pd.read_csv('position_salaries.csv')
X = dataset.iloc[: , 1:2].values
Y = dataset.iloc[: ,2].values

The data in Position Salaries file is :
Position                                            Level                                 Salary
BusinessAnalyst                               1                                        45232
JuniorConsultant                              2                                        52300
Senior Consultant                            3                                        62300
Manager                                         4                                        84300
Country Manager                             5                                       110540
Region Manager                               6                                       160000
Partner                                           7                                        250000
Senior Partner                                 8                                        341231
C-level                                            9                                        670000
CEO                                               10                                       3000000



After this go to the Secound Step


Step 2 : Random  Forest Regression

this is simple code for calling random forest Regressor.
from sklearn.ensemble import RandomForestRegression
regressor = RandomForestRegression(n_estimator=10)regressor.fit(X,Y)


Full Source Code 
:
import numpy as np 
import pandas as pd
import matplotlib.pyplot as plt

dataset = pd.read_csv('position_salaries.csv')
X = dataset.iloc[: , 1:2].values
Y = dataset.iloc[: ,2].values

from sklearn.ensemble import RandomForestRegressor
regressor = RandomForestRegressor()
regressor.fit(X,Y)



def desion():
    X_grid = np.arange(min(X), max(X), 0.1)
    X_grid = X_grid.reshape((len(X_grid), 1))
    plt.scatter(X, Y, color = 'green')
    plt.plot(X_grid, regressor.predict(X_grid), color = 'blue')
    plt.title('Truth or Bluff (Support Vector Regression Model)CodewithNilesh')
    plt.xlabel('Position levelCodewithNilesh')
    plt.ylabel('SalaryCodewithNilesh')
    plt.show()
desion()

Result :
Taken by @ Garry Raut


For Video Lecture on Machine Learning : Random Forest Regression ( Tree )




machine learning random forest regression ? ,random forest regression machine learning mastery? ,


Comments

Popular posts from this blog

what gaming development require ,how the game developed ? -machinelearningtechnilesh

  What is gaming development & requirement? how the game developed? Hellos guys today we are exploring the video gaming industry and how the game is developed by the gaming engineers. The video gaming industry is growing exponentially on a large scale. A large no of games is launched by the many video gaming companies games like GTA 5 ( All series 1,2,3,4,5) by Rockstar studio & Cricket (2007,2010) by EA sports.The game development is also a big future for engineers. Today we are exploring the path to develop the game and which programming language is required and which skill do have to become a gaming developer.  Table Of Contents C# (C Sharp ) The best language for game development is c#. This language is similar to java and c,c++ programming. The Language is best because it used in AR & VR and ios development also. The best part of this programming language is the OOP (object-oriented programming) .this language works on .NET Frameworks. To build a game or AR ...

Sentiment Analysis using NLP Libraries -machinelearningtechnilesh

Doing Sentiment Analysis using NLP Libraries Conclusion from the Frist Approach : Sentiment Analysis using NLP Libraries (Unsupervised learning ) : result and analysis:  1) AFINN lexicon Model Performance metrics: ------------------------------ Accuracy: 0.71 Precision: 0.73 Recall: 0.71 F1 Score: 0.71 The Accuracy is 71% and F1 score tell about the performance of the that is 72%.that getting success is 72%. 2) SentiWordnet Model Performance metrics: ------------------------------ Accuracy: 0.69 Precision: 0.69 Recall: 0.69 F1 Score: 0.68 The Accuracy is 71% and F1 score tell about the performance of the that is 72%.that getting success is 72%. 3) VADER Model Performance metrics: ------------------------------ Accuracy: 0.71 Precision: 0.72 Recall: 0.71 F1 Score: 0.71 The Accuracy is 71% and F1 score tell about the performance of the that is 72%.that getting success is 72%. From comparing all three unsupervised model the AFFIN is best model because the precise value is greater than...

Computer Networks All Basic in one Blog :machinelearningtechnilesh

 . A computer network is formed by two or more devices connected together, these devices might be connected to share data to do some computations together or to share the resources. For example, a simple network where two computers are connected and one printer is connected and these both computers want to give command to the printer. So Resource Sharing is happening Do you do computer networks, computer networks are in fact everywhere they are in our office, they are in our home. In home, we might have multiple devices like laptops, Alexa, or other devices which are connected in a network. in office, you often see networks, your computers connected through a switch or any other device like router, and they form a network. So there are many, many networks that exist. In this course, we are going to focus mainly on internet, the largest network, almost half of the world's population is connected to the internet. In fact, most of our home devices, our office devices, they are connect...