Comments (8)
Hey. I'm not sure if there's a guarantee that the local and distributed models will be the same. Once you have both you can compare them with the trees_to_dataframe method, e.g.
dstr_df = fcst_dstr.models_['SparkXGBForecast'].get_booster().trees_to_dataframe()
local_df = fcst.models_['XGBregressor'].get_booster().trees_to_dataframe()
About the predict method, how are you running it?
from mlforecast.
Sure! Thanks I will try checking the trees!
Another thing I noticed was that for SparkXGBForecast, it was giving different result with the same dataset, whereas non distributed version it was consistent results.
I didn't set any random seed to neither of the models ..
from xgboost.spark import SparkXGBRegressor
spark_xgb = SparkXGBRegressor(num_workers=8, label_col='target', features_col='features')
xgb_regressor_model = spark_xgb.fit(train_sf_tf)
transformed_test_spark_dataframe = spark_xgb.predict(test_spark_dataframe)
With the last line, I am getting this error.
AttributeError: 'SparkXGBRegressor' object has no attribute 'predict'
from mlforecast.
I think you should use the trained model, i.e. xgb_regressor_model.predict
instead of spark_xgb.predict
from mlforecast.
Still getting the same error when I do ..
transformed_test_spark_dataframe = xgb_regressor_model.predict(test_spark_dataframe)
AttributeError: 'SparkXGBRegressorModel' object has no attribute 'predict'
from mlforecast.
Hmm, if it's an MLlib estimator it may be called transform
instead of predict
. Can you try that? If it works I think you should open an issue in XGBoost so that they update the documentation.
from mlforecast.
Hmm, if it's an MLlib estimator it may be called transform instead of predict. Can you try that? If it works I think you should open an issue in XGBoost so that they update the documentation.
Yes, the spark interface uses the name transform
instead of predict
to align with sparkml. Did you find the document being inconsistent in XGBoost?
Hey. I'm not sure if there's a guarantee that the local and distributed models will be the same
No, the training results are expected to differ. However, given a trained model, predictions are expected to be the same.
from mlforecast.
Related Issues (20)
- [MLForecast] lag_transforms with different features packages HOT 6
- MLForecast: Core: Add prediction intervals to forecast_fitted_values
- [Core] Saving of the model HOT 20
- [core]Using multiple models can cause `new_x` lag feature shift HOT 2
- [Core]`ts.update` method may not support target_transforms,lag_transforms and date_features HOT 1
- [Model] Distributed version of the model giving Arrow Capacity error HOT 6
- predict() and cross_validation() outputs inconsistency HOT 6
- Dynamic features for training HOT 1
- model.predict encounters an error HOT 3
- Does mlforecast train a single global model or one model per serie? HOT 2
- mlforecast: can the number of exogenous variables be different for different unique_id? HOT 2
- MLforecast does not work with with PyArrow dates HOT 2
- Fcst.predict does not accept X_df with dynamic exogenous variables HOT 2
- [MLForecast: test set eval and early stopping ] HOT 2
- AutoDifferences, AutoSeasonalityAndDifferences result in "AttributeError: 'NoneType' object has no attribute 'AutoDifferences'" HOT 2
- Lag feature: how initial values are treated or populated once the data has been shifted? HOT 2
- [date features]: dayofweek_cat - day of week as a one hot encoding feature HOT 4
- [Core] getting an error module 'coreforecast.lag_transforms' has no attribute 'BaseLagTransform' HOT 3
- [distributed]: allow for .ts.update in DistributedMLForecast HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlforecast.