New answers tagged

0

When I taught ML a while ago I had a bit of fun making my own toy datasets. You only need some creativity to see some real (yet "useless") data in your daily activities or hobbies. For example I recorded a video of me playing a videogame (Grim Dawn) in both a desert area and a dungeon area, plus some loading screens added as "noise", and ...


3

Actually, scikit-learn has a build in make_classification where you can tune the amount of noise, classes etc. to create your own dataset Then it's just up to you, to wrap the data in what ever story you like.


0

The average performance is a good summary of the performance, but you should also mention the variations across time. For example you could calculate the standard deviation across the snapshots. I think it would be confusing to say that it's the same model, normally the same model would mean single training. Instead you should explain that the exact same ...


3

Your three questions are tightly related: You should not augment the data before splitting. This leads to data leakage, as there is an overlap between the training and the test data, because you are testing your model on some images that have been already seen (although in a transformed version) during training. Therefore, you should first split, then ...


0

Decision tree are deterministic so will always make the same split if given the same data. A single decision tree will be make splits conditional on previous splits (greedily taking the best split for either the previous split feature or other features). Separate trees per feature will only split conditional on the feature the tree has access to. In general, ...


0

I'm not aware of anything similar in the literature, this might be too specific but I don't know everything. Anyway I think your approach makes sense. I'm not sure if it would help but conditional entropy is also an option for calculating the discriminative power of the individual features. Assuming the training of a model is not too long, you could consider ...


0

From the documentation: If a str, should be a built-in evaluation metric to use. See doc/parameter.rst. ... If callable, a custom evaluation metric. The call signature is func(y_predicted, y_true) where y_true will be a DMatrix object such that you may need to call the get_label method. It must return a str, value pair where the str is a name for the ...


0

Although I'm not very articulate, I'll try to detail some of my thoughts on your question. First answering your questions: Yes. Since your goal is to predict the car that the client will choose out of the 100. There isn't anything wrong with including features about those 100 cars. That said, in my opinion, the way you design your model is a bit strange, ...


0

You should select a model based on GridSearchCV result. You should not select based on the test dataset score. Selecting model based on test score lowers the chance the model with generalize to unseen data. Test datasets should only be looked at once. For the specific cases, you list, case 1 has the highest GridSearchCV result and that is the better model. ...


0

Ok, your methodology looks good, but you're on a typical problem showing why Data Scientist are true specialists, and not just "running some copied code" : You have to create your variables yourself using your knowledge about the problem. I'd say you first have to try to list the things you can measure about those devices, and that are worth giving ...


2

Text vectorisation is a good way to have a reliable classification. You have several libraries like doc2vec that you can use together with logistic regression or dimensional reduction technique like tSNE or UMAP. https://radimrehurek.com/gensim/auto_examples/tutorials/run_doc2vec_lee.html On the other hand, you can also use libraries like BERT or TF-IDF: ...


0

One option is to scikit-learn's sklearn.impute.IterativeImputer. initial_strategy could be set to "most_frequent" which a useful way to model the Bernoulli distrubtion of the features.


0

In my experience the most common cause for NaN loss is when a validation batch contains 0 instances. It's possible that you have some calculation based for example on averaging loss over several time stamps, but one of the time stamps has 0 instances causing a cascade of NaN values. Check carefully your validation set and how the loss is calculated on it.


0

The problem you are are describing makes exactly with what a decision tree does. Decision trees find "hyperrectangle in feature space with all edges parallel to feature axes". A decision tree will automatically learn the range size of the hyperrectangle and learn conditional hyperrectangles. The goal is classification where there is purity in the ...


0

Survival Analysis would be a common way to approach it. One way to model it would be to predict time-to-purchase where the prior is already purchased.


1

If we go by the formula, it can actually be zero when when at least one of precision or recall is zero (regardless of the other one being zero or undefined). Look at the formulas for precision, recall, and F1: By looking at the F1 formula, F1 can be zero when TP is zero (causing Prec and Rec to be either 0 or undefined) and FP + FN > 0. Since both FP and ...


0

Firstly, lets suppose model omits the 'Size' as most significant feature, so what is implied here, having larger size or lower size of an app contribute to the rating? What If there is no ascending or descending order in the attribute, for instance, if the 'Category' is most significant, then what category contributed the most? Decision Tree splits the ...


0

