mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 18:49:26 +08:00
Tighten up psf/black and flake8 (#2024)
* Tighten up psf/black and flake8 * Fix some tests * Fix some E741 * Fix some E741 * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -1,5 +1,12 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
from sklearn.linear_model import LinearRegression
|
||||
|
||||
# Splitting the dataset into the Training set and Test set
|
||||
from sklearn.model_selection import train_test_split
|
||||
|
||||
# Fitting Polynomial Regression to the dataset
|
||||
from sklearn.preprocessing import PolynomialFeatures
|
||||
|
||||
# Importing the dataset
|
||||
dataset = pd.read_csv(
|
||||
@ -9,16 +16,9 @@ X = dataset.iloc[:, 1:2].values
|
||||
y = dataset.iloc[:, 2].values
|
||||
|
||||
|
||||
# Splitting the dataset into the Training set and Test set
|
||||
from sklearn.model_selection import train_test_split
|
||||
|
||||
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
|
||||
|
||||
|
||||
# Fitting Polynomial Regression to the dataset
|
||||
from sklearn.preprocessing import PolynomialFeatures
|
||||
from sklearn.linear_model import LinearRegression
|
||||
|
||||
poly_reg = PolynomialFeatures(degree=4)
|
||||
X_poly = poly_reg.fit_transform(X)
|
||||
pol_reg = LinearRegression()
|
||||
|
Reference in New Issue
Block a user