-
Notifications
You must be signed in to change notification settings - Fork 3
/
ml_test.py
44 lines (36 loc) · 1.11 KB
/
ml_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#Load libraries
import pandas
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
#Load dataset
url = "dataset.txt"
names = ['1','2','3','4','5','6','7','8','9','10','Sum']
dataset = pandas.read_csv(url, sep=" ", names=names, skiprows=[0])
#shape
print(dataset.shape)
#head
print(dataset.head(20))
#descriptions
print(dataset.describe())
#sum description
print(dataset.groupby('Sum').size())
### Doesn't work, since too much data
#box and whisker plots
#dataset.plot(kind='box', subplots=True, layout=(2,2), sharex=False, sharey=False)
#plt.show()
#histogram
dataset.hist()
plt.show()
#scatter plot matrix
scatter_matrix(dataset)
plt.show()