People who code: we want your input. Take the Survey

# Tag Info

20

You might want to interpret your coefficients. That is, to be able to say things like "if I increase my variable $X_1$ by 1, then, on average and all else being equal, $Y$ should increase by $\beta_1$". For your coefficients to be interpretable, linear regression assumes a bunch of things. One of these things is no multicollinearity. That is, your $X$ ...

19

You do not need domain knowledge (the knowledge of what your data mean) in order to do feature engineering (finding more expressive ways of framing your data). As Tu N. explained, you can find "quick and dirty" combinations of features that could be helpful pretty easily. Given an output $y$ and an individual feature $x$, you can take the following ...

11

Remember that the GradientBoostingRegressor (assuming a squared error loss function) successively fits regression trees to the residuals of the previous stage. Now if the tree in stage i predicts a value larger than the target variable for a particular training example, the residual of stage i for that example is going to be negative, and so the regression ...

8

In general regression models (any) can behave in an arbitrary way beyond the domain spanned by training samples. In particular, they are free to assume linearity of the modeled function, so if you for instance train a regression model with points: X Y 10 0 20 1 30 2 it is reasonable to build a model f(x) = x/10-1, which for x<10 returns ...

8

The a second bullet is the value in feature hashing. Hashing and one hot encoding to sparse data saves space. Depending on the hash algo you can have varying degrees of collisions which acts as a kind of dimensionality reduction. Also, in the specific case of Kaggle feature hashing and one hot encoding help with feature expansion/engineering by taking all ...

7

