https://github.com/atothey/mltutorial
Made for the IEEE Ryerson Machine Learning Tutorial for Beginners
https://github.com/atothey/mltutorial
Last synced: about 1 year ago
JSON representation
Made for the IEEE Ryerson Machine Learning Tutorial for Beginners
- Host: GitHub
- URL: https://github.com/atothey/mltutorial
- Owner: AtotheY
- Created: 2017-03-08T04:35:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-08T23:34:15.000Z (over 9 years ago)
- Last Synced: 2025-04-17T11:58:47.936Z (about 1 year ago)
- Language: Python
- Size: 329 KB
- Stars: 2
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MLTutorial
Made for the IEEE Ryerson Machine Learning Tutorial for Beginners
https://docs.google.com/presentation/d/1QcgoomUi-vGVbkRTQncp55VtrM-YBvYZFHgQ1XZk76I/edit?usp=sharing
```
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn import datasets, linear_model
height = pd.read_csv('data.csv', usecols = [0])
weight = pd.read_csv('data.csv', usecols = [1])
x = np.squeeze(np.array(height))
y = np.squeeze(np.array(weight))
x_training_data = x[:-200].reshape(1800,1)
x_test_data = x[-200:].reshape(200,1)
y_training_data = y[:-200]
y_test_data = y[-200:]
regr = linear_model.LinearRegression()
regr.fit(x_training_data, y_training_data)
plt.scatter(x_test_data, y_test_data, color='black')
plt.plot(x_test_data, regr.predict(x_test_data), color='red',
linewidth=3)
plt.xticks(())
plt.yticks(())
plt.show()
```