4

The real state of the art here is the Matrix Profile suite, developed by Eamonn Keogh and his team in University of California at Riverside (UCR). Here are some links to get you started: Matrix Profile Foundation homepage The UCR Matrix Profile Page MPA: a novel cross-language API for time series analysis paper (2020) with links to Python, R, and Go ...


4

The statement in principle seems very vague, how can one state that there are better classification than regression algorithms? With that said I would rephrase the statement to: Sometime it is feasible to turn a regression into a classification problem due to for the problem itself, it makes sense to predict a range/bin instead of a continuous value. When ...


3

You can simply approximate $f(x)=|x|$ by $f(x)=\sqrt{x^2+c}$ where $c>0$. You can also utilize subderivative method.


3

[edit] See also Carlos' answer, I think it's better than mine. You should use one hot encoding for the categorical features. Replacing categorical values with numerical ones would be a bad idea, because it introduces order between the values and the model would try to find patterns based on this order (e.g. 'x < 4'). If there were really too many ...


3

If you have high cardinality categorical data(more than 10 at lest) you can do Target Encoding. One hot Encoding for high cardinality is bad for the following: The input data for the model becomes very wide, and neither an optimal nor an - efficient approach are guaranteed, The created features become sparse(most of the levels hardly appear in the data) ...


3

While most answers here suggest to use various encoding schemes, I would like to propose a different approach: collapsing categories. The idea is that if there are two (or more) similar categories, you can unite the, into a single category, thus reducing the dimensionality of the feature/variable. Also, if there are some categories with expected low ...


3

It really comes down again to statistical modeling vs. decision-making. But I generally agree with you that the practice isn't beneficial; at the very least I think your TAs statement with the word "often" is incorrect. In the TA session, my TA claimed, that regression problems should often be cast into classification problems by dividing the ...


3

if suppose regression wasn't linear, would SST=SSE+SSR still hold? If yes, why? If no, why? Just to be clear that with linear regression it is perfectly OK to model nonlinear associations such as $y = 2x + 3x^2 + 17log(x)$ simply by including the relevant nonlinear terms, because it would still be linear in the parameters. I guess you are aware of this, but ...


3

I am assuming a linear regression of the form $$y = w_0x_0 + w_1x_1+ \ldots w_px_p + \varepsilon.$$ If we combine all output observations into a single vector $\mathbf{y}$ and represent the data matrix with an 1-column from left as $\mathbf{X}$, then we can express the linear regression $$\mathbf{y} = \mathbf{X}\mathbf{w} + \mathbf{\varepsilon},$$ in which $\...


3

That problem would be better modeled as survival analysis, the expected duration of time until one event occurs. The event in your case would be revisit to the website. Survival analysis could also predict which people are most likely to revisit.


2

Performing such benchmark is not that easy. Meaning one can not just pick a few data set and run these models as there is a data dependency. In such cases, one need to simulate data through various process - the simulation helps to design various data in various condition. for example perhaps model one is doing a better job at binning so, the data with ...


2

Thanks for this question I think it is a nice use case to play with time series forecasting in all (or many) of its types. As you suggest, there are several possible approaches, and all of them are valid hypothesis a priori to check and validate with your goal. Answering the question: yes, it is possible to build a single model to predict the sales amount ...


2

To clarify the questions raised by the user in response to the correct solution given by Erwan - the solution proposes going back in time to prepare the data across a series of timestamps. There will be multiple points in time 't' where the input would be all the various features on the patients health, medication, reports etc..you need to see how best they ...


2

This could be seen as a "simple" binary classification problem. I mean the type of problem is "simple", the task itself certainly isn't... And I'm not even going to mention the serious ethical issues about its potential applications! First, obviously you need to have an entry in your data for a patient's death. It's not totally clear to ...


2

The main problem in your test is that your X has the same scale as your noise level (0-1), as a result, adding a noise changes your data distribution significantly. This is your data distribution before and after adding noise. It is like the noise is 50-200% more than your initial data. That's why you get a better result with CV than the "ground truth ...


2

