
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Learning Model Building in Scikit-learn: A Python Machine Learning Library
In this article, we will learn about the Learning Model Building in Scikit-learn: A Python Machine Learning Library.
It is a free machine learning library. It supports various algorithm like the random forest, vector machines & k-nearest neighbours with direct implementation with numpy and scipy.
Importing the dataset
import pandas Url = < specify your URL here> data=pandas.rad_csv(url)
Data exploration and cleaning
We can use the head method to specify/filter the records according to our needs.
data.head() data.head(n=4) # restricting the record to be 4
We can also implement the last few records of the dataset
data.tail() data.tail(n=4) # restricting the record to be 4
Now comes the stage of Data visualization
For this, we use the Seaborn module and matplotlib to visualize our data
import seaborn as s import matplotlib.pyplot as plt sns.set(style="whitegrid", color_codes=True) # create a countplot sns.countplot('Route To Market',data=sales_data,hue = 'Opportunity Result')
Preprocessing the data
from sklearn import preprocessing le = preprocessing.LabelEncoder() #convert the columns into numeric values encoded_value = le.fit_transform(list of column names) print(encoded_value)
Finaly we reach the stage of Model building by training the data set.
Conclusion
In this article, we learnt about the model building in scikit-learn - a library available in Python.
- Related Articles
- Model Validation in Machine Learning
- Is python necessary to learn for machine learning
- Interpreting Loss and Accuracy of a Machine Learning Model
- Explain the basics of scikit-learn library in Python?
- Why should you learn machine learning and artificial intelligence
- How to deploy machine learning model using Django?
- Python Polynomial Regression in Machine Learning
- Top Python Machine Learning Libraries
- Introduction To Machine Learning using Python
- Roadmap to study AI, Machine Learning, and Deep Machine Learning
- Benefits of learning machine learning from scratch
- TabNet in Machine Learning
- How can data be scaled using scikit-learn library in Python?
- What is Q-learning with respect to reinforcement learning in Machine Learning?
- Machine Learning – The Intelligent Machine

Advertisements