Kelaberetiv

kəˈlabərətɪv/ 
adjective: collaborative

Bringing together the AI community in Singapore – companies, startups, researchers, students, professionals – to collaborate, find research and business opportunities and talent.

Have an account? Login
New user? Register
Forgot password? Reset

AI Singapore uses a 2FA login mechanism to protect your account. Learn more about it here.

Opportunities

  • Have an interesting story to share?
  • Seeking for AI talent for your organization?
  • Seeking research interns for your labs?
  • Seeking an industry partner for your AI projects?
  • Are you a researcher and seeking an industry partner to do a POC or deployment of your IP/research outcomes?

Intermediate Python for Data Science  

  RSS

Liyi Ang
(@liyi)
Member
Joined: 9 months ago
Posts: 52
November 21, 2018 9:09 pm  

Do you have any questions relating to Intermediate Python for Data Science? Leave them here!


Quote
hanqi
(@hanqi)
Active Member
Joined: 7 months ago
Posts: 15
November 22, 2018 9:48 am  

In part 1  Matplotlib - Scatter Plot (1)

I see plt.xscale('log') being introduced to compress gdp_cap on x-axis when scatter plotting life_exp on y-axis.

This got me questioning .

When plotting a y=log(x) graph (or a scatterplot close to that) , why do people look for straight lines (to argue there is good correlation) after doing things like transforming x axis to log(x) and relabeling/compressing the xtick positions of x values of 1,2,3,4 ..... so on. Isn't that lying to yourself?
By the same reasoning, we can transform any non linear function of y=f(x) into a straight line visually by manipulating the x tick positions right? Just to say "we have a straight line"

Going from visual tick manipulation to math, does Universal approximation theorem apply to 1 input - x and 1 output - y scenarios? If yes, can we then always say y is a linear function of combination_of_transformations (x)?

What are the special advantages of being able to visually see/mathematically transform to straight lines that gives linearity such high prominence in math/statistics? Why not leave things in their non-linear form?
Is it a limitation of people's minds that we cannot make confident decisions until we visually see linearity? (just like some people can draw perfect circles, i believe there exists people who can write the equation of a log graph with the correct base and scaling just by looking at the graph, and they would be perfectly comfortable with not looking at straight lines)

On transforms, I can see sin, cos, tan came naturally from circles and triangles, and calculus came naturally from trying to make sense of rates of change, did transforms like log (don't mean base e), exponential, arise in nature? Are there examples of other transforms yet to be invented or we have discovered all possible? (meaning all mathematical modeling is already constrained/settled to an established vocabulary of basic transforms)


ReplyQuote
williamtjhi
(@williamtjhi)
New Member
Joined: 7 months ago
Posts: 1
November 27, 2018 2:39 pm  

One answer is because by establishing linear relationship, it opens up the possibility of applying certain families of algorithms for analysis without breaking any assumption, e.g. Generalised Linear Model, and to a certain extent, SVM and PCA. These algorithms are usually, in some aspects, simpler for modelling (e.g. as opposed to do non-linear modelling), and hence preferred. We can use the transformed variable in place of the raw variable to maintain linearity.

On the second question, I doubt we have discovered all possible "natural" transforms.

Hope this helps.


ReplyQuote
luihuiliang
(@luihuiliang)
New Member
Joined: 4 months ago
Posts: 1
March 5, 2019 3:45 pm  

Hi,

I'm enrolled for the second run for AI4I, and I can't access the DataCamp modules via my laptop now.

Mobile access is fine, but when I tried clicking on the "Resume Track" button on DataCamp, it returns a blue page stating:
"The change you wanted was rejected. Maybe you tried to change something you didn't have access to."


ReplyQuote
Liyi Ang
(@liyi)
Member
Joined: 9 months ago
Posts: 52
March 5, 2019 4:46 pm  

Hi luihuiliang, 

Please drop us an email (ai4i@aisingapore.org) so that we can help you out!


ReplyQuote
liyenz
(@liyenz)
Active Member
Joined: 4 months ago
Posts: 6
March 10, 2019 3:32 pm  

Hi, I did put in the code,
plt.xscale('log')

what does it suppose to show on the scatter plot? please advise. Thanks.


ReplyQuote
ringoshin
(@ringoshin)
Active Member
Joined: 7 months ago
Posts: 9
March 10, 2019 5:27 pm  

Hi, I hope this will answer your question:

https://matplotlib.org/api/_as_gen/matplotlib.pyplot.xscale.html

It applies log scale to the x-axis of your plot.


ReplyQuote
liyenz
(@liyenz)
Active Member
Joined: 4 months ago
Posts: 6
March 14, 2019 10:46 am  

Hi ringoshin, thank you for the link. now i got the idea from it.

 

 


ReplyQuote
liyenz
(@liyenz)
Active Member
Joined: 4 months ago
Posts: 6
March 14, 2019 10:48 am  

Hi Liyi, I got an issue to proceed next after completed the Matplotlib. My subscription issue, can help?


ReplyQuote
Liyi Ang
(@liyi)
Member
Joined: 9 months ago
Posts: 52
March 18, 2019 2:58 pm  

Hi Liyenz, 

Sorry about the glitch you are facing.

Do drop us at email at ai4i@aisingapore.org so that we can troubleshoot the issue. 

Thanks!

 


ReplyQuote
liyenz
(@liyenz)
Active Member
Joined: 4 months ago
Posts: 6
March 18, 2019 11:31 pm  

Hi Liyi, Sent 🙂


ReplyQuote
sundance071
(@sundance071)
New Member
Joined: 4 months ago
Posts: 4
April 4, 2019 5:35 pm  

Hello ..

How do I write a line of code in Datacamp's iPython and go to the next line without triggering its execution? For example, I like to write "for x in range (10) : if x > 5 : print (x)"

The interpreter does not accept the "if". The moment I press "enter", the code is executed. The "\" character for new line does not work.

The only way I know that this can be done is to write my code in notepad - using next line and indents - and then cut-and-paste this over. This works and the new line will be prefixed with "...".

 

Regards


ReplyQuote
hanqi
(@hanqi)
Active Member
Joined: 7 months ago
Posts: 15
April 4, 2019 7:30 pm  

Hi @sundance071 you can use shift+enter to move to next line. When indentation is required like def func(): , tab will not work, you must press {space} 4x. If you want to use their execution environment, you can just comment out all the exercise code by holding alt+drag your mouse down to create a long vertical cursor and press # to insert it into every line. To run without submitting, Ctrl+A to select all (or highlight the lines you want), then ctrl+enter. It would be good to do it in your own environment though, so you can create your own extensions of their exercises and reduce dependence on their in-browser.  

This post was modified 3 months ago by hanqi

ReplyQuote
sundance071
(@sundance071)
New Member
Joined: 4 months ago
Posts: 4
April 5, 2019 9:04 am  

Hello Hanqi,

Thank you very much for your reply. The "Shift + Enter" key works.

 

Regards

Jeff


ReplyQuote
ALEXHAY
(@alexhay)
New Member
Joined: 4 months ago
Posts: 4
June 22, 2019 5:26 pm  

Hi Liyi,

When I logged into DataCamp today, I observed there is an option to enrol to a new version. Should I do that? 

 


ReplyQuote
Share:
  
Working

Please Login or Register