Yes, a GBM with Huber loss initializes with the median. The relevant bit of code is the method init_estimator of the loss class, in the file _gb_losses.py. For HuberLossFunction: def init_estimator(self): return DummyRegressor(strategy='quantile', quantile=.5) (source)


2

Doing it is easy. Simply create a mapping between your 11 values and embeddings of any size. Choosing the values for the embeddings is typically done through training a neural network that embeddings are part of. You could use dimensionality reduction techniques like PCA for instance as an alternative. Now, embeddings only make sense if they represent a ...


2

Personally I think linear (through model's coefficients/weights) and tree-based models (gain importance) are the best for explainability But this is not restricted to those models since you can use model agnostic techniques to explaine any model, even those consider as "black-box" Like: SHAP Values Partial Dependence plot LIME You can check this ...


2

Essentially you want to pick a function that will give you the "size" of a matrix. The most obvious way I can think of is by choosing a matrix norm, which is a map $\lVert \cdot \rVert \colon \mathbb{R}^{k, k} \to [0, \infty)$ (or you could generalise to a complex $k \times k$ matrix if you wished). Your suggestion seems similar to computing $$S = \...


2

A $R^2$ that is that low tells you that your model is not good. Therefore, you can both make it positive and nearer to 1 by : a) getting better/more data, or b) picking a better model for your data. Also, it'd be more helpful to plot the true/pred values against the underlying $X$ values and not just as a sequence.


2

According to the sklearn.svm.SVR documentation, the negative $R^2$ value indicates that your model is arbitrarily worse than the trend line on trainY. By default you should check the following: Does your model have a bias/intercept? If not you may observe negative $R^2$. Is testY derived from your training data? Am I using a linear function to fit the data? ...


2

Everybody understands how to perform $k$-fold cross-validation but there is often quite a lot of confusion about where/how to use it. So thanks for this good question :) First, cross-validation is a statistical method for evaluation, not for training: Of course training is performed during cross-validation, but it is performed $k$ times and therefore there ...


2

Since you specifically mention Python, one option is the Prophet package. The model fitting would be something like: # Create the pandas DataFrame import pandas as pd data = [['2021-01-01', 11, 20, 30], ['2021-01-02', 22, 40, 60], ['2021-01-03', 33, 60, 90]] df = pd.DataFrame(data, columns = ['Day', 'X', 'Y', 'Z']) df['ds'] = pd.to_datetime(...


2

It is possible to constrain to linear regression in scikit-learn to only positive coefficients. The sklearn.linear_model.LinearRegression has an option for positive=True which: When set to True, forces the coefficients to be positive. This option is only supported for dense arrays. The positive=True option is not available for ridge regression in scikit-...


2

Look at the equations. Both are functions of mean squared error. Any model the outperforms on one will outperform on the other. The danger I see with $R^2$ is that it puts us in a position of thinking of grades in school, yet an $F$-grade $R^2=0.4$ could be quite excellent for some models, while an $A$-grade $R^2=0.95$ could be quite pedestrian for some ...


2

Another way to approach the problem is to take all of the trained models and compare each of their performances on the same hold-out dataset. This is the most common way to evaluate machine learning models. Choosing the evaluation metric to use depends on the goal of the project. Most machine learning projects care about predictive ability. R² is not a ...


1

The issue with numerical encoding in this context is you are enforcing that your input variable X is ordinal when it's likely not. This is telling your model that the order in which you encode your inputs are either increasing or decreasing monotonically with your target. Let's say you encoded your data like this: [North] - 0 [East] - 1 [West] - 2 [South] - ...


1

Yes, by customizing the model with new information. But, you have to run atleast one training, with complete cycle and export output. the general example from tensorflow is here


1

The issue of using any linear model (a polynomial regression is a particular case of a linear model, with polynomial features), is that an ensemble of linear models is still a linear model. So, the family of models to optimize from given by the boosted polynomial regression and the single polynomial regression are the same. This doesn't happen with trees, as ...


1

From my understanding Prophet is just a linear regression library that helps to analyze time series with some nice features (like holidays, Fourier transformation, etc.). So from the mathematical standpoint, the regressor must be an ordinal scaled value. The docstring also implicitly says something about it. See the keywords 'additive' and 'multiplicative'. ...


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