Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
About Article
Analyze Data
Archive
Best Practices
Better Outputs
Blog
Code Optimization
Code Quality
Command Line
Course
Daily tips
Dashboard
Data Analysis & Manipulation
Data Engineer
Data Visualization
DataFrame
Delta Lake
DevOps
DuckDB
Environment Management
Feature Engineer
Git
Jupyter Notebook
LLM
LLM Tools
Machine Learning
Machine Learning & AI
Machine Learning Tools
Manage Data
MLOps
Natural Language Processing
Newsletter Archive
NumPy
Pandas
Polars
PySpark
Python Helpers
Python Tips
Python Utilities
Scrape Data
SQL
Testing
Time Series
Tools
Visualization
Visualization & Reporting
Workflow & Automation
Workflow Automation

Testing

Execute a Fixture Only Once per Session

Pytest fixture allows you to use the same data to test different functions. Every time you use a pytest fixture in a test, a fixture will be executed.

This means that a fixture will be executed twice if used in two different tests.

If a fixture is expensive to execute, you can make the fixture be executed only once per session using scope=session. 

My previous tips on pytest.

Execute a Fixture Only Once per Session Read More »

Check Conflicting Labels with Deepchecks

Sometimes, your data might have identical samples with different labels. This might be because the data was mislabeled.

It is good to identify these conflicting labels in your data before using the data to train your ML model. To check conflicting labels in your data, use deepchecks. 

In the example above, deepchecks identified that samples 0 and 1 have the same features but different labels. 

Link to deepchecks.

My previous tips on testing.

Check Conflicting Labels with Deepchecks Read More »

Deepchecks + Weights & Biases: Test and Track Your ML Model and Data

Weight and Biases is a tool to track and monitor your ML experiments. deepchecks is a tool that allows you to create test suites for your ML models & data with ease.

The checks in a suite includes:

🔎 model performance

🔎 data integrity

🔎 distribution mismatches

and more.

Now you can track deepchecks suite’s results with Weights & Biases as shown above.

Here is how to create and track a test suite.

Deepchecks + Weights & Biases: Test and Track Your ML Model and Data Read More »

pytest parametrize twice: Test All Possible Combinations of Two Sets of Parameters

If you want to test the combinations of two sets of parameters, writing all possible combinations can be time-consuming and is difficult to read. 

You can save your time by using pytest.mark.parametrize twice instead. From the output of pytest, we can see that all possible combinations of the given functions and inputs are tested.

My previous tips on testing.

pytest parametrize twice: Test All Possible Combinations of Two Sets of Parameters Read More »

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran