Comments (3)
This should be possible by using the following. I am giving some examples of how to do preprocessing in the pipeline as well.
with gw.config.update(ref_image=target_string):
with gw.open(select_images, nodata=9999, stack_dim="band") as src:
# Create a prediction stack where each variable used in regression is a band
src.gw.save(
"outputs/pred_stack.tif",
compress="lzw",
overwrite=True, # bigtiff=True
)
# extract variables
df = gw.extract(src, lu_poly, verbose=1)
y = something
X = something
# Create a pipeline with the preprocessor and the OLS model
pipeline_performance = Pipeline([
('scaler', StandardScaler()),
('model', LinearRegression())
])
# use sklearn to fit desired model
pipeline_performance.fit(X, y)
# predict to stack
def user_func(w, block, model):
pred_shape = list(block.shape)
X = block.reshape(pred_shape[0], -1).T
pred_shape[0] = 1
y_hat = model.predict(X)
X_reshaped = y_hat.T.reshape(pred_shape)
return w, X_reshaped
# create prediction image
gw.apply(
"outputs/pred_stack.tif",
f"outputs/final_model_OLS_prediction.tif",
user_func,
args=(pipeline_performance,),
n_jobs=16,
count=1,
)
That being said, I will eventually look into adding regression more directly as an option.
from geowombat.
Hi @ritviksahajpal, thanks for the question. Are you referring to the ml
module? Currently, there are no plans to add regression. However, we (@mmann1123) would be happy to look into it if there is interest. Do you have a specific idea or example in mind, or basically a general framework similar to the classifiers module?
from geowombat.
Thank you! Yes, referring to the ml
module, a general framework was what I was thinking, I would be happy to help test it once done.
from geowombat.
Related Issues (20)
- Failed to Install Geowombat on pip and conda HOT 12
- Requirement differences between package & conda-forge HOT 6
- Coordinating efforts on potential new geospatial Xarray accessor HOT 2
- ARM Installation Issues HOT 9
- Apply interpolation HOT 4
- Stac import HOT 2
- series.apply big tiff / bad block
- EVI equation is wrong HOT 2
- Support for pyproj 3.4.1? HOT 8
- Slow extract HOT 2
- mosaic bounds HOT 4
- fit_predict
- Stack & Mosaic Advice? HOT 6
- writing with Bigtiff HOT 2
- [] in open trigger stacking
- polygon_to_array returns shorter y dimension than source rasters HOT 26
- band names HOT 1
- Unable to import geowombat HOT 1
- Mosaic Fails with nan nodata HOT 1
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 geowombat.