I realized that when shuffling I did not set the replace parameter to True which prevented randomness from being inserted into the process. SEED_VALUE = 3 t_clf = Pipeline(steps=[('preprocessor', preprocessor), ('lgbm', LGBMClassifier(class_weight="balanced",random_state=SEED_VALUE, max_depth=20, min_child_samples=20, ...


0

It might be framed as multi-label classification with the constraint that "winner take all" for certain labels.


0

It totally makes sense. You can also use count encodings. So, rare values tend to have similar counts (with values like 1 or 2), so you can classify rare values together at prediction time. Common values with large counts are unlikely to have the same exact count as other values. So, the common values get their own grouping with these way. For overfitting, I ...


0

It sounds like the problem can solved with business rules - have an expert write down what choices should be made by whom under what circumstances. Not all problems can be solved with machine learning.


0

Without modifying the assumptions or the model, there are two choices: The system returns the best single guess. For example, Class 2 since that is the best model's largest probability. The system returns "Not confident enough to make a prediction".


0

Dataset flower_photos.tgz label count daisy 633 dandelion 898 roses 641 sunflowers 699 tulips 799 Count the number of images in different categories import numpy as np import tensorflow as tf directory = 'flower_photos' datagen = tf.keras.preprocessing.image.ImageDataGenerator() data = datagen.flow_from_directory(directory) unique = np.unique(data....


0

Precision, recall and F1 score are defined only for the binary case (2 classes), so if you want to apply that to the multiclass case, you need to apply a trick. A typical trick is to average the recall per class: Per class, you calculate which fraction of the words actually in that class are correctly classified. balanced_accuracy_score() in scikit-learn ...


0

Since all the sentences length are not highly varying, you can use sentence embeddings and do the clustering on top of that. For example, Text => USE => vector[1024] => KMeans USE - Universal sentence encoders Kmeans - SKlearn Module You can adjust the number of clusters using these techniques.


0

Possibly - If you frame it as supervised learning problem, you would need a dataset that has those features and is labeled with age and gender. Then you could build a classification model.


0

It depends which scenario you chose. When you train any data science model, it won't move anymore. For example, if you train K-Means, you'll get at a result the cendroid of every cluster. If you train a random forest, you'll have as a result your trees. Then, when you apply your model, it gives you an answer according to that. The answer will always be the ...


0

Feature Importance Or Correlation is dependent on the approach used. It's like the model is saying, "When I used my approach I find the particular feature very important." When another model uses the same approach or an approach that is a superset of that approach, then it will be able to find that Importance too. Few examples - If RF finds a ...


1

Precision and recall are "hard" metrics. They are measure if the model's prediction is exactly the same as the target label. Often times systems like yours can use a more flexible metric such as top-5 error rate, the model is considered to have generated the correct response if the target label is one of the model’s top 5 predictions.


0

RIPPER (Repeated Incremental Pruning to Produce Error Reduction) is a method to automatically learn rule sets. It has shown to perform better than other decision tree algorithms (e.g., C4.5). However, it performs work than Random Forest.


1

It appears that you are using manual trial-and-error to search for better hyperparameters. Another approach would to be use automated hyperparameter search. Define a search space (i.e., either a range or distribution) for each hyperparameter. Then use cross-validation to find the best combination in the search space. Random search on hyperparameters is often ...


0

Before the deep learning wave, the the UCI dataset repository was widely used. It contains classic (and rather small) datasets that were very relevant in the old days, like the Iris dataset for classification. In each dataset page, you can find papers citing the dataset.


0

Since those are academic researchers, they framed the problem in the most general way possible. The $C$ term could be any random variable to be modeled. In this specific case, $C$ is the individual tokens (unigrams or bigrams). I have found empirical improvement by including bigrams highly ranked by collocations, frequently occurring n-grams. By including ...


0

It's important to distinguish the type of problem versus the task itself: Text classification is a type of problem where the input (features) is text and the output (target) is a categorical variable (class). The type of problem is part of how a problem is solved. Intent detection is a specific task, i.e. the job that one wants to perform. A task describes ...


0

This is commonly called spatiotemporal (ST) data clustering. Most common clustering algorithms have ST version. For example, there is ST-AGRID which adaptation of a grid density based clustering algorithm.


0

Every machine learning algorithm suffers from curse of dimensional to different degrees. The primary issue is the sparsity of observations as the number of dimensions increase. Since decision trees are greedy, they are one of the most robust machine learning algorithms to sparsity. Decision trees will automatically find the single feature to that best ...


3

You are currently using the fit_transform method on both your training dataset as well as your test set. This is incorrect since you should not fit the model on your test set as (depending on the model used) this would be overfitting, and it can give issues with dataset shapes when creating new columns based on the values in the data (count vectorizer, ...


Top 50 recent answers are included