YushantT
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## ASSESSMENT SUMMARY | Grade | SKILL | |:------------------------------------ |:------------------------------------:| | ![](https://i.imgur.com/Ed8qV2H.png) | Data Visualization and Communication | | ![](https://i.imgur.com/vUaGmQk.png) | Machine Learning | | ![](https://i.imgur.com/Ed8qV2H.png) | Scripting and Command Line | ## ASSESSMENT DETAILS ### Data Visualization and Communication **Summary**: Up to scratch visualisation and communication. The conjecture was clearly stated and later on validated with. Agreeable presentation was included as well. 1. Objective was clearly stated which made it clear on what could be expected from the analysis 2. Picked out that the given data was quite big of visual analysis 3. Fittingly resampled the given large dataset in order to make it fit for visual analysis. 4. Here, we see a unique approach towards the start of EDA was followed 5. Identified 'delay time' as a crucial feature. Hence, explored it more by plotting it against other important features. This helped gain crucial insights about the data. ![](https://i.imgur.com/Xxnvse0.png) 6. Satisfying reasoning given for not including every feature in the EDA process, by identifying their importance.(blank plot in the above image) > cancelled flights trimmed out for visualisation purpose 7. The necessary type conversions and encoding to be done was pinpointed. 8. Identified the feature 'departure' being not so contributing towards the analysis. > 'departure' was omitted as there is only one departure("HKG" aka Hong Kong) 9. Distribution of features was identified with the help of plots and the following was concluded. One such plot is shown > Claim vs no claim distributions for each feature look similar, but some entries have higher occurrences of claims. ![](https://i.imgur.com/kvnHyYa.png) ### Machine Learning **Summary**:Feature engineering is done with utmost care. What is done and why is it done is clearly mentioned in the presentation. #### Feature Engineering 1. A good start to the pre-processing was given by mentioning the constraints withing which it has to be done > is_claim is either 0 or 800 > std_hour is always 0-24 > week is between 1-52 2. Identified 'Airline' being the sole feature with nulls and dealt with the same by dropping out that feature. 3. Extra time features were engineered which will help in prediction. Reasoning was included in the form of visualisation in the presentation > 'weekday' is added as a supplement 4. Categorical features were appropriately dealt with by wither encoding them or using one-hot encoding. Following snippet shows how the null values were dealt with. Similar formatting and commenting done for other feature engineering tasks which made it easy to understand. ```python= def preprocess(df): """ Preprocess data. Returns a new object """ df = df.copy(deep=True) df['flight_date'] = pd.to_datetime(df['flight_date']) # Convert is_claim to class labels df.loc[df['is_claim'] == 800, 'is_claim'] = 1 # Add Weekday column df['Weekday'] = df['flight_date'].dt.weekday # Fill null values. Only Airline contains null values. df['Airline'].fillna('Unknown', inplace=True) # Drop delay_time < 0 but keep cancelled flights df = df.loc[~df['delay_time'].str.startswith('-')] ``` #### Machine Learning Model 1. Initially, different ways to frame the problem statement were identified. This will help in laying out different possible models and choosing the best of them. > 1.) Regression to predict delay_time > 2.) classification to predict is_claim 2. Finally, option 2, that is, classification was chosen, and the following reason given for the same > Objective is to obtain an expected claim amount > `E(claim)=800*P(is_claim=1 | features)` 3. Decided to compare the models using Mean absolute and mean square errors. Identified 2 cases for calculating both, namely dynamic and binary pricing, and chose the best of it. > '(MAE/MSE(prob)) using P(is_claim)*800' is dynamic as it includes probability > '(MAE/MSE) using predicted class*800' is static 4. While calculating baseline accuracy, identified that 'is_claim' is a rare event and is > insensitive to the training data 5. Hence, used precision and recall for prediction instead of accuracy ```python= def evaluate_baseline(y_true): """ Baseline accuracy. Simply predicts all zeros """ y_pred = np.zeros(len(y_true)) mae = mean_absolute_error(y_true * 800, y_pred) mse = mean_squared_error(y_true * 800, y_pred) f1 = f1_score(y_true, y_pred) accuracy = accuracy_score(y_true, y_pred) recall = recall_score(y_true, y_pred) return {'F1 Score': f1, 'accuracy': accuracy, 'recall': recall, 'MAE': mae, 'MSE': mse} ``` 6. Started the prediction with naive bayes model and obtained 5-fold cross validation for the same. This helped in analysing the usefulness of the model to the fullest. 7. Similar modelling was done using logistic regression and it was concluded that > compared to naive bayes, logistic regression has lower recall but also lower MAE and MSE. 8. Identified primary focus was to obtain low MAE and MSE, and hence opted for logistic model. 9. Considerations and trade-offs were mentioned, that helped in clarifying why using dynamics pricing is better than binary pricing. ### Scripting and Command Line **Summary**: The project was done using Python and was containerized using docker. Included a README file and a presentation. 1. README was included. It talked about the project structure and how to set up everything. 2. requirements file was included. It clearly mentioned the packages along with their versions to be installed. 3. Proper comments were used inside the code. 4. Code is readable with uniform spacing and consistent styling. 5. With the help of docker, the whole model with all the dependencies was containerized. This results in easy access of the code and platform independency of the model. 6. Presentation included almost everything from data exploration, data pre-processing to training. 7. Possible improvements were identified that can help with more enhanced prediction > 1.) more data can be helpful > 2.) can test more models for prediction that might perform better > 3.) Testing can be done.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully