Skip to content

Instantly share code, notes, and snippets.

@adarsh1021
Created September 16, 2018 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save adarsh1021/b33108e9a6c899583afabf169b6bae6d to your computer and use it in GitHub Desktop.
Save adarsh1021/b33108e9a6c899583afabf169b6bae6d to your computer and use it in GitHub Desktop.
# Making the imports
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (12.0, 9.0)
# Preprocessing Input data
data = pd.read_csv('data.csv')
X = data.iloc[:, 0]
Y = data.iloc[:, 1]
plt.scatter(X, Y)
plt.show()
@Rajeswaritce
Copy link

How to have access to data file?

@dsabarinathan
Copy link

@Rajeswaritce , Hi mam, you can use the below code for create the linear data.

import numpy as np

x = np.linspace(0, 100, 100) # 1000 values between 0 and 100
delta = np.random.uniform(-10, 10, x.size)
y = 0.4*x + 3 + delta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment