New answers tagged

0

You need to create a tidy version of the data with the on_amt and discount_rat encoded as a categorical variable (e.g., one-hot encoded). If they are continuous, they need to binned into categorical variables then encoded.


1

I agree to opinions said before. Just as alternative, if you see that customer behavior is too different if it is a guest or not, depending also on model you use, probably it would make sense to use two different models. For example, if you know will use LogisticRegression and not regular customers behavior is distributed in bigger range, then probably you ...


0

Keep only one dataframe Add a column(if not available) to mark - Guest Or Customer Then, simply split with stratify flag on that column from sklearn.model_selection import train_test_split x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=19, stratify=data['guest']) stratify : array-like, default = None If not None, data ...


0

Would it be a possibility to do the following: keep one dataset but give those unknown customers a unique number per unique order number. Something like updating the customer code column with the same code like the unique order number prefixed with something that indicates that it was an unknown customer before.


1

Welcome to Data Science at StackExchange, One way to accomplish this is to use the stratify option in train_test_split, since you are already using that function (this will also work for ensuring your labels are equally distributed, very useful in modelling an unbalanced dataset): Train,Test = train_test_split(df, test_size=0.50, stratify=df['B']) In my ...


0

If I understand what you’re trying to do, something like... (df.groupby(['orig','dest','dep_date','ret_date','airline'], as_index = False, sort=False) .agg({'search_date': 'first', 'price': 'min'}) .reset_index(drop = True)) ... should do the trick. However I’m sending this from my phone and can’t check whether the code works right now. Will edit if ...


0

Welcome to Data Science at StackExchange, If you don't mind seeing duplicates where there may be 2 different search dates having the same min price, you can include the search_date in your group by: df.groupby(['orig','dest','dep_date','ret_date','airline','search_date'],sort=False)['price'].min().reset_index() If you only want one of these records, you can ...


1

I don't think so, since: USD is usually used as a reference. Providing exchange rates for all possible pairs would be to much data. If there are 100 countries, there would be 100! (factorial) different pairs. Exchange rates for all different pairs can be calculated manually by using the USD rates of two pairs.


0

I suggest R. It allows for easy data handling including a good GUI (RStudio) and high-quality plotting tools (e.g. ggplot2). df = data.frame(c(1,2,3,4,3,4,8,6,2,3),c(5,4,3,6,5,4,2,6,7,8),c(1,2,3,4,5,6,7,8,9,10)) colnames(df)<-c("a","b","c") df library(reshape) df2 = melt(data = df, measure.vars = c("a", "b&...


1

Hi Soumyadeep and welcome to Data Science/Stack Exchange What you are describing is called regression imputation, and it is a valid method to use on missing data. However, if the data is sparse (lots of missing values), this issue will be more difficult to handle. In general, missing data can be handled in several ways (row deletion, imputation, substitution,...


0

A correlation matrix is symmetric because it represents correlations among variables and correlation is a symmetric relation. What is a correlation matrix? A bit more formally, for a set of $n$ random variables $X_{1},\ldots ,X_{n}$ the correlation matrix contains at place $(i,j)$ the value of the correlation between $X_{i}$ and $X_{j}$. Denote by $corr(X_{i}...


1

Your example is a star schema, it's just a star with three points (dimensions). It's OK to have star schemas with more dimensions. Some large OLAP schemas can have tens of dimensions. The star schema holds the underlying data. The cube is a convenient set of pre-aggregated values that make our run-time faster. The "cube" name is a handy visual and ...


1

So the question is about whether you could use the model you have described to create valid predictions of COVID-19 occurrence in Toronto. I would say this is depend on the data you have used. Check the distribution of features (age, population density, etc.). If there is large variation in the features(such that the Toronto values are observed as outliers ...


0

A little bit too late to the party but it's better than never. We've released a major version update to our time-series data labeling tool called Label Studio. Now it supports a variable number of channels with millions of data points in each, with zoom/pan, region labeling, and instance (single event) labeling. It works with different time-series data types,...


1

ATM I know of TSimulus and TimeSynth to generate data programatically in a controlled manner (instead of generating random data). TSimulus allows to generate data via various generators. TimeSynth is capable of generating signal types Harmonic functions(sin, cos or custom functions) Gaussian processes with different kernels Constant Squared ...


0

Most classification algorithms actually provide continuous scores that are compared to a given threshold to give a binary output. Using that score directly give you a ranking. But unless you give us a specific algorithm, it would be difficult to help you further. You usually can find that trough the performance metrics. AUC for exemple, has a general ...


1

You can check the class of the class(df$dependent). You are expecting it to be numeric. To convert multiple columns to factors, you can do something like this factor_cols <- c("col_1","col_7"), df[factor_cols] <- lapply(df[factor_cols], as.factor) If you keep the customer id, then you will have a problem when applying your model to a new customer.


0

Take a look at dc.js (which uses Crossfilter and D3.js) Dc.JS Examples of dc.js visualization are available Here Crossfilter supports showing million or more rows.


Top 50 recent answers are included