Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
no useless comments
Browse files Browse the repository at this point in the history
  • Loading branch information
durandom committed May 28, 2019
1 parent 129f091 commit 0127ea9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Import the necessary libraries
import numpy as np
import matplotlib.pyplot as plot
import pandas
Expand All @@ -14,7 +13,6 @@ def split_data():
return (x_train, x_test, y_train, y_test)

def import_data():
# Import the dataset
data_set = pandas.read_csv('data.csv')
x_values = data_set.iloc[:, :-1].values
y_values = data_set.iloc[:, 1].values
Expand All @@ -34,16 +32,10 @@ def plot_data(x_points, y_points, predictor, label):
x_values, y_values = import_data()
x_train, x_test, y_train, y_test = split_data()

# Creating a LinearRegression object and fitting it
# on our trainging set.
linear_regressor = LinearRegression()
linear_regressor.fit(x_values, y_values)

# Predicting the test set results
y_prediction = linear_regressor.predict(x_test)

# Visualising the training set results
plot_data(x_train, y_train, linear_regressor, 'Salary vs Experince (Training set)')

# Visualising the test set results
plot_data(x_test, y_test, linear_regressor, 'Salary vs Experince (Test set)')

0 comments on commit 0127ea9

Please sign in to comment.