leig / applied-predictive-modeling-with-python Goto Github PK
View Code? Open in Web Editor NEWA collection of notebook to learn the Applied Predictive Modeling using Python.
License: MIT License
A collection of notebook to learn the Applied Predictive Modeling using Python.
License: MIT License
Hello, Thanks for your effort as these notebooks are very helpful. However, i am facing issues with fetchdata as pandas.rpy.common have become obsolete and could not be used anymore, though i have tried using rpy2 but it does not work as expected. Could you please share your .csv files for datasets or if you could help with the code. Thanks.
Hi All
As we all know, this was written way back and since not been actively maintained. Here are the code changes to be done to make it work on python 3.
Step1: Changes to the import
Remove:
import pandas.rpy.common as com
Add:
from rpy2.robjects import r
from rpy2.robjects import pandas2ri
from rpy2.robjects.conversion import localconverter
Step2 : Change URL value
In line #16, remove
APM_URL = ('http://cran.r-project.org/src/contrib/'
'AppliedPredictiveModeling_1.1-6.tar.gz')
and instead add
APM_URL = ('https://cran.r-project.org/src/contrib/Archive/AppliedPredictiveModeling/'
'AppliedPredictiveModeling_1.1-6.tar.gz')
Step 3: Modify the function convert_datafiles in line#123
Remove line# 140
myRData = com.load_data(var)
Instead add the following lines
r.data(var)
myRData=r[var]
with localconverter(robjects.default_converter + pandas2ri.converter):
myRData = robjects.conversion.rpy2py(myRData)
That's it. You may encounter problems with R - make sure you install R and the R path is exported in the PATH variable. Otherwise, the above changes should work. Please note that I tested my changes only on Mac OS X.
I am new to python. As the code was written some 4 years back, I am not able to use some functionalities. Currently I am using Python version 3.7.3 and it no longer supports pandas.rpy.common. So I am importing pandas2ri from rpy2.robjects to tackle this.
In the function convert_datafiles(datasets_folder) in the loop for var in robj, I am replacing first myRData = com.load(var) with myRData=pandas.ri2py(var).
But I am not getting any success in it. Please help me out in this.
Hi thanks for sharing the notebooks! Could you please share the .csv files that you use for the analysis?
Hi,
Could you share chapter 9 and 10 as well? Or do you intentionally deleted them?
Thanks!
Hi,
Thanks a lot for creating these notebooks. They are great!
I have a PR to add a particular plot in one of the notebooks. Are they being considered?
Please let me know.
Regards,
Keshav
Hi, Thank you very much for doing this. I found the figure in out[67] in Chapter 6.ipynb might have wrong axis names. The y label should be percentage of total variance, and the x label should be component.
I'm the first author (Max). Thanks for doing the translations to python. I'd like to offer any top-level help that I can (e.g. "why did you do it that way" or "what exactly does this do").
There are probably a few models not in scikit-learn but we can probably find something fairly similar.
One request though... please try not to copy/paste a lot of text directly from the book. Our publisher might go apeshit over that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.