diff --git a/sidra_chain_integration/sidra_chain_data_processor.py b/sidra_chain_integration/sidra_chain_data_processor.py index 73dde6995..45d326408 100644 --- a/sidra_chain_integration/sidra_chain_data_processor.py +++ b/sidra_chain_integration/sidra_chain_data_processor.py @@ -2,6 +2,7 @@ import pandas as pd from sidra_chain_api import SidraChainAPI + class SidraChainDataProcessor: def __init__(self, sidra_chain_api: SidraChainAPI): self.sidra_chain_api = sidra_chain_api @@ -20,6 +21,7 @@ def process_chain_data(self, chain_data: dict): def train_model(self, df: pd.DataFrame): # Train a machine learning model using the processed chain data from sklearn.ensemble import RandomForestRegressor + model = RandomForestRegressor(n_estimators=100, random_state=42) - model.fit(df.drop('target', axis=1), df['target']) + model.fit(df.drop("target", axis=1), df["target"]) return model