Giter VIP home page Giter VIP logo

datacamp-code-along-2024's Introduction

Datacamp Code Along 2024

Machine Learning in Production with Python

img.png

Summary for Code-Along Session

Background Context:

In this code-along session, we will work with a dataset from a Portuguese banking institution's direct marketing campaigns, sourced from Kaggle. The dataset contains information about various marketing efforts, including telephonic outreach, aimed at promoting term deposits. Term deposits are significant for banks as they provide a stable income stream. Identifying and targeting potential customers effectively can enhance marketing efficiency and reduce costs.

https://www.kaggle.com/datasets/prakharrathi25/banking-dataset-marketing-targets/data

Tasks Covered:

  1. Feature Engineering:

    • We will develope functions to enhance the DataFrame with new features.
    • These functions were combined into a streamlined data transformation process using the Pandas pipe method.
  2. Unit Testing:

    • We implemented unit tests using the pytest framework to ensure the new features were correctly added to the DataFrame.
    • The tests verified that the new columns were accurately calculated and correctly incorporated into the DataFrame.

Overall, this session provided practical experience in enhancing a dataset with valuable features and ensuring the robustness of these enhancements through thorough testing.

Project Setup

To ensure a clean and isolated development environment, use a virtual environment created with venv and manage dependencies using pyproject.toml.

Additionally, set up pre-commit hooks for code quality checks, including linting with Ruff.

Creating a Virtual Environment

Create and activate a virtual environment:

python -m venv venv
venv\Scripts\activate

Installing Dependencies

Once inside the virtual environment, install project dependencies from the pyproject.toml file:

pip install -e .

Poetry and pip-tools are excellent package managers. As pip won't necessarily handle all dependencies and constraints as effectively as package managers

Setting up Pre-commit Hooks and Linting

Use pre-commit to enforce code quality standards. Additionally, use ruff for linting. Both packages are in the pyproject.toml file for install.

https://pre-commit.com

Navigate to your project directory and set up pre-commit hooks:

pre-commit install

A .pre-commit-config.yaml file is in project directory with config for ruff linting. Whenever you make a commit, pre-commit will run linting with Ruff and enforce code quality standards automatically.

https://github.com/astral-sh/ruff-pre-commit

datacamp-code-along-2024's People

Contributors

mconwa02 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.