scxpand.linear.model_manager#

Model initialization and state management for linear models.

Classes

ModelManager()

Handles model initialization and state management.

class scxpand.linear.model_manager.ModelManager#

Handles model initialization and state management.

static initialize_model(prm, y_train)#

Initialize SGDClassifier with proper parameters.

Return type:

SGDClassifier

static load_model_state(model, best_model_state, base_save_dir, score_metric)#

Load the best model state into the SGDClassifier.

Parameters:
  • model (SGDClassifier) – SGDClassifier to load state into

  • best_model_state (dict) – Dictionary containing the best model state

  • base_save_dir (Path) – Directory containing saved model files

  • score_metric (str) – Metric name used for scoring

Return type:

None

static save_model_state(model, current_score, epoch, dev_set_metrics)#

Save the current model state as the best model.

Return type:

dict