This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import os | |
import glob | |
from datetime import datetime, timedelta | |
import concurrent.futures | |
import numpy as np | |
from calendar import monthrange | |
def convert_to_monthly(df): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from datetime import datetime | |
from dateutil.relativedelta import relativedelta | |
import matplotlib.pyplot as plt | |
from prophet_model import * | |
# Feature tracking dictionary to store information about each feature | |
feature_tracking = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
pd.set_option('display.max_columns', None) # Show all columns | |
import matplotlib.pyplot as plt | |
from datetime import datetime, timedelta | |
from dateutil.relativedelta import relativedelta | |
from sklearn.metrics import mean_squared_error, mean_absolute_percentage_error | |
from sklearn.ensemble import RandomForestRegressor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Enhanced Classification Framework | |
A flexible framework for classification tasks with feature selection, | |
class imbalance handling, hyperparameter tuning, threshold optimization, and visualization. | |
Combines elements from both scikit-learn and PySpark frameworks. | |
""" | |
import pandas as pd | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enhanced PySpark Classification Framework | |
# This framework combines PySpark's distributed processing capabilities with | |
# scikit-learn's visualization and evaluation metrics from the General Classification Framework | |
import optuna | |
from pyspark.sql import SparkSession | |
from pyspark.sql.functions import col, when, count, lit, variance, corr, row_number, udf | |
from pyspark.sql.types import FloatType | |
from pyspark.sql import Window | |
from pyspark.sql import functions as F |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
General Classification Framework for PySpark | |
A flexible framework for classification tasks with feature importance analysis, | |
hyperparameter tuning using Optuna, threshold optimization, and visualization. | |
""" | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
General Classification Framework | |
A flexible framework for classification tasks with feature importance analysis, | |
hyperparameter tuning, threshold optimization, and visualization. | |
""" | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt |
NewerOlder