Articles on mehaksachdeva's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on mehaksachdeva's BlogenFri, 23 Aug 2019 00:28:01 +0000Coding week #12https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-12/<h3><big>What did I do this week? </big></h3> <p>This week I compiled all the code and experimentation notebooks into a Github web page to be submitted as a part of the final work product for GSoC. The cover page includes all the links to the different parts of the project and all the experiments that went into devising the algorithm for each part.</p> <h3><big>What is coming up next? </big></h3> <p>I will continue to work on the 'ongoing' sections of the project beyond the GSoC period and will hope to continue contributing to the PySAL repository.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>I wanted to compile the notebooks and markdown files into a Jupyter book but due to Jekyll dependency issues on my Windows machine was unable to do it. I then resorted to use the simple github web-pages from notebooks option and that worked out well.</p>msachde1@asu.edu (mehaksachdeva)Fri, 23 Aug 2019 00:28:01 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-12/Coding week #11https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-11/<h3><big>What did I do this week?</big></h3> <p>This week I attempted to understand and code the out of sample predictions for the MGWR model which is the third part of my proposal. After a discussion with the mentors I realized the scope of the work to be larger than I had first anticipated. I experimented with the options to implement the algorithm and with the help of the mentors we were able to center down on an approach. This part of the project will be defined as an ongoing part which I will continue to work on beyond the Google Summer of Code period.</p> <h4><big>What is coming up next?</big></h4> <p>In the coming week I will work on compiling all the results and work done so far for the Poisson and Binomial models into a Github web-page/s to submit as a work product for the final evaluations.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>No major issues were encountered this week. Through experimentation and discussions I learnt the technique currently used for out of sample predictions for the GWR model which was very interesting </p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Fri, 23 Aug 2019 00:18:17 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-11/Coding week #10https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-10/<h3><big>What did I do this week?</big></h3> <p>After a discussion with the mentors we decided on testing the implementation of local scoring algorithm for the Binomial MGWR model. After an adjustment to the parameters, the results from the model were as expected. I implemented a Monte Carlo experiment to check for the bandwidth and parameter behavior and the results look very close to expectation. The implementation was decided to be kept internal until further checks were performed and the implementation was theoretically checked and confirmed.</p> <h4><big>What is coming up next?</big></h4> <p>In the coming week I will work on compiling all the results and work for the Poisson and Binomial models to complete its implementation in the MGWR pysal package.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>No major issues were encountered this week.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Thu, 15 Aug 2019 16:51:09 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-10/Coding week #9https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-9/<h3><big>What did I do this week? </big></h3> <p>After a productive discussion with my mentors last week, we agreed to proceed coding the local scoring algorithm for Binomial MGWR and testing the results from that. After familiarizing myself with the literature on the local scoring procedure, I coded it in the context of local models for MGWR. After multiple iterations, the model is converging and the bandwidth results are looking as expected. Though the parameter coefficients have values close to expected but not as accurate as needed. There could be possible issues with the weights associated in the model, and some adjustments need to be made for the coefficients which need to be figured out.</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on resolving the coefficient value issue discussed above and design and implement a Monte-Carlo design for the Binomial model as was done for the Poisson MGWR model.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>The modeling of the binary response variable with MGWR is still not resolved and issues have been encountered continuously in it, though that is expected from research. Hoping to resolve these final issues soon and work further on the predictions with GWR and MGWR.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Thu, 01 Aug 2019 01:06:13 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-9/Coding week #8https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-8/<h3><big>What did I do this week? </big></h3> <p>This week I read and experimented with the literature on Logistic Regression GAMs. After trying many approaches to model a binomial dependent variable, none of those seem to work to give the expected bandwidths or parameters. Looking forward to the discussion with the mentors to maybe understand the best next steps to resolve the model convergence. Also read and understood the predictions for un-sampled locations in the GWR code and will attempt to resolve the recurring errors and build the prediction model for MGWR.</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on finalizing the approach or way forward for the Logistic Regression within MGWR with the mentors' guidance and build on the final part of the project around predictions.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>The modeling of the binary response variable with MGWR is not resolved and has been a blocker for a little bit. Hoping to find an approach that works with the mentors' advice soon and work further on the predictions with GWR and MGWR.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Thu, 25 Jul 2019 06:14:33 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-8/Coding week #7https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-7/<h3><big>What did I do this week? </big></h3> <p>This week I debugged the issues being faced around the miscalculation of the three performance parameters (AIC, AICc and BIC) for the Poisson model. The parameters are as expected now and follow the expected trend. I also added other parameter checks to the Monte Carlo experiment (such as betas, performance parameters etc.). A complete notebook enlisting links to all the notebooks  within the Poisson MGWR model was made to make it easier to follow the completeness of the project. I am maintaining the Pull request for the simulated data example for Poisson MGWR and added the updated code to the PR (<a href="https://github.com/pysal/mgwr/pull/60">https://github.com/pysal/mgwr/pull/60</a> ).</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on testing the Binomial MGWR model with simulated data and finalize the approach for the Binomial model. I will also begin to understand the prediction part of the code to begin the third part of the project.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>The debugging of the parameters required going back to literature for the local scoring algorithm weights and add that to the existing code. It was challenging yet fun to understand the optimizations applied to the current code and I learnt a great deal from it.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Tue, 16 Jul 2019 04:40:53 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-7/Coding week #6https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-6/<h3><big>What did I do this week? </big></h3> <p>This week I constructed a Monte Carlo experiment design to test the parameters from the Poisson MGWR model. The model was designed to create a random sample for the independent variables, construct dependent variables for Poisson distribution and run the model for 1000 iterations. The results from the experiment were plotted in a notebook and analysed and follow the expected trend. I am maintaining the Pull request for the simulated data example for Poisson MGWR and added the experiment design code to the PR for reference (<a href="https://github.com/pysal/mgwr/pull/60">https://github.com/pysal/mgwr/pull/60</a> ).</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on testing the Binomial MGWR model with simulated data and finalize the approach for the Binomial model. I will also work on understanding and debugging an issue that is being encountered in the calculation of three performance parameters of the model. It is expected to make the Binomial model convergence simpler too.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>The Monte Carlo design experiment was time consuming and computationally intensive. This issue was resolved using parallel computing techniques that though took a little time to implement, it in turn sped up the process manifold.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Thu, 11 Jul 2019 02:17:39 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-6/Coding week #5https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-5/<h3><big>What did I do this week? </big></h3> <p>This week I tested the Binomial MGWR model using a simulated dataset with three cases - single independent variable, multiple independent variables and a global model to check with the Binomial global model. The test results compared to the existing GWR model but the bandwidths observed were not as expected for both. The scores for AIC, AICc and BIC were similar for the MGWR model as for the GWR model. After theoretical research on Binomial GAMs, I concluded that the approach was in sync with the theory and should result in comparable results. I also edited the Poisson model tests and example notebooks this week. I also performed a Monte Carlo simulation for it to test the output distribution of the parameters. The binomial model though on track, needs further exploration and resolution of a few outstanding tasks. I am maintaining the Pull request for the simulated data example for Poisson MGWR and the code base changes to accommodate these models (<a href="https://github.com/pysal/mgwr/pull/60">https://github.com/pysal/mgwr/pull/60</a> ).</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on testing the Binomial MGWR model with simulated data and finalize the approach for the Binomial model. I will also plan for the next part of the project which is to enable predictions from the model at unsampled locations and think about how to introduce that functionality.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>No major issues were encountered in testing the Poisson and Binomial model using simulated data this week. The results were as expected and comparable to the GWR and global models. The Binomial MGWR model still needs more example cases which will be updated till next week.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Thu, 04 Jul 2019 03:50:21 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-5/Coding week #4https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-4/<h3><big>What did I do this week? </big></h3> <p>This week I tested the Poisson MGWR model using a simulated dataset with three cases - single independent variable, multiple independent variables and a global model to check with the Poisson global model. The tests performed as expected and the results were all as expected. The scores for AIC, AICc and BIC were a little different from what was expected, but after testing it was realized that the simulated data was not the best use-case for a multiple bandwidth test case. I also tried the Binomial MGWR model this week. Though it ran without errors and converged, the results are not as expected. This model needs further exploration and resolution of a few outstanding tasks. I opened a Pull request for the simulated data example for Poisson MGWR (<a href="https://github.com/pysal/mgwr/pull/56">https://github.com/pysal/mgwr/pull/56</a> ) and for the code base changes to accommodate these models (<a href="https://github.com/pysal/mgwr/pull/57">https://github.com/pysal/mgwr/pull/57</a> ).</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on testing the Binomial MGWR model and resolve the issues in the results. I will also plan for the next part of the project which is to enable predictions from the model at unsampled locations and think about how to introduce that functionality.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>No major issues were encountered in testing the Poisson model using simulated data this week. The results were as expected and comparable to the GWR and global models. The Binomial MGWR model still needs further work and resolution of some issues.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Tue, 25 Jun 2019 05:18:18 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-4/Coding week #3https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-3/<h3><big>What did I do this week? </big></h3> <p>This week I was able to make changes to the existing functions within the MGWR functionality to accommodate changing the family of the dependent variable to Poisson. The results for a univariate model check using a data-set from the repository gave expected results very similar (difference to the order of 1e-06, which was deemed acceptable in the model) to the already existing Poisson GWR model. The proposed model changes and checks with the existing functions are also provided in a notebook within this open pull request (<a href="https://github.com/pysal/mgwr/pull/56">https://github.com/pysal/mgwr/pull/56</a>).</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on testing this model with simulated data to better enhance understanding of the model performance with multiple variables. Adding on to this, implementation of the MGWR model with logit dependent variables will  be implemented and tested this week.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>No major issues were encountered in implementing the Poisson model functions this week. The results were as expected and promising for further development.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Tue, 18 Jun 2019 19:00:24 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-3/Coding week #2https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-2/<h3><big>What did I do this week? </big></h3> <p>This week I implemented an independent module for the algorithm as hypothesized in the proposal. Though the model ran and the loop converged, the betas and the bandwidths from the model using a single variable did not coincide with the results from the already implemented Geographically Weighted Poisson Regression (GWPR) function. On discussion with the mentors on what could be going wrong, we decided to go forward with a different approach. This approach would entail changing the functions within the MGWR implementation to allow calling the function with the family attribute set to Poisson. This model with one variable is expected to result in the same bandwidth and beta values as from the GWPR model.</p> <h3><big>What is coming up next? </big></h3> <p>In the coming week I will work on debugging the implementation of the selector function and the MGWR fit function to allow the family attribute to be set to Poisson. The results from that model will then be checked with the GWPR model results.</p> <h3><big>Did I get stuck anywhere?</big></h3> <p>No major issues were encountered in the coding of the algorithm this week. The results were not as expected but it revealed further enhancements in the methodology that need to be made.</p> <p>Looking forward to the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Tue, 11 Jun 2019 21:04:55 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-2/Coding week #1https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-1/<h3 style="color: #aaaaaa; font-style: italic;"><big>What did I do this week? </big></h3> <p>I started with expanding and understanding a module within the PySAL package that estimates GWR models with Poisson response variables. My initial understanding was that updating and changing the functions while using the core functionality in the module to accommodate parameters from the MGWR model would be the way forward to enable its implementation for the MGWR model. It soon became that this approach would not work for more than one predictor variables in the model. The next approach I attempted was to use the existing functionality in the MGWR module to enable changing the family to Poisson() and implementing the hypothesized algorithm. On a detailed call with the mentors, it was realized that integration within the existing module could be challenging given the current design restricted to only Gaussian response variables for MGWR. Some functions would need to be re-written and new functions to handle parameters differently would be needed to supplement the algorithm and it was suggested that integration could follow once the algorithm is tested and finalized. On a discussion with regard to the algorithm suggested in the proposal it was also realized that the various estimations and updates implemented in the iterations needed to be theoretically checked and stated clearly.</p> <h3 style="color: #aaaaaa; font-style: italic;"><big>What is coming up next? </big></h3> <p>In the coming week I will work on coding a separate module calling the functions as needed and creating new functions for implementing some already existing functionality to accommodate the Poisson implementation for MGWR. Once the algorithm is tested and the implementation gives the expected output, I will work toward integrating the algorithm in the package. Alongside, I will also work on rechecking the equations from the proposal to ensure they are theoretically sound and that they read clearly.</p> <h3 style="color: #aaaaaa; font-style: italic;"><big>Did I get stuck anywhere?</big></h3> <p>This week I got stuck in a few places which led to an enhanced understanding about the functions, dependencies and module architecture. The attempts to implement the algorithm using the preexisting functions also made the differences between the existing implementation and required changes in the functions to accommodate the new implementation clearer. Detailed discussions with the mentors really helped me through the blocks and led to a defined way forward.</p> <p>Excited to be learning new things everyday and for the progress update next week!</p>msachde1@asu.edu (mehaksachdeva)Tue, 04 Jun 2019 17:57:11 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/coding-week-1/Community Bonding Periodhttps://blogs.python-gsoc.org/en/mehaksachdevas-blog/community-bonding-period/<p>Hi everyone! My name is Mehak Sachdeva and I am a first year PhD student at Arizona State University. I am very excited to be a part of GSoC and to contribute to the Python Spatial Analysis Library (PySAL) - a library I have used and learnt from tremendously.</p> <p>The community bonding period went well and it was great to get in touch with the mentors and set up weekly hangout calls for the project. I was able to understand the architecture of the module I will be contributing to and the dependencies that will be a part of the project. The mentors were hands-on and instrumental in defining sub-tasks of the project for the weeks to come to better accomplish results. So far no problems were encountered and the project is expected to follow the timeline stated in the proposal.</p> <p>Cheers and thanks for reading!</p>msachde1@asu.edu (mehaksachdeva)Wed, 29 May 2019 01:21:51 +0000https://blogs.python-gsoc.org/en/mehaksachdevas-blog/community-bonding-period/