These are chat archives for FreeCodeCamp/DataScience

18th
Mar 2018
Bigyan Karki
@bigyankarki
Mar 18 2018 00:06
Anyways, Sabin where are you from?
Bigyan Karki
@bigyankarki
Mar 18 2018 00:13
haha nice!!
lol I do
Bigyan Karki
@bigyankarki
Mar 18 2018 03:06
@evaristoc Just a quick question, is Least Squared Sum as computed by numpy.linalg.lstsq and normal equation same? Isn't LSS a way to measure error of Normal equation?
def least_squared_error(x, y, thetta):
    error = lstsq(x.T.dot(x), x.T.dot(y))[0]
    return error
here is a link to the updated, yet not vectorized LSS.
I feel like I am wrong though.
glitz20
@glitz20
Mar 18 2018 06:44
does anyone knows what
AttributeError: module 'scipy.stats' has no attribute 'chisqprob'
error means while running logistics regression in python
evaristoc
@evaristoc
Mar 18 2018 11:31

Hey, @bigyankarki! I see you have been looking for stuff! Excellent question! For what I know they are related but not the same. Let me update myself a bit (:blush:) and see if I can find a good explanation? I will try to answer today.


@sabin20 Those kind of errors, you can always try to google them. They will usually take you to StackOverflow. I must say Python is usually very clear with the error description (not always...). It appears that your scipy.stats doesn't have chisqprob?

About your previous question ("how can we convert string into unique codes?"), again encoding is the answer. The usual from-scratch implementation use a hash table to index the category to its respective encoding. A library like sklearn will provide you with all that (and more) in a module. We have already mentioned some references? Have a look and let me know how it goes?

I will find hard to replicate your errors, @sabin20: I am not trying your exercise. But I will try to help you for sure!

Bigyan Karki
@bigyankarki
Mar 18 2018 14:43
@evaristoc Thanks. You are awesome man :)
CamperBot
@camperbot
Mar 18 2018 14:43
bigyankarki sends brownie points to @evaristoc :sparkles: :thumbsup: :sparkles:
:cookie: 411 | @evaristoc |http://www.freecodecamp.org/evaristoc
glitz20
@glitz20
Mar 18 2018 16:48
@evaristoc thanks. Seems like there was some bug with scipy.stats, which I fixed with a line of code.
CamperBot
@camperbot
Mar 18 2018 16:48
sabin20 sends brownie points to @evaristoc :sparkles: :thumbsup: :sparkles:
:cookie: 412 | @evaristoc |http://www.freecodecamp.org/evaristoc
glitz20
@glitz20
Mar 18 2018 17:04
@GoldbergData did you ever got value of z greater than 100, while doing logistic regression?
Bigyan Karki
@bigyankarki
Mar 18 2018 17:30
@sabin20 did you find a way to convert features with string field to convert into integers?
pandas factorize() method seem to solve the problem
glitz20
@glitz20
Mar 18 2018 17:32
@bigyankarki yeah I did, something similar that you had mentioned before
Bigyan Karki
@bigyankarki
Mar 18 2018 17:33
oh okay. but i just read that LabelEncoder should only be used with target vectors
glitz20
@glitz20
Mar 18 2018 17:34
So, I did smth like this
data["JOB_TITLE"] = LabelEncoder().fit_transform(data["JOB_TITLE"].astype(str))
@bigyankarki
Bigyan Karki
@bigyankarki
Mar 18 2018 17:34
oh cool
glitz20
@glitz20
Mar 18 2018 17:35
but I am getting z value of 125 in some cases
Bigyan Karki
@bigyankarki
Mar 18 2018 17:35
try using factorize method instead and see if that helps
Josh Goldberg
@GoldbergData
Mar 18 2018 18:00
@sabin20 not that I can recall now.
glitz20
@glitz20
Mar 18 2018 19:01
anyone here who knows about factorize in pandas?