Comments (3)
Could you provide a benchmark against the existing implementation & against the scipy stuff? I think we should probably (in future) default to the scipy implementation where we can.
from gwr.
If you use http://mortada.net/easily-profile-python-code-in-jupyter.html it should be real simple to see the savings. Hope that's alright.
from gwr.
Thanks @ljwolf for pointing out the profiling tool
Before:
Timer unit: 1e-06 s
Total time: 19.7563 s
File: /Users/Ziqi/Desktop/developer/gwr/gwr/sel_bw.py
Function: _bw at line 281
Line # Hits Time Per Hit % Time Line Contents
==============================================================
281 def _bw(self):
282 1 5 5.0 0.0 gwr_func = lambda bw: self._fast_fit(bw,constant=self.constant)[self.criterion]
283 1 1 1.0 0.0 if self.search == 'golden_section':
284 1 989 989.0 0.0 a,c = self._init_section(self.X_glob, self.X_loc, self.coords,self.constant)
285 1 1 1.0 0.0 delta = 0.38197 #1 - (np.sqrt(5.0)-1.0)/2.0
286 1 19755331 19755331.0 100.0 self.bw = golden_section(a, c, delta, gwr_func, self.tol,self.max_iter, self.int_score)
287 elif self.search == 'interval':
288 self.bw = equal_interval(self.bw_min, self.bw_max, self.interval,gwr_func, self.int_score)
289 else:
290 raise TypeError('Unsupported computational search method ', search)
After:
Timer unit: 1e-06 s
Total time: 9.73623 s
File: /Users/Ziqi/Desktop/developer/gwr/gwr/sel_bw.py
Function: _bw at line 281
Line # Hits Time Per Hit % Time Line Contents
==============================================================
281 def _bw(self):
282 1 13 13.0 0.0 gwr_func = lambda bw: self._fast_fit(bw,constant=self.constant)[self.criterion]
283 1 1 1.0 0.0 if self.search == 'golden_section':
284 1 938 938.0 0.0 a,c = self._init_section(self.X_glob, self.X_loc, self.coords,self.constant)
285 1 1 1.0 0.0 delta = 0.38197 #1 - (np.sqrt(5.0)-1.0)/2.0
286 1 9735279 9735279.0 100.0 self.bw = golden_section(a, c, delta, gwr_func, self.tol,self.max_iter, self.int_score)
287 elif self.search == 'interval':
288 self.bw = equal_interval(self.bw_min, self.bw_max, self.interval,gwr_func, self.int_score)
289 else:
290 raise TypeError('Unsupported computational search method ', search)
19755331.0/9735279.0 ~ 2.03x speed up from golden_section()
from gwr.
Related Issues (15)
- Move MGWR HOT 1
- Thoughts about adaptive gaussian HOT 2
- For fit parameters, use sklearn trailing `_` notation? HOT 1
- calling `search` modifies the method `search`, so it can only be called once. HOT 3
- Profiling for speed-up HOT 3
- Predition jpynb is broken HOT 1
- TypeError: ('Unsupported kernel function ', 'bisquare') HOT 4
- #Offset does not yet do anyhting and needs to be implemented HOT 3
- gwr is using example files that are not in libpysal (but in old pysal) HOT 1
- GWR speed-up HOT 1
- Possibility for adding a summary text for GWR diagnostics HOT 2
- Support for projected coordinates HOT 1
- Add "Global" R-squared HOT 1
- Resolve divide-by-zero issue for Gaussian GWR 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 gwr.