I mainly use C++ and Python usually for Competitive Programming.
Feel free to modify it and use it.
Websites such as Kaggle/DPhi/Codelabs and such have a lot of Machine Learning Competitions and I do know that each problem has its own modifications and such. The templates present in the folder are separated according to the various Machine Learning Algorithms. Each template for each Algorithm has a defined format in a way such that most Machine Learning Competitions on Kaggle/Dphi are organized. Feel free to change it according to the problem and add more Data Analysis step or such to understand the data more.
# Bundle preprocessing for numerical and categorical data
preprocessor = ColumnTransformer(
transformers=[
('num', numerical_transformer, numerical_cols),
('cat', categorical_transformer, categorical_cols)
])
# Bundle preprocessing and modeling code in a pipeline
my_model = XGBRegressor(n_estimators=1000, learning_rate=0.05, n_jobs=0)
my_pipeline = Pipeline(steps=[('preprocessor', preprocessor),
('model', my_model)
])
my_pipeline.fit(train_X, train_y,
early_stopping_rounds=5,
eval_set=[(val_X, val_y)],
verbose=False)
Hope this helps everyone and feel free to open any issues and suggest more ideas on how to improve/new templates for various other algorithms.
-Robert