You can use the DataFrame.fillna function to fill the NaN values in your data. For example, assuming your data is in a DataFrame called df, df.fillna(0, inplace=True) will replace the missing values with the constant value 0. You can also do more clever things, such as replacing the missing values with the mean of that column: df.fillna(df.mean(), ...

6

As you would have seen in the research, AUC ROC prioritizes getting the order of the predictions correct, rather than approximating the true frequencies. Usually, like in the credit card fraud problem you link to, the impact of one or two false negative is more devastating that many false positives. If those classes are imbalanced, like they are in the ...

5

Kaggle competitions with clean, anonymised and opaque numerical features are often popular. My opinion is they are popular because they are more universally accessible - all you need is to have studied at least one ML supervised learning approach, and maybe have a starter script that loads the data, and it is very easy to make a submission. The competitions ...

5

Go to your Google Drive and right click the dataset you want to upload to Kaggle. Generate the shareable link and the code that comes after https://drive.google.com/open?id=, it should be a long code (like 3tlxSE__5eL3q7Zb31M3CEKHlieGWZYgM) Insert the long code at the end of https://drive.google.com/uc?export=download&id= Copy that link. Should look ...

4

You can take different combinations of features such as sum of features: feat_1 + feat_2 + feat_3 ..., or product of those. Or you can transform features by log, or exponential, sigmoid ... or even discretize the numeric feature into a categorical one. It's an infinite space to explore. Whatever combination or transformation that increases your Cross-...

4

"publictest" data is used to calculate the score for the public leaderboard while competition is running. After the competition is finished, competitors will be ranked on the data which was marked as "privatedataset".

4

The privatetest data is needed because competitors can in principle overfit the publictest data. On Kaggle you are allowed to submit your scores multiple times and see your performance. By this constant feedback one could, on purpuse or subconsciously, overfit. It is a good practice to assess model's performance on completely new and unseen data.

4

On a side note, I don't think correlation is the correct measure of relation for you to be using, since Survived is technically a binary categorical variable. "Correlation" measures used should depend on the type of variables being investigated: continuous variable v continuous variable: use "traditional" correlation - e.g. Spearman's rank correlation or ...

4

3

The skewed data here is being normalised by adding one(one added so that the zeros are being transformed to one as log of 0 is not defined) and taking natural log. The data can be nearly normalised using the transformation techniques like taking square root or reciprocal or logarithm. Now, why it is required. Actually many of the algorithms in data assume ...

3

3

First of all, I noticed you have loaded the same dataframe for both train and test. Change the code like this: import numpy as np import pandas as pd train = pd.read_csv("https://raw.githubusercontent.com/oo92/Boston-Kaggle/master/train.csv") test = pd.read_csv("https://raw.githubusercontent.com/oo92/Boston-Kaggle/master/test.csv") At this point, one-hot ...

3

Here is an approach using the encoders from sklearn import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder, OneHotEncoder train = pd.read_csv("https://raw.githubusercontent.com/oo92/Boston-Kaggle/master/train.csv") test = pd.read_csv("https://raw.githubusercontent.com/oo92/Boston-Kaggle/master/test.csv") labelEncoder = ...

3

It's FireplaceQu not FirePlaceQu . A KeyError means it doesn't find the column in the dataset. to simply check the spelling you can print all the columns: for col_name in train: print(col_name) or check if your spelling of a column is correct: "FirePlaceQu" in list(map(lambda x: x, train))

3

Chapter 5 of "Introduction to Statistical Learning" covers CV and bootstrap. I strongly recommend to read this chapter, since sampling methods are extremely relevant in practice. Cross validation (CV) usually means that you split some training dataset in k pieces in order to generate different train/validation sets. By doing so you can see how well a model ...

3

Is there any kaggle competition out there doing EDA (Explotary data analysis) not prediction for finding the most significiant feature that affects the net_revenue or sales ? Although it is hard to prove a negative, I would say "no" to this. Kaggle competitions are based on continuous metrics that can be ranked, such as getting best log loss, mean ...

3

There are several rundowns between the two services like this one. Key for me: Only Kaggle supports R, only Colab supports SWIFT Colab is a Google product and is therefore optimized for Tensorflow over Pytorch Colab is a bit faster and has more execution time (9h vs 12h) Yes Colab has Drive integration but with a horrid interface, forcing you to sign on ...

3

So, after a lot of digging, I found something in the comment section. They are document embeddings. There is a github repo that specifies an API. Paper on arxiv Example usage of a similar approach Relevant Comments from the Kaggle Comment section on the Data Update Log for the CORD19 Dataset: Comment 1 Comment 2 Examples how to visualize the ...

2

But the problem of this dataset is that we have unbalanced data I think that the way to fix your problem is to use something like SMOTE or one of its variants. (My favorite is SMOTE-ENN, but go with what works the best). Here is an implementation that you can use to fix the class imbalances. I don't know if this will solve your specific problem, but it is ...

2

You've already answered yourself by tagging kaggle. Let me share the two competitions that I have every new hire in my team go through- and then have them keep improving their solurion for the next six months. These are a very well curated set of problems for a budding data scientist! Titanic: Machine Learning from Disaster https://www.kaggle.com/c/titanic ...

2

Here's my understanding: I think it's the explanation of page 10, and time is the same as the "time" in page 10, which means the time axis in real life. In page 10, it shows that: hold out data should be out-of-time, we can not do a random shuffle because it will not represent the real situation our model will be faced. unless data is extremely small As ...

2

A KFold split will take the data and split it however many times you designate. StratifiedKFold is used in order to ensure that your training and validation datasets each contain the same percentage of classes (see sklearn documentation for more). The function StratifiedKFold takes two arguments, the array of labels (for binary classification this would be ...

2

First of all, you are correct that your code is old as some functions being used are deprecated (e.g. Convolution2D is now Conv2D see here). However, the error clearly states that you are trying to concatenate two tensors that their dimensions do not match. When concatenating two tensors along a specific axis, all other dimensions except the one being ...

2

Some libraries auto encode categorical features into numbers before running the model. Pre-processing the categorical features is done explicitly by the programmer or within framework. Can you post more details with your questions?

2

The fast hist mode is available in newer versions of XGBoost. You can find infos on https://github.com/dmlc/xgboost/ For small data sets (100k lines), you wont feel much gain in training speed.

Only top voted, non community-wiki answers of a minimum length are eligible