Frequently Used Libraries for Machine Learning
Numpy
Numpy is a library typically used for mathematical operations. When used in machine learning, the Numpy library is typically used for array modification such as transposing, converting from 1-D to 2-D arrays, etc.
Importing Numpy
import numpy as np
Matplotlib
Matplotlib is a library that is used for visualization. When used in machine learning we can see the regression models and scatter plots of the datasets.
Importing Matplotlib
import matplotlib.pyplot as plt
Pandas
Pandas is a data analysis and manipulation tool. Typically we use pandas as a means to import data from csv files (i.e. spreadsheets) using the read_csv function.
Importing Pandas
import pandas as pd
SciKitLearn
The SciKitLearn learn library contains basically all of the tools that we need for creating our regression models.
Examples of importing SciKitLearn Libraries
Encoding Categorical Data
from sklearn.compose import ColumnTransformer |
Splitting the dataset into Training and Test sets
from sklearn.model_selection import train_test_split |
Linear Regression
from sklearn.linear_model import LinearRegression |
Polynomial Regression
from sklearn.preprocessing import PolynomialFeatures |
Feature Scaling
from sklearn.preprocessing import StandardScaler |
Support Vector Regression
from sklearn.svm import SVR |
Authors
Contributing authors:
Created by kmacloves on 2020/09/28 22:44.