New answers tagged

1

This "train split" you named train_set and test_set are not guarantee to be clean or even balanced. When your test set has better performance than your training set that might mean that you have data leakage (some examples in the test set are equal to the training set) or just mean your test set is slightly easier than the training set.


2

In "The Elements of Statistical Learning" by Hastie et al the authors describe two tasks regarding model performance measurement: Model selection: estimating the performance of different models in order to choose the best one. Model assessment: having chosen a final model, estimating its prediction error (generalization error) on new data. ...


0

Neural Networks are very flexible and with a proper architecture + training they can model just about anything. The reasons you don' see ANNs used everywhere is because ANNs are "black boxes", we don't really understand how they work contrary to simpler methods They are very computationally intensive ANNs are indeed used more often in non-linear ...


1

The question mixes two different notions: models (or algorithms) and accuracy. Let me clarify them. Model (or Algorithm) is a classification technique and 'Accuracy' is one of the ways to evaluate the performance of the models. You can choose any models(Naive bayes, SVM or other deep learning techniques) to implement your classifier. They are independent ...


1

This seems more like an ETL job than an API one. Of course you can have both, but in your specific case I would design it as a series of tasks where each task you extract, transform and load data. Airflow is an amazing tool for that: https://github.com/apache/airflow In airflow, each ETL is defined as a DAG (directed acyclic graph) with a series of tasks ...


0

This can be treated as Multivariate Time Series Forecasting, for this you can look into Vector AutoRegression(VAR). Because there might be some association between attributes which we need to take care of hence we can't treat them as separate time series entities. If you have found some hierarchical relationship between variable you can also look into ...


0

Outlier detection is part of data preprocessing and used to remove some of the rare events but it could happen that rare events are important to us like fraud detection in that case it becomes important and so we can't do outlier detection beforehand. In that case we do various approaches like undersampling of majority events or oversampling of minority ...


2

Using python vs R is more of a personal choice, but most people I know in data science, including myself, use python. If you decide to take up python, almost all of the python ML libraries are written using OOP approach, hence, some of the API design and interactions (such as error/warning messages) will make more sense if you are familiar with basic OOP ...


2

Ist all about productionisation of ML solutions. oops and ood are just computer programming paradigms that you use to achieve this, and you can learn this independent of your background. Python is used for production systems (among other things) Even though now you can get away with average programming skills in the future more and more of what now is ...


3

It actually depends on the role you get as a Data Scientist. If you have to write production-quality code at a large software company, then you need to be knowing the basics of Object-Oriented Programming (OOP). Object-Oriented Design (OOD), however, is something you need not necessarily know in a Data Science role. Learning OOD in case you plan a switch to ...


0

While there may not be any added value, is there is any harm in applying standardization to features which were already one-hot encoded ?


3

The $k$-fold cross-validation (CV) process (method 2) actually does the same thing as method 1, but it repeats the steps on the training and validation sets $k$ times. So with CV the performance is averaged across the $k$ runs before selecting the best hyper-parameter values. This makes the performance and value selection more reliable in general, since ...


0

Recommendation systems eg. Netflix movie recommendations, I assume its pretty straight forward to get. Recommendations systems can be in either of content based filtering, collaborative filtering and combination of these two. Now, we can use matrix factorization for solve this learning problem (problem here is the recommending movies). cut short, it turns ...


0

In principle, PCA is unsupervised and therefore label agnostic. That means the down projections forced into the PCs may as well not be related to what the model is trying to predict. That may be able to measure with the amount of variance your PCs are capturing. In essence, PCA shall never be used as a means for regularisation but rather for dimensionality ...


7

What are Bias and Variance? Let's start with some basic definitions: Bias: it's the difference between average predictions and true values. Variance: it's the variability of our predictions, i.e. how spread out your model predictions are. They can be understood from this image: (source) What to do about bias and variance? If your model suffers from a bias ...


0

Well this image explains it all : in ML, you have a bias/variance dilemma : you want to create a model that is precise-enough to learn things from your data, but not perfectly-precised so it learns a tendancy and not the exact values of your training set. Variance and Bias are to be taken together : on a same model, when you tweak to lower Variance, you'll ...


0

Were your rescaled MSE and RMSE appear larger at the end? Should they be equal to the values before applying inverse transform?


0

