mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-17 04:48:09 +00:00
feature(Models): Implemented a basic Neural Network with Pytorch-Lightning (#101)
* feat: Added base functions for Neural Net. * feat: Added function to handle Neural Nets. * fix: Fixed fit loop * feat: Neural Net trains now, need to test it. * feat: Prediction now works on the neural net. * fix: Put back config and run_pipeline.py * fix: Took out import from run_pipeline. * fix(Models): added get_name(), adjusted pytorch model output size * fix(Tests): fixed tests Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
This commit is contained in:
co-authored by
Mark Aron Szulyovszky
parent
1cd0119589
commit
ee35332f58
@@ -30,6 +30,8 @@ def walk_forward_train_test(
|
||||
if model.only_column is not None:
|
||||
X = X[[column for column in X.columns if model.only_column in column]]
|
||||
|
||||
|
||||
|
||||
is_scaling_on = scaler is not None and model.data_scaling == 'scaled'
|
||||
|
||||
if is_scaling_on:
|
||||
@@ -58,9 +60,13 @@ def walk_forward_train_test(
|
||||
X_slice = scaler.transform(X_slice.values)
|
||||
else:
|
||||
X_slice = X_slice.to_numpy()
|
||||
|
||||
|
||||
|
||||
current_model = model.clone()
|
||||
|
||||
current_model.initialize_network(input_dim = len(X_slice[0]), output_dim=1)
|
||||
current_model.fit(X_slice, y_slice.to_numpy())
|
||||
|
||||
iterations_before_retrain = retrain_every
|
||||
else:
|
||||
current_model = models[index-1]
|
||||
|
||||
Reference in New Issue
Block a user