Skip to content

Instantly share code, notes, and snippets.

View audhiaprilliant's full-sized avatar
🎯
Focusing

Audhi Aprilliant audhiaprilliant

🎯
Focusing
View GitHub Profile
@audhiaprilliant
audhiaprilliant / matplotlib-101-iteration-4.py
Last active November 9, 2022 14:43
Matplotlib 101 - Basic Introduction for Python Beginner
# ---------- 4th ITERATIONS - ADD DATA LABELS AND TITLES ----------
# Figure size
fig = plt.figure(figsize = (10, 4.8))
# Bar plot
bar_fig = plt.bar(
x = 'PaymentMethod',
height = 'customerID',
data = df_group_1,
@audhiaprilliant
audhiaprilliant / matplotlib-101-iteration-3.py
Last active November 9, 2022 14:42
Matplotlib 101 - Basic Introduction for Python Beginner
# ---------- 3rd ITERATION - REMOVE FRAMES AND RESET THE VERTICAL TICKS ----------
# Figure size
fig = plt.figure(figsize = (10, 4.8))
# Bar plot
bar_fig = plt.bar(
x = 'PaymentMethod',
height = 'customerID',
data = df_group_1,
@audhiaprilliant
audhiaprilliant / matplotlib-101-iteration-2.py
Created November 2, 2022 14:43
Matplotlib 101 - Basic Introduction for Python Beginner
# ---------- 2nd ITERATION - REORDER THE CATEGORIES AND DO COLORING ----------
# Reorder the PaymentMethod based on total customer
df_group_1.sort_values(by = 'customerID', ascending = False, inplace = True)
# Figure size
fig = plt.figure(figsize = (10, 4.8))
# Bar plot
bar_fig = plt.bar(
@audhiaprilliant
audhiaprilliant / matplotlib-101-iteration-1.py
Created November 2, 2022 14:40
Matplotlib 101 - Basic Introduction for Python Beginner
# ---------- 1st ITERATION - CREATE A BASIC BAR PLOT ----------
# Figure size
fig = plt.figure(figsize = (10, 4.8))
# Bar plot
plt.bar(
x = 'PaymentMethod',
height = 'customerID',
data = df_group_1,
@audhiaprilliant
audhiaprilliant / matplotlib-101-dataprep.py
Created November 2, 2022 14:37
Matplotlib 101 - Basic Introduction for Python Beginner
# ---------- IMPORT PACKAGES ----------
# Dataframe manipulation
import pandas as pd
# Matrices operation
import numpy as np
# Data viz with matplotlib
import matplotlib
@audhiaprilliant
audhiaprilliant / matplotlib-101.ipynb
Last active November 9, 2022 14:32
Matplotlib 101 - Basic Introduction for Python Beginner
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@audhiaprilliant
audhiaprilliant / hypothesis_testing_confidence_interval_bootstrapping.ipynb
Last active August 15, 2022 09:05
The Simulation of Bootstrapping for Confidence Interval and Hypothesis Testing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@audhiaprilliant
audhiaprilliant / machine_learning_deployment_13.py
Last active May 18, 2022 14:15
End to end machine learning model deployment using flask
# Flask
from flask import Flask, render_template, request
# Data manipulation
import pandas as pd
# Matrices manipulation
import numpy as np
# Script logging
import logging
# ML model
import joblib
@audhiaprilliant
audhiaprilliant / machine_learning_deployment.ipynb
Created May 18, 2022 14:13
End to end machine learning model deployment using flask
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@audhiaprilliant
audhiaprilliant / machine_learning_deployment_12.py
Created May 16, 2022 12:13
End to end machine learning model deployment using flask
# Machine learning model development
# XGBoost model
xgb_model = xgb.XGBClassifier(
objective = 'binary:logistic',
use_label_encoder = False
)
# Define parameters range
params = {