If I understand your question correctly then yes, neural networks are exceptional in spotting patterns in data (even unstructured like images) and output the correct label Or is it better to work in this case with more than one output class and map these recognized output classes afterwards to the same class manually I am not sure I understand what you ...


0

It sounds like what you want is Multioutput Regression. Here's an article that might help. Your dataset might not be big enough to use lets say a neural network but some of the algorithms mentioned in the link I sent could work.


0

If you keep the FastText embeddings unchanged a do not finetune them during training, it does not really matter that the words were not in the training set as long as they are in the FastText embeddings. After all, this is the biggest advantage of using pre-trained word embeddings. The important property of the embeddings is that similar words get similar ...


0

Do you have some data on past clients ? For example, do you have a dataset with past clients Rank and Value, and a variable indicating if the client was good or not (binary variable 1 if the client is good and 0 if it's bad, or a variable to use as indicator, like profit done on the client for example). If you have such a thing, your problem is a basic ...


0

This seems to correspond to entity linking or possibly named entity coreference. You might find some datasets here.


0

I Highly recommend using Pipelines In the words of Andreas C. Muller Itself... "If you are not using pipelines, you maybe are doing it wrong. So in your case, this would be: import pandas as pd from sklearn.pipeline import Pipeline from sklearn.decomposition import PCA from sklearn.impute import SimpleImputer feom sklearn.preprocesing import ...


0

To me it depends on what you want to focus on : do you want to create a model dealing with original posts that are fake news, and then make an algorithm finding the original from a retweet then applying your model ? Or do you just want a model that takes one tweet, not looking if it's a retweet or not, and trying to guess if it's fake or not. In the first ...


1

TLDR: Basically, you have answered your question with your quote from Wikipedia: the common terminology is "values". The question on SE SO which you have quoted discusses the terminology from a software development perspective. But there is a difference between the use of the word "parameter" in software development and machine learning. ...


0

Based on your image, your data looks like it is uniformly distributed. You might try using more than 3 bins to look at the distribution more closely. A few points related to your questions: For uniformly distributed data, you won't be able to transform this data into a valid normal distribution This distribution is fine for use in models, no need to change ...


1

Thank you for clarifying the question @Eisen. So the question looks at two main things: To show which districts need more police presence. To classify people as to whether they will commit 1+ traffic violations, regardless of the district, given their previous number of violations, by district. For the first point, I think what would be a good idea is to ...


0

Additionally, in case I upweight my classes with compute_class_weight(), I assume that no further class distribution should be taken into consideration downstream (so when I use RandomForestClassifier(), class_weight hyperparameter shouldn't be ='balanced', again, because this would further distort the weights proportionality that is already set before. Is ...


0

Create a custom function As explained in Keras doc for custom Actiation function Creating custom activations You can also use a TensorFlow callable as an activation (in this case it should take a tensor and return a tensor of the same shape and type): model.add(layers.Dense(64, activation=tf.nn.tanh)) def custom_bin(x): return tf.where(x >= 0, 1.0 , -...


0

According to me, you should check out the correlation heatmap of the parameters, and if the parameters are having a very little correlation with each other, you should go for deep learning models. Since in DL models, each independent parameter is fed into model parallelly, and updating each weight has a unique path in the back-propagation process. whereas in ...


2

Hey I know this is a year old but I wanted to provide the answer in case you haven't got it. So page 124 says how we derive the normal equations, however the following few paragraphs explains how to deal with a bias term. You've got our dataset right, however we need to add an extra 1 to take the place of our bias in the weight vector. I'll append the ones ...


0

Population stability refers to whether the the distribution of explanatory variables is changing over time. When this distribution changes there is more concern over whether the model is currently fit-for-purpose since the data used to develop the model differs from the data the model is being applied to. The Prediction Accuracy Index (PAI) is defined as ...


0

There are multiple approaches. Two of them are: Convert time series data to structured data Convert your statistic data to time series data This article is a good introduction. For your second question about giving more weight to some features, please read this post. Hope it helps.


1

Softmax maps $ f:ℝ^n\rightarrow (0,1)^n$ such that $\sum f(\vec x) =1$. Therefore, we can interpret the output of softmax as probabilities. With sigmoidal activation, there are no such constraints for summation, so even though $ 0<S(\vec x)<1$, it is not guaranteed that $\sum S(\vec x)=1$. The sigmoidal function does not normalize the outputs, so in ...


0

Use ray or Numba for Parallel Computation. Question is "are not you able to do transfer learning to detect both in one single model"?


4

If your class imbalance is roughly 4:1, then a network that always predicts the more frequent class would have an accuracy of 80%. (That's why accuracy alone is an insufficient metric: for binary classification, you should use ROC and PRC curves. There are also more holistic scalar metrics such as MCC) Let's say your positive samples are the frequent class. ...


2

It is possible that your model does worse than a random guess for a number of reasons. Some of those could be noisy data: your model focuses to noise in the dataset rather than features that have predictive value. May be worth inspecting your dataset and look for relevant issues and class imbalance early stopping/best model: Would be worth to have a look ...


0

Maybe I'm not interpreting this correctly (I don't use Keras), but why does your softmax layer only have a single unit? The softmax function normalizes a vector to represent a probability distribution: $ f : ℝ^n \rightarrow (0,1)^n $ such that $\sum f(\vec x)=1 $. I would have assumed the softmax layer to use the same number of units as the previous, but ...


0

For binary predictions, it is standard to evaluate models based on their ROC and PRC curves. Some metrics are also useful, namely MCC, which is probably the most holistic scalar metric. Using these metrics, you should evaluate the model via cross-validation. For deep models that take significant time to train, k-fold cross-validation is often sufficient. If ...


0

A few ideas you'll often see.. Generate a list from Wikipedia titles, extract keyphrases, predict the related wikipedia pages and use the keyphrases. Generate a hand-labeled dataset. Use a graph populated with topics and the relations between words and topics to predict the most likely topics Abstractive summarization and keyphrase extraction


0

A neural network is usually trained on a large set of paired example data (supervised learning). For each example in the set, the best known optimization for each weight is calculated, but it is then multiplied by the learning rate, which is a very small number. If a learning rate was not used, you would make large adjustments to each weight, only to destroy ...


0

Training a neural network involves optimizing a large set of parameters. This optimization step is commonly known as backpropgation (a.k.a backprop) via a form of gradient descent. Backprop via gradient descent allows a network to adjust its learnable parameters (i.e., weights) such that the loss (difference between the forward pass output and the actual ...


0

Solving optimisation problems is difficult, and finding a closed-form solution that finds the optimal point for the cost function is complicated. Consequently, optimisation problems are solved using iterative steps. This means people choose solutions which are guaranteed to decrease the cost or objective function with each step. This idea is somehow used in ...


0

I do not recall lhs or rhs having intervals. Can you share an example? You can use the "appearance" parameter when calling apriori. You can find an example in the documentation of APappearance-class of arules or at http://r-statistics.co/Association-Mining-With-R.html under section "How to Find Rules Related To Given Item/s"


0

For #1, Catboost includes regularization. Having a lot of features can be handled through this regularization, no need to remove features solely for improving accuracy of the model. With proper regularization techniques, many models are able to handle having many features in the input dataset. If the model does not have regularization, then feature selection ...


0

You can refer the sklearn documentation. But if you want to use different imputer strategy for different columns you can use transformer. import numpy as np from sklearn.compose import ColumnTransformer from sklearn.impute import SimpleImputer column_trans = ColumnTransformer( [('num',SimpleImputer(strategy='mean'), ['Age']), ('num',SimpleImputer(strategy='...


0

What I saw from another post: How to obtain original coefficients after performing linear regression on normalized data? and https://stats.stackexchange.com/questions/201909/when-to-normalize-data-in-regression Looks like if the data is invariant to regression or if it's linear then it's ok to multiply the coefficient back. If not, generally it's not ...


0

Generally speaking, some ML algorithms include regularization (such as Ridge/Lasso Regression, Random Forest, CatBoost,...) and others don't (k-NN, Gaussian Naive Bayesian,...). Using one that includes regularization may not change the performance when removing less important features. This applies to your first question. If you use Lasso regularization for ...


0

Support is the number of occurrences of each label in the ground truth. For example in the results with test size=0.1, class P has only 3 samples. Based on this, if the support values are not close to each other, it only means that your data is unbalanced. This documentation might be helpful.


0

A policy is a mapping from "states" (images, joint angles, robot position) to "actions" (joint positions, joint torques, options). In that paper, the parameterized policy used is a mapping from states (robot state, joint angles and joint velocities from a state observer) to actions (target joint positions) of the robot.


Top 50 recent answers are included