Skip to content

Update Test.py #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@
import seaborn as sns
import matplotlib.pyplot as plt

data_train = pd.read_csv('/home/keldendraduldorji/Desktop/KDD/train.csv')
data_test = pd.read_csv('/home/keldendraduldorji/Desktop/KDD/test.csv')
Grades = pd.read_csv('Grades_Students.csv', sep= ',', header=None)
Student = pd.read_csv('student2.csv')
#Picks up 3 random samples
data_train.sample(3)
#Create a barplot that has assigned x, y values and also legend title name "Sex"
#sns.barplot(x="Embarked", y="Survived", hue="Sex", data=data_train)
#plt.show() # Visualizing the data
#sns.pointplot(x="Pclass", y="Survived", hue="Sex", data=data_train,
#palette={"male": "blue", "female": "pink"},
#markers=["*", "o"], linestyles=["-", "--"])
Grades.sample(3)
sns.barplot(x="Assessment", y="Grade", hue="Type of marking", data=Grades)
plt.show()
print Grades.values
print Grades
plt.bar(Grades[:,0], Grades[:,1], color='g')
plt.ylabel('Frequency')
plt.xlabel('Words')
plt.title('Title')

plt.show()
sns.pointplot(x="Pclass", y="Survived", hue="Sex", data=Grades,
palette={"male": "blue", "female": "pink"},
markers=["*", "o"], linestyles=["-", "--"])

#sns pointplot function creates a pointplot that estimates central tendency for
#a numeric variable. Your x and y values are assigned along with a legend title.
#Regarding data , palette assigns a color to a variable. Markers are the symbols of the
#legends in this case male and female. linestyles are used to specify whether a line in the graph looks like
# ----- or straight line.
#plt.show()
plt.show()


def simplify_ages(df):
Expand Down Expand Up @@ -164,4 +171,4 @@ def run_kfold(clf):

output = pd.DataFrame({ 'PassengerId' : ids, 'Survived': predictions })
# output.to_csv('titanic-predictions.csv', index = False)
output.head()
output.head()