Skip to content
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

Grader for titanic #17

Merged
merged 3 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/Hello-FOSS-ML.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ You can choose to do one or more of the following tasks -
* [Random Forests](./Titanic%20Random%20Forest%20Tensorflow.ipynb)
* [K-Nearest Neighbours](./Titanic%20KNN%20Tensorflow.ipynb)
* [Gaussian Naive Bayes model](./Titanic%20GaussianNB%20Tensorflow.ipynb)

### Validating Your Predictions
You can check your predictions by saving them as a `csv` file in the same directory
as that of `output.csv` and running the following in the terminal
```bash
~$ python grader.py --path <your_predictions>
```
For example,
```bash
~$ python grader.py --path gender_submission.csv
Your accuracy is 76.56%
```
# 2) MNIST and Fashion MNIST

**MNIST** ("Modified National Institute of Standards and Technology") is the de facto “hello world” dataset of computer vision. Since its release in 1999, this classic dataset of handwritten images has served as the basis for benchmarking classification algorithms. As new machine learning techniques emerge, MNIST remains a reliable resource for researchers and learners alike. In fact, MNIST is often the first dataset researchers try. "If it doesn't work on MNIST, it won't work at all", they said. "Well, if it does work on MNIST, it may still fail on others."
Expand Down
15 changes: 15 additions & 0 deletions titanic/grader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pandas as pd
import argparse
import os

def grade():
parser = argparse.ArgumentParser()
parser.add_argument("--path", help="Give the path of the file to be graded")
args = parser.parse_args()
data_to_be_graded = pd.read_csv(os.path.join(os.getcwd(), args.path))
expected = pd.read_csv('./output.csv')
accuracy = sum(expected['Survived'].values == data_to_be_graded['Survived'].values) / len(expected)
print("Your accuracy is {}%".format(round(accuracy * 100, 2)))

if __name__ == '__main__':
grade()
File renamed without changes.