Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 18789

Struggling with developing code for an online learning using river library with ARFRegressor algorithm

$
0
0

I have split the data but struggling to write the code for training the model and saving the model in particular directory using pickle for future use. Any suggestions on how to proceed?

# Splitting data into training and testing setsX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)from river import evaluatefrom river import forestfrom river import metricsfrom river import preprocessingmodel = (    preprocessing.StandardScaler() |    forest.ARFRegressor(seed=42))metric = metrics.MAE()# Evaluate the model on the testing setmae = evaluate.progressive_val_score(X_test, y_test, model, metric)print(f'MAE on the test set: {mae}')

Viewing all articles
Browse latest Browse all 18789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>