id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_79592576 | stackoverflow | MACHINE_LEARNING | YOLOv8 recognition under motion blur | YOLOv8 recognition under motion blur
I am currently developing a robot that uses YOLOv8 for real-time object detection based on the video captured by the robot’s camera. However, when the robot rotates, the input image becomes blurred, which causes a significant drop in detection accuracy. As a result, the robot has t... | https://stackoverflow.com/questions/79592576/yolov8-recognition-under-motion-blur | python, machine-learning, computer-vision, object-detection, motion-blur | 1,745,585,935 |
se_25770429 | stackoverflow | MACHINE_LEARNING | Machine learning for monitoring servers | Machine learning for monitoring servers
I'm looking at pybrain for taking server monitor alarms and determining the root cause of a problem. I'm happy with training it using supervised learning and curating the training data sets. The data is structured something like this:
* Server Type **A** #1
* Alarm type 1
... | https://stackoverflow.com/questions/25770429/machine-learning-for-monitoring-servers | python, go, machine-learning, neural-network, monitor | 1,410,366,007 |
se_79419018 | stackoverflow | MACHINE_LEARNING | YOLOv8 Final Detection Head Still Outputs (1, 7, 8400) Instead of (1, 8, 8400) for 3 Classes | YOLOv8 Final Detection Head Still Outputs (1, 7, 8400) Instead of (1, 8, 8400) for 3 Classes
I trained a YOLOv8 detection model with 3 classes, but the raw forward pass still shows a final detect output of (1, 7, 8400) instead of (1, 8, 8400).
What I’ve Done:
Checked my data.yaml:
train: path/to/train/images
val: path... | https://stackoverflow.com/questions/79419018/yolov8-final-detection-head-still-outputs-1-7-8400-instead-of-1-8-8400-f | machine-learning, deep-learning, pytorch, yolov8, ultralytics | 1,738,867,161 |
se_59640880 | stackoverflow | MACHINE_LEARNING | How to determine the positive class in roc_auc_score? | How to determine the positive class in roc_auc_score?
I want to use roc_auc_score to evaluate the performance of the classifier, but I'm not sure what is the right parameters to give it.
This is a description of this function in the documentation: documentation.
As you can see, it needs y_score, which is the probabi... | https://stackoverflow.com/questions/59640880/how-to-determine-the-positive-class-in-roc-auc-score | machine-learning, scikit-learn, svm, auc | 1,578,466,881 |
se_77842203 | stackoverflow | MACHINE_LEARNING | ValidationError: 2 validation errors for LLMChain | ValidationError: 2 validation errors for LLMChain
This is my complete code:
!pip install -q transformers einops accelerate langchain bitsandbytes sentence_transformers faiss-cpu pypdf sentencepiece
from langchain import HuggingFacePipeline
from transformers import AutoTokenizer
from langchain.embeddings impo... | https://stackoverflow.com/questions/77842203/validationerror-2-validation-errors-for-llmchain | python, machine-learning, deep-learning, langchain, large-language-model | 1,705,609,248 |
se_78251629 | stackoverflow | MACHINE_LEARNING | ImportError: cannot import name 'HuggingFaceInferenceAPI' from 'llama_index.llms' (unknown location) | ImportError: cannot import name 'HuggingFaceInferenceAPI' from 'llama_index.llms' (unknown location)
want to import HuggingFaceInferenceAPI.
from llama_index.llms import HugggingFaceInferenceAPI
llama_index.llms documentation doesn't have HugggingFaceInferenceAPI module. Anyone has update on this? | https://stackoverflow.com/questions/78251629/importerror-cannot-import-name-huggingfaceinferenceapi-from-llama-index-llms | python, machine-learning, langchain, huggingface, llama-index | 1,711,894,879 |
se_74748116 | stackoverflow | MACHINE_LEARNING | HuggingFace AutoModelForCasualLM "decoder-only architecture" warning, even after setting padding_side='left' | HuggingFace AutoModelForCasualLM "decoder-only architecture" warning, even after setting padding_side='left'
I'm using
AutoModelForCausalLM and AutoTokenizer to generate text output with DialoGPT.
For whatever reason, even when using the provided examples from huggingface I get this warning:
A decod... | https://stackoverflow.com/questions/74748116/huggingface-automodelforcasuallm-decoder-only-architecture-warning-even-after | python, machine-learning, huggingface-transformers, huggingface-tokenizers | 1,670,618,379 |
se_75290214 | stackoverflow | MACHINE_LEARNING | BentoML: how can I build a model without importing the services.py file? | BentoML: how can I build a model without importing the services.py file?
Is it possible to run bentoml build without importing the services.py file during the process?
I'm trying to put the BentoML build and containerize steps in our CI/CD server. Our model depends on some OS packages installed and some Python package... | https://stackoverflow.com/questions/75290214/bentoml-how-can-i-build-a-model-without-importing-the-services-py-file | machine-learning, bentoml | 1,675,113,215 |
se_52648383 | stackoverflow | MACHINE_LEARNING | How to get coefficients and feature importances from MultiOutputRegressor? | How to get coefficients and feature importances from MultiOutputRegressor?
I am trying to perform a MultiOutput Regression using ElasticNet and Random Forests as follows:
from sklearn.ensemble import RandomForestRegressor
from sklearn.multioutput import MultiOutputRegressor
from sklearn.linear_model import ElasticNet... | https://stackoverflow.com/questions/52648383/how-to-get-coefficients-and-feature-importances-from-multioutputregressor | python, machine-learning, scikit-learn | 1,538,660,801 |
se_79586550 | stackoverflow | MACHINE_LEARNING | How can I optimize a Streamlit dashboard for large CSV files to improve load time? | How can I optimize a Streamlit dashboard for large CSV files to improve load time?
My Streamlit app reads and visualizes data from a large CSV file (~100MB). The app takes several seconds to load.
What are the best practices for improving performance—such as using @st.cache_data, lazy loading, or preprocessing? | https://stackoverflow.com/questions/79586550/how-can-i-optimize-a-streamlit-dashboard-for-large-csv-files-to-improve-load-tim | forms, machine-learning, artificial-intelligence, data-analysis | 1,745,327,175 |
se_79515542 | stackoverflow | MACHINE_LEARNING | Length of features is not equal to the length of SHAP Values | Length of features is not equal to the length of SHAP Values
Im running a random forest model and to get some feature importance and Im trying to run a SHAP analysis. The problem is that every time I try to plot the shap values, I keep getting this error:
DimensionError: Length of features is not equal to the length o... | https://stackoverflow.com/questions/79515542/length-of-features-is-not-equal-to-the-length-of-shap-values | python, machine-learning, scikit-learn, random-forest, shap | 1,742,239,005 |
se_77131746 | stackoverflow | MACHINE_LEARNING | How to download punkt tokenizer in nltk? | How to download punkt tokenizer in nltk?
I installed the NLTK library using
pip install nltk
and while using the lib
from nltk.tokenize import sent_tokenize
sent_tokenize(text)
I am getting this error
LookupError:
**********************************************************************
Resource punkt not found.
... | https://stackoverflow.com/questions/77131746/how-to-download-punkt-tokenizer-in-nltk | python, machine-learning, nlp, nltk | 1,695,098,219 |
se_61553444 | stackoverflow | MACHINE_LEARNING | There is a sudden increase in loss in my machine training. Is there any specific reason and how it could be addressed? | There is a sudden increase in loss in my machine training. Is there any specific reason and how it could be addressed?
I have been training my dataset using a neural network as follows based on a dataset of a stock market index. But all of a sudden after running like over 60 times and the loss suddenly upsurge. Has ... | https://stackoverflow.com/questions/61553444/there-is-a-sudden-increase-in-loss-in-my-machine-training-is-there-any-specific | tensorflow, machine-learning, neural-network, conv-neural-network, lstm | 1,588,383,929 |
se_52089601 | stackoverflow | MACHINE_LEARNING | Keras Dense layer's input is not flattened | Keras Dense layer's input is not flattened
This is my test code:
from keras import layers
input1 = layers.Input((2,3))
output = layers.Dense(4)(input1)
print(output)
The output is:
<tf.Tensor 'dense_2/add:0' shape=(?, 2, 4) dtype=float32>
But What Happend?
The documentation says:
Note: if the input to ... | https://stackoverflow.com/questions/52089601/keras-dense-layers-input-is-not-flattened | python, tensorflow, machine-learning, keras, keras-layer | 1,535,605,858 |
se_79407078 | stackoverflow | MACHINE_LEARNING | GaussianProcessRegressor object in scikit-learn: select fixed hyperparameters, cannot reproduce optimised kernel | GaussianProcessRegressor object in scikit-learn: select fixed hyperparameters, cannot reproduce optimised kernel
I am trying to understand the GaussianProcessRegressor object in scikit-learn alas, unsuccessfully.
Considering the example in the documentation Example with noisy targets, which I copy below for convenienc... | https://stackoverflow.com/questions/79407078/gaussianprocessregressor-object-in-scikit-learn-select-fixed-hyperparameters-c | machine-learning, scikit-learn, gaussian-process | 1,738,520,249 |
se_77298910 | stackoverflow | MACHINE_LEARNING | Module ‘wandb’ has no attribute ‘apis’ | Module ‘wandb’ has no attribute ‘apis’
I’m trying to use wandb in a project I’m running on a server via SSH. I created and configured the virtual environment, but with wandb, I’m encountering the error ‘module ‘wandb’ has no attribute ‘apis’’. The server is running Python 3.6.8 and has wandb-0.15.12 installed. However... | https://stackoverflow.com/questions/77298910/module-wandb-has-no-attribute-apis | python, machine-learning, wandb | 1,697,416,887 |
se_79387801 | stackoverflow | MACHINE_LEARNING | How to chain grain.IterDataset together? | How to chain grain.IterDataset together?
This is a question about grain, the python library for data ingestion. https://google-grain.readthedocs.io/en/latest/index.html
In the context of reinforcement learning I have a data pre-processing step where I have match replays as individual files, pre-process into JAX arrays... | https://stackoverflow.com/questions/79387801/how-to-chain-grain-iterdataset-together | python, machine-learning | 1,737,852,692 |
se_43129764 | stackoverflow | MACHINE_LEARNING | Splitting data set into training and testing sets on recommender systems | Splitting data set into training and testing sets on recommender systems
I have implemented a recommender system based upon matrix factorization techniques. I want to evaluate it.
I want to use 10-fold-cross validation with All-but-one protocol (https://ai2-s2-pdfs.s3.amazonaws.com/0fcc/45600283abca12ea2f422e3fb2575f... | https://stackoverflow.com/questions/43129764/splitting-data-set-into-training-and-testing-sets-on-recommender-systems | machine-learning, recommendation-engine, cross-validation | 1,490,915,022 |
se_79576028 | stackoverflow | MACHINE_LEARNING | Confirm understanding of decision_function in Isolation Forest | Confirm understanding of decision_function in Isolation Forest
I am looking to better understand sklearn IsolationForest decision_function. My understanding from this previous stack overflow post, What is the difference between decision function and score_samples in isolation_forest in SKLearn, if the metric is close... | https://stackoverflow.com/questions/79576028/confirm-understanding-of-decision-function-in-isolation-forest | python, machine-learning, scikit-learn, anomaly-detection, isolation-forest | 1,744,751,255 |
se_79576765 | stackoverflow | MACHINE_LEARNING | Loan Default Prediction - Kaggle | Loan Default Prediction - Kaggle
I am working on the loan default prediction data set available on Kaggle which has a highly skewed class distribution. The best model I have gotten so far is as follows using ExtraTreesClassifier:
Best Model: {'bootstrap': True, 'ccp_alpha': 0.0, 'class_weight': {0: 1, 1: 5}, 'criterio... | https://stackoverflow.com/questions/79576765/loan-default-prediction-kaggle | python, machine-learning, imbalanced-data | 1,744,793,940 |
se_79559377 | stackoverflow | MACHINE_LEARNING | How to handle outputs of variable length when predicting with a Feed Forward Neural Network? | How to handle outputs of variable length when predicting with a Feed Forward Neural Network?
I am working on a regression problem where, given an input X of fixed size, the output Y can be a sequence of values of variable length.
Both input and output are normalised float values. Thus, we are talking about a regressio... | https://stackoverflow.com/questions/79559377/how-to-handle-outputs-of-variable-length-when-predicting-with-a-feed-forward-neu | machine-learning, deep-learning, neural-network | 1,744,013,634 |
se_65616825 | stackoverflow | MACHINE_LEARNING | DCgAN generates only noises | DCgAN generates only noises
I'm new to GANs and I have trouble in training DCGAN on mnist, when I was working with GAN with linear layers everything was fine and the generator generates pretty good images. But when I started working with Convolutional GAN, the generator generators only noise. Does anybody know how to ... | https://stackoverflow.com/questions/65616825/dcgan-generates-only-noises | machine-learning, deep-learning, neural-network, generative-adversarial-network, dcgan | 1,610,039,116 |
se_61555486 | stackoverflow | MACHINE_LEARNING | What is x_train.reshape() and What it Does? | What is x_train.reshape() and What it Does?
Using MNIST Dataset
import numpy as np
import tensorflow as tf
from tensorflow.keras.datasets import mnist
# MNIST dataset parameters
num_classes = 10 # total classes (0-9 digits)
num_features = 784 # data features (img shape: 28*28)
(x_train, y_train), (x_test, y_test) =... | https://stackoverflow.com/questions/61555486/what-is-x-train-reshape-and-what-it-does | python, machine-learning, keras, tensorflow2.0, mnist | 1,588,401,874 |
se_79436775 | stackoverflow | MACHINE_LEARNING | Why is Albumentations Adding Excessive Noise to Augmented Images? | Why is Albumentations Adding Excessive Noise to Augmented Images?
I am working on a pill detection project using YOLOv8 and applying Albumentations for data augmentation. However, some augmented images turn out with too much noise or distortion (example attached).
What I Want to Achieve:
Apply realistic augmentations ... | https://stackoverflow.com/questions/79436775/why-is-albumentations-adding-excessive-noise-to-augmented-images | python, machine-learning, data-augmentation, yolov8, albumentations | 1,739,459,050 |
se_79354623 | stackoverflow | MACHINE_LEARNING | Low accuracy using vision transformers for Image classification | Low accuracy using vision transformers for Image classification
I'be been learning workings of an Vision transformer, I couldn't get it to run at first(building the ViT from scratch). But somehow I managed to scramble up a code that shows very low accuracy(3%).
Tried chatgpting myself through it, couldn't seem to figu... | https://stackoverflow.com/questions/79354623/low-accuracy-using-vision-transformers-for-image-classification | python, machine-learning, deep-learning, computer-vision, transformer-model | 1,736,849,235 |
se_79308237 | stackoverflow | MACHINE_LEARNING | Logging multiple model metrics runs to the same plot in MLFlow | Logging multiple model metrics runs to the same plot in MLFlow
I’m doing a grid search optimization on model parameters and logging the loss to MLFlow using
Mlflow.log_metric(f“{run_number}_Loss”, returns, iteration)
But for every new run, I get a different plot in the MLFlow UI.
Is there a way to log to the same plo... | https://stackoverflow.com/questions/79308237/logging-multiple-model-metrics-runs-to-the-same-plot-in-mlflow | machine-learning, reinforcement-learning, mlflow | 1,735,156,223 |
se_74281988 | stackoverflow | MACHINE_LEARNING | How to input a matrix and receive value (or array of values) using machine learning in Python? | How to input a matrix and receive value (or array of values) using machine learning in Python?
I have a bunch of binary 8x15 matrixes and I want to determine which index (row and column) of the matrix breaks the pattern.
Say I have the following matrix (simplified to 5x5 for ease, because the problem remains the same)... | https://stackoverflow.com/questions/74281988/how-to-input-a-matrix-and-receive-value-or-array-of-values-using-machine-learn | python, machine-learning, matrix, scikit-learn | 1,667,338,138 |
se_79575941 | stackoverflow | MACHINE_LEARNING | Why does RandomForestClassifier in scikit-learn predict even on all-NaN input? | Why does RandomForestClassifier in scikit-learn predict even on all-NaN input?
I am training a random forest classifier in python sklearn, see code below-
from sklearn.ensemble import RandomForestClassifier
rf = RandomForestClassifier(random_state=42)
rf.fit(X = df.drop("AP", axis =1), y = df["AP"].astype(int))
When... | https://stackoverflow.com/questions/79575941/why-does-randomforestclassifier-in-scikit-learn-predict-even-on-all-nan-input | python, machine-learning, scikit-learn, random-forest, missing-data | 1,744,746,839 |
se_61708970 | stackoverflow | MACHINE_LEARNING | What are Mutual_info_regression and Mutual_info_classif used for in scikit-learn? | What are Mutual_info_regression and Mutual_info_classif used for in scikit-learn?
I'm learning about feature selection of big datasets. I came across methods called Mutual_info_regression() and Mutual_info_classif().
They return a value for all the features. What does that value represent? | https://stackoverflow.com/questions/61708970/what-are-mutual-info-regression-and-mutual-info-classif-used-for-in-scikit-learn | python, machine-learning, scikit-learn | 1,589,098,165 |
se_65836268 | stackoverflow | MACHINE_LEARNING | ValueError: Boolean array expected for the condition, not object | ValueError: Boolean array expected for the condition, not object
I am trying to build a classifier with sklearn and get the following error in my console when I run my code.
ValueError: Boolean array expected for the condition, not object
I tried tweaking my data (filling in null values) as well as playing with resha... | https://stackoverflow.com/questions/65836268/valueerror-boolean-array-expected-for-the-condition-not-object | python, pandas, machine-learning, select, valueerror | 1,611,265,869 |
se_55500822 | stackoverflow | MACHINE_LEARNING | ValueError: Input contains infinity or a value too large for dtype('float64') | ValueError: Input contains infinity or a value too large for dtype('float64')
i need help
I'm working on machine learning.
I tried to import a dataset using this code:
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
... | https://stackoverflow.com/questions/55500822/valueerror-input-contains-infinity-or-a-value-too-large-for-dtypefloat64 | python, machine-learning | 1,554,311,992 |
se_79574117 | stackoverflow | MACHINE_LEARNING | SGLang server fails on launch due to cuda_fp8.h missing even with --disable-cuda-graph and prebuilt flashinfer wheel | SGLang server fails on launch due to cuda_fp8.h missing even with --disable-cuda-graph and prebuilt flashinfer wheel
I am trying to launch the SGLang server using python -m sglang.launch_server ... but it consistently fails during the "Capture cuda graph" phase. The error indicates a failure during Just-In-Time (JIT) ... | https://stackoverflow.com/questions/79574117/sglang-server-fails-on-launch-due-to-cuda-fp8-h-missing-even-with-disable-cuda | machine-learning, deep-learning, pytorch, sglang | 1,744,670,379 |
se_79573345 | stackoverflow | MACHINE_LEARNING | Can Tensorflow or PyTorch work with json time series data in this format? | Can Tensorflow or PyTorch work with json time series data in this format?
I'm trying to make a LSTM model to predict sign language sentence with this format of json file. This json file is containing the coordinates information of 21 hand landmark joints for each frames and each hands.(left hand, right hand)
Here's th... | https://stackoverflow.com/questions/79573345/can-tensorflow-or-pytorch-work-with-json-time-series-data-in-this-format | json, tensorflow, machine-learning, lstm | 1,744,639,882 |
se_62231658 | stackoverflow | MACHINE_LEARNING | How to improve Levenberg-Marquardt's method for polynomial curve fitting? | How to improve Levenberg-Marquardt's method for polynomial curve fitting?
Some weeks ago I started coding the Levenberg-Marquardt algorithm from scratch in Matlab. I'm interested in the polynomial fitting of the data but I haven't been able to achieve the level of accuracy I would like. I'm using a fifth order pol... | https://stackoverflow.com/questions/62231658/how-to-improve-levenberg-marquardts-method-for-polynomial-curve-fitting | machine-learning, regression, numerical-methods, non-linear-regression, levenberg-marquardt | 1,591,446,160 |
se_79571067 | stackoverflow | MACHINE_LEARNING | Residual Analysis for simple linear regression model | Residual Analysis for simple linear regression model
I'm trying to conduct the residual analysis for simple linear regression. I need to prove that the residuals follow an approximate Normal Distribution.
The csv file I'm using has values for Percentage of marks in Grade 10 and the Salary the student makes.
Once I run... | https://stackoverflow.com/questions/79571067/residual-analysis-for-simple-linear-regression-model | python, machine-learning, linear-regression, statsmodels | 1,744,503,110 |
se_58612783 | stackoverflow | MACHINE_LEARNING | batch normalization, yes or no? | batch normalization, yes or no?
I use Tensorflow 1.14.0 and Keras 2.2.4. The following code implements a simple neural network:
import numpy as np
np.random.seed(1)
import random
random.seed(2)
import tensorflow as tf
tf.set_random_seed(3)
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.l... | https://stackoverflow.com/questions/58612783/batch-normalization-yes-or-no | python, machine-learning, keras, neural-network, batch-normalization | 1,572,370,718 |
se_38553927 | stackoverflow | MACHINE_LEARNING | Batch Normalization in Convolutional Neural Network | Batch Normalization in Convolutional Neural Network
I would like to know some details on applying batch normalisation in CNN.
I read this paper https://arxiv.org/pdf/1502.03167v3.pdf and could understand the BN algorithm applied on a data but in the end they mentioned that a slight modification is required when applie... | https://stackoverflow.com/questions/38553927/batch-normalization-in-convolutional-neural-network | machine-learning, computer-vision, deep-learning, conv-neural-network, batch-normalization | 1,469,375,698 |
se_79567319 | stackoverflow | MACHINE_LEARNING | How do I use a random forest to predict gaps in a dataset? | How do I use a random forest to predict gaps in a dataset?
I have a dataset that I used to make a random forest (it is split into testing and training data). I have already made the random forest and generated predictions (code below), but I don't know how to take those predictions and use them to generate a full data... | https://stackoverflow.com/questions/79567319/how-do-i-use-a-random-forest-to-predict-gaps-in-a-dataset | r, machine-learning, random-forest | 1,744,308,746 |
se_52580818 | stackoverflow | MACHINE_LEARNING | When is entity replacement necessary for relation extraction? | When is entity replacement necessary for relation extraction?
In this tutorial for "Training a Machine Learning Classifier for Relation Extraction from Medical Literature" the author does Entity replacement because that "we don’t want the model to learn according to a specific entity name, but we want it to learn acco... | https://stackoverflow.com/questions/52580818/when-is-entity-replacement-necessary-for-relation-extraction | machine-learning, nlp | 1,538,331,733 |
se_11780650 | stackoverflow | MACHINE_LEARNING | Using flipped images for machine learning dataset | Using flipped images for machine learning dataset
I'v got a binary classification problem. I'm trying to train a neural network to recognize objects from images. Currently I've about 1500 50x50 images.
The question is whether extending my current training set by the same images flipped horizontally is a good idea or n... | https://stackoverflow.com/questions/11780650/using-flipped-images-for-machine-learning-dataset | machine-learning, computer-vision | 1,343,920,607 |
se_42716181 | stackoverflow | MACHINE_LEARNING | Why do we need epochs? | Why do we need epochs?
In courses there is nothing about epochs, but in practice they are everywhere used.
Why do we need them if the optimizer finds the best weight in one pass. Why does the model improve? | https://stackoverflow.com/questions/42716181/why-do-we-need-epochs | machine-learning | 1,489,142,000 |
se_58603632 | stackoverflow | MACHINE_LEARNING | How to get feature importance for each class in mutliclass classification with XGBoost? | How to get feature importance for each class in mutliclass classification with XGBoost?
I have 6 different classes which I am doing multiclass classification on using both XGBoost and RandomForest.
What I want is to analyze which features are most important for a sample belonging to each class.
I know that there are... | https://stackoverflow.com/questions/58603632/how-to-get-feature-importance-for-each-class-in-mutliclass-classification-with-x | python, machine-learning, xgboost | 1,572,337,517 |
se_79498849 | stackoverflow | MACHINE_LEARNING | generatePartialDependenceData function returns Error when used for multiclass classification model | generatePartialDependenceData function returns Error when used for multiclass classification model
I have build an XGBoost multiclass classification model using mlr and i want to visualize the partial dependence for some features. However, if i try to do so using generatePartialDependenceData() i get the following err... | https://stackoverflow.com/questions/79498849/generatepartialdependencedata-function-returns-error-when-used-for-multiclass-cl | r, machine-learning, xgboost, mlr | 1,741,631,221 |
se_23939750 | stackoverflow | MACHINE_LEARNING | Understanding max_features parameter in RandomForestRegressor | Understanding max_features parameter in RandomForestRegressor
While constructing each tree in the random forest using bootstrapped samples, for each terminal node, we select m variables at random from p variables to find the best split (p is the total number of features in your data). My questions (for RandomForestReg... | https://stackoverflow.com/questions/23939750/understanding-max-features-parameter-in-randomforestregressor | machine-learning, scikit-learn, random-forest, feature-selection | 1,401,385,976 |
se_43781526 | stackoverflow | MACHINE_LEARNING | Pytorch, TypeError: object() takes no parameters | Pytorch, TypeError: object() takes no parameters
This is probably a beginner question, but nevertheless: When running an image classifier build with pytorch, I get this error:
Traceback (most recent call last):
File "/pytorch/kanji_torch.py", line 47, in <module>
network = Network()
File "/pytorch/kanji_torch.p... | https://stackoverflow.com/questions/43781526/pytorch-typeerror-object-takes-no-parameters | python, machine-learning, pytorch, neural-network, typeerror | 1,493,897,041 |
se_7945130 | stackoverflow | MACHINE_LEARNING | Natural Language Processing Model | Natural Language Processing Model
I'm making a project to parse, and understand the intentions of input lines by a user in english.
Here is what I think I should do:
Create a text of sentences with POS tagging & marked intentions for every sentence by hand.
Create a model say: decision tree and train it on the above ... | https://stackoverflow.com/questions/7945130/natural-language-processing-model | nlp, machine-learning | 1,319,980,854 |
se_79561884 | stackoverflow | MACHINE_LEARNING | How to perform global structured pruning in PyTorch | How to perform global structured pruning in PyTorch
I am training on CIFAR10 the following simple CNN
class SimpleCNN(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 32, kernel_size=3, padding=1)
self.conv2 = nn.Conv2d(32, 64, kernel_size=3, padding=1)
s... | https://stackoverflow.com/questions/79561884/how-to-perform-global-structured-pruning-in-pytorch | python, machine-learning, deep-learning, pytorch, pruning | 1,744,111,216 |
se_77341536 | stackoverflow | MACHINE_LEARNING | Error calculating Dunn's Index in c++ using Armadillo library | Error calculating Dunn's Index in c++ using Armadillo library
I have been trying to find Dunns index using the Armadillo library for a larger algorithm I'm working on. Whenever I run the code, I get an output Dunns index:-nan(ind) and an error saying I'm out of the indices. I provide the code below and the main fu... | https://stackoverflow.com/questions/77341536/error-calculating-dunns-index-in-c-using-armadillo-library | c++, machine-learning, hierarchical-clustering, armadillo | 1,698,005,398 |
se_79560879 | stackoverflow | MACHINE_LEARNING | Image rotation: model for angle detection using pytorch | Image rotation: model for angle detection using pytorch
Basically I am trying to create a model that will detect angle on which a specific image is rotated. Also I have a dataset of 1500 documents resulting with images rotated on
random.sample([0, 90, -90, 180], 2)
and each of this angles has variation of
random.unif... | https://stackoverflow.com/questions/79560879/image-rotation-model-for-angle-detection-using-pytorch | python, machine-learning, pytorch | 1,744,064,443 |
se_78857269 | stackoverflow | MACHINE_LEARNING | add_hparams() function from TensorBoard doesn't work properly | add_hparams() function from TensorBoard doesn't work properly
I'm trying to add metrics to this SummaryWriter, but it's not working.
I'm using the add_hparams() function of SummaryWriter, the details of which can be found here: https://pytorch.org/docs/stable/tensorboard.html.
I'm doing it this way:
writer = Summa... | https://stackoverflow.com/questions/78857269/add-hparams-function-from-tensorboard-doesnt-work-properly | python, python-3.x, tensorflow, machine-learning, tensorboard | 1,723,335,716 |
se_54212769 | stackoverflow | MACHINE_LEARNING | How to get the final equation that the Random Forest algorithm uses on your independent variables to predict your dependent variable? | How to get the final equation that the Random Forest algorithm uses on your independent variables to predict your dependent variable?
I am working on optimizing a manufacturing based dataset which consists of a huge number of controllable parameters. The goal is to attain the best run settings of these parameters.
I f... | https://stackoverflow.com/questions/54212769/how-to-get-the-final-equation-that-the-random-forest-algorithm-uses-on-your-inde | machine-learning, random-forest | 1,547,626,492 |
se_79243091 | stackoverflow | MACHINE_LEARNING | Using Thundersvm in Kaggle | Using Thundersvm in Kaggle
While I wanted to install thundersvm in kaggle using !pip install thundersvm, I encountered this error:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[6], line 3
1 get_ipyth... | https://stackoverflow.com/questions/79243091/using-thundersvm-in-kaggle | machine-learning, gpu, svm, kaggle | 1,733,119,734 |
se_75089762 | stackoverflow | MACHINE_LEARNING | I am using RuleFit for binary classification; how do I interpret the rules? | I am using RuleFit for binary classification; how do I interpret the rules?
I am using RuleFit with a GradientBoostingClassifier to generate rules for a binary classification problem (health-dataset on Kaggle). When I print out the rules with RuleFit.get_rules(), it shows rule, type, coef, support, and importance. B... | https://stackoverflow.com/questions/75089762/i-am-using-rulefit-for-binary-classification-how-do-i-interpret-the-rules | machine-learning, scikit-learn | 1,673,476,953 |
se_79424312 | stackoverflow | MACHINE_LEARNING | Why does HuggingFace-provided Deepseek code result in an 'Unknown quantization type' error? | Why does HuggingFace-provided Deepseek code result in an 'Unknown quantization type' error?
I am using this code from huggingface:
This code is directly pasted from the HuggingFace website's page on deepseek and is supposed to be plug-and-play code:
from transformers import pipeline
messages = [
{"role": "us... | https://stackoverflow.com/questions/79424312/why-does-huggingface-provided-deepseek-code-result-in-an-unknown-quantization-t | python, machine-learning, huggingface-transformers, huggingface, deepseek | 1,739,070,330 |
se_79557948 | stackoverflow | MACHINE_LEARNING | Duplicate GPU detected : rank 0 and rank 1 both on CUDA device 40 | Duplicate GPU detected : rank 0 and rank 1 both on CUDA device 40
I am trying to do QLoRA+FSDP2 on kaggle using 2x T4 gpus, this is my training script
def train_fsdp(rank, size):
torch.cuda.empty_cache()
base_model = "meta-llama/Llama-3.1-8B"
bnb_config = BitsAndBytesConfig(------)
model = AutoModelFor... | https://stackoverflow.com/questions/79557948/duplicate-gpu-detected-rank-0-and-rank-1-both-on-cuda-device-40 | machine-learning, pytorch | 1,743,927,036 |
se_58562089 | stackoverflow | MACHINE_LEARNING | Why is ImageDataGenerator() performing poorly? | Why is ImageDataGenerator() performing poorly?
I am trying to build a image classification model, using ImageDataGenerator().
It seems that the model trains and performs poorly. The training loss stays at around 15 and the accuracy is barely 10%, the validation is about the same.
Just to see what would happen, I tri... | https://stackoverflow.com/questions/58562089/why-is-imagedatagenerator-performing-poorly | tensorflow, machine-learning, keras | 1,572,019,515 |
se_61292464 | stackoverflow | MACHINE_LEARNING | Get confidence interval from sklearn linear regression in python | Get confidence interval from sklearn linear regression in python
I want to get a confidence interval of the result of a linear regression. I'm working with the boston house price dataset.
I've found this question:
How to calculate the 99% confidence interval for the slope in a linear regression model in python?
Howeve... | https://stackoverflow.com/questions/61292464/get-confidence-interval-from-sklearn-linear-regression-in-python | python, machine-learning, scikit-learn, statistics, linear-regression | 1,587,226,950 |
se_79553429 | stackoverflow | MACHINE_LEARNING | Yolov11 training gives torch.OutOfMemoryError | Yolov11 training gives torch.OutOfMemoryError
I am trying to train a yolov11 model for a set of images but I am running into an issue. The GPU the model is training on is a GeForce RTX 4070 super.
I am using yolov11 with torch with GPU.
print(torch.__version__)
2.5.1+cu121
I did train the model a few times before wit... | https://stackoverflow.com/questions/79553429/yolov11-training-gives-torch-outofmemoryerror | python, machine-learning, deep-learning, yolo | 1,743,695,674 |
se_34052115 | stackoverflow | MACHINE_LEARNING | How to find the importance of the features for a logistic regression model? | How to find the importance of the features for a logistic regression model?
I have a binary prediction model trained by logistic regression algorithm. I want know which features (predictors) are more important for the decision of positive or negative class. I know there is coef_ parameter which comes from the scikit-l... | https://stackoverflow.com/questions/34052115/how-to-find-the-importance-of-the-features-for-a-logistic-regression-model | python, machine-learning, scikit-learn, logistic-regression, feature-selection | 1,449,087,081 |
se_12572357 | stackoverflow | MACHINE_LEARNING | precision, recall and f-measure in R | precision, recall and f-measure in R
I have a table in R with two colums, the first one has predicted values (a value can be either 0 or 1), the second one has the actual values (also 0 or 1). I need to find recall, precision and f-measures, but cannot find a good function for it in R. (I also read about ROCR, but all... | https://stackoverflow.com/questions/12572357/precision-recall-and-f-measure-in-r | r, machine-learning, classification, precision-recall | 1,348,518,237 |
se_78996950 | stackoverflow | MACHINE_LEARNING | ImportError: DLL load failed while importing onnx_cpp2py_export: A dynamic link library (DLL) initialization routine failed | ImportError: DLL load failed while importing onnx_cpp2py_export: A dynamic link library (DLL) initialization routine failed
I'm trying to set up and test the OCR model from the doctr library provided by Mindee
(https://github.com/mindee/doctr)
within a VSCode. I installed the package in run.ipynb using the following c... | https://stackoverflow.com/questions/78996950/importerror-dll-load-failed-while-importing-onnx-cpp2py-export-a-dynamic-link | python, visual-studio-code, machine-learning, ocr, tf2onnx | 1,726,643,320 |
se_45160402 | stackoverflow | MACHINE_LEARNING | Multiple artificial neural networks | Multiple artificial neural networks
I am trying to set up a Multiple Artificial Neural Network as you can see here on image (a):
(source)
I want that each of the networks work independently on its own domain. The single networks must be built and trained for their specific task. The final decision will be make on the... | https://stackoverflow.com/questions/45160402/multiple-artificial-neural-networks | python, machine-learning, tensorflow | 1,500,363,427 |
se_37487830 | stackoverflow | MACHINE_LEARNING | How to find probability distribution and parameters for real data? | How to find probability distribution and parameters for real data?
I have a dataset from sklearn and I plotted the distribution of the load_diabetes.target data (i.e. the values of the regression that the load_diabetes.data are used to predict).
Using Python 3, how can I get the distribution-type and parameters of the... | https://stackoverflow.com/questions/37487830/how-to-find-probability-distribution-and-parameters-for-real-data | python, machine-learning, statistics, distribution, data-fitting | 1,464,364,711 |
se_79547006 | stackoverflow | MACHINE_LEARNING | Time Series Forecasting Model with XGBoost and Dask Large Datasets Crashing | Time Series Forecasting Model with XGBoost and Dask Large Datasets Crashing
I'm building a time series forecasting model in Python to predict hourly kWh loads for different customer types at a utility company. The dataset contains ~81 million rows, with hourly load data for ~2,300 customers over 2-4 years. Customer ty... | https://stackoverflow.com/questions/79547006/time-series-forecasting-model-with-xgboost-and-dask-large-datasets-crashing | python, machine-learning, time-series, dask, xgboost | 1,743,446,021 |
se_48377214 | stackoverflow | MACHINE_LEARNING | RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1) | RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)
Im using a Pytorch Unet model to which i am feeding in a image as input and along with that i am feeding the label as the input image mask and traning the dataset on it.
The Unet model i have picked up from somewhere else, and i am us... | https://stackoverflow.com/questions/48377214/runtimeerror-dimension-out-of-range-expected-to-be-in-range-of-1-0-but-go | python, machine-learning, pytorch | 1,516,609,092 |
se_79552491 | stackoverflow | MACHINE_LEARNING | mediapipe Image Segmentation with Dual-Output TFLite Model | mediapipe Image Segmentation with Dual-Output TFLite Model
I'm working on implementing image segmentation using my own custom TFLite model, following the code example from MediaPipe. Here's my code:
options = vision.ImageSegmenterOptions(
base_options=base_options,
running_mode=mp.tasks.vision.RunningMode.IMAG... | https://stackoverflow.com/questions/79552491/mediapipe-image-segmentation-with-dual-output-tflite-model | python, machine-learning, mediapipe, semantic-segmentation, tflite | 1,743,671,698 |
se_79552254 | stackoverflow | MACHINE_LEARNING | How to compile and run a model in Keras subclassing API? | How to compile and run a model in Keras subclassing API?
I am learning to use the TensorFlow Recommenders library and the subclassing API and have been working through the documentation. I would like to know how to run and review the output of the individual sub-models that feed into the final model.
I have recreated ... | https://stackoverflow.com/questions/79552254/how-to-compile-and-run-a-model-in-keras-subclassing-api | python, tensorflow, machine-learning, keras | 1,743,664,779 |
se_58414372 | stackoverflow | MACHINE_LEARNING | How to predict on the Test data using random forest when "prediction" column is missing in the data set given? | How to predict on the Test data using random forest when "prediction" column is missing in the data set given?
How to predict on the Test data using randomforest when "prediction" column (is_promoted) is missing in the TEST data set given?
Here I have given two data sets: Train and Test, in Test data set I h... | https://stackoverflow.com/questions/58414372/how-to-predict-on-the-test-data-using-random-forest-when-prediction-column-is | r, machine-learning, random-forest | 1,571,232,019 |
se_76248184 | stackoverflow | MACHINE_LEARNING | Keras tuning that prefers faster models? | Keras tuning that prefers faster models?
I'm trying to tune hyperparameters to get a sense of what values are best in tensorflow keras models. I'm going to use the best model in a minimax algorithm, so speed of evaluation is important due to the amount of estimations for the algorithm. Also, the speed of tuning is mad... | https://stackoverflow.com/questions/76248184/keras-tuning-that-prefers-faster-models | python, tensorflow, machine-learning, keras, deep-learning | 1,684,076,869 |
se_79546578 | stackoverflow | MACHINE_LEARNING | TypeError: Dataloader object is not subscriptable | TypeError: Dataloader object is not subscriptable
I'm creating an AI model to generate density plots of crowds. When splitting the dataset into two, one for training and one for validation, I create the two data sets and try to load the datasets using torch.utils.data.DataLoader(test_set, batch_size=batch_size, shuffl... | https://stackoverflow.com/questions/79546578/typeerror-dataloader-object-is-not-subscriptable | python, machine-learning, pytorch | 1,743,433,335 |
se_77479005 | stackoverflow | MACHINE_LEARNING | Not able to download mmcv 1.3.0 and build wheels | Not able to download mmcv 1.3.0 and build wheels
When I try to install mmcv-full==1.3.0, it couldn't be downloaded and build the wheel (where I have updated to wheel already)
error Could not build wheels for mmcv-full, which is required to install pyproject.toml-based projects
But then when I try to use
mim install ... | https://stackoverflow.com/questions/77479005/not-able-to-download-mmcv-1-3-0-and-build-wheels | python, machine-learning, anaconda, conda | 1,699,948,838 |
se_19349567 | stackoverflow | MACHINE_LEARNING | Naive bayes classifier implementation from scratch | Naive bayes classifier implementation from scratch
I'm trying to implement my first Naive Bayes classifier by myself for better understanding. So, i have dataset from http://archive.ics.uci.edu/ml/datasets/Adult (american census data, classes are '<=50k' and '>50k').
Here is my python code:
import sys
import csv
word... | https://stackoverflow.com/questions/19349567/naive-bayes-classifier-implementation-from-scratch | python, machine-learning, classification, naivebayes | 1,381,693,957 |
se_9677603 | stackoverflow | MACHINE_LEARNING | Naive Bayes classifier | Naive Bayes classifier
I'm using scikit-learn for finding the Tf-idf weight of a document and then using the Naive
Bayesian classifier to classify the text. But the Tf-idf weight of all words in a documents are negative except a few. But as far as I know, negative values means unimportant terms. So is it necessary to... | https://stackoverflow.com/questions/9677603/naive-bayes-classifier | machine-learning, scikit-learn, bayesian | 1,331,605,724 |
se_60454210 | stackoverflow | MACHINE_LEARNING | How to calculate evidence in Naive Bayes classifier? | How to calculate evidence in Naive Bayes classifier?
I have written a simple multinomial Naive Bayes classifier in Python. The code predicts correct labels for BBC news dataset, but when I use a prior P(X) probability in denominator to output scores as probabilities, I get incorrect values (like > 1 for probability). ... | https://stackoverflow.com/questions/60454210/how-to-calculate-evidence-in-naive-bayes-classifier | python, machine-learning, statistics, naivebayes | 1,582,901,780 |
se_69573659 | stackoverflow | MACHINE_LEARNING | Custom SVM Polynomial kernel | Custom SVM Polynomial kernel
I got asked as an assignment to develop a custom polynomial (degree = 3,4,5) kernel for SVM and compare its accuracy to the in-built poly kernel of sklearn (should be almost the same).
I tried to follow the polynomial kernel definition but my results seems not to be quite similar, this is ... | https://stackoverflow.com/questions/69573659/custom-svm-polynomial-kernel | python, machine-learning, scikit-learn, svm, polynomial-math | 1,634,226,368 |
se_79363695 | stackoverflow | MACHINE_LEARNING | deploying a Tensorflow model artifact to Sagemaker | deploying a Tensorflow model artifact to Sagemaker
I am trying to deploy a TensorFlow model to a Sagemaker endpoint. I have the model artifact at generic_graph.pb and the model's labels at labels.txt.
I started by creating a tar file with the following contents:
# #model directory structure
# #model.tar.gz
# └── <mod... | https://stackoverflow.com/questions/79363695/deploying-a-tensorflow-model-artifact-to-sagemaker | amazon-web-services, tensorflow, machine-learning, amazon-sagemaker | 1,737,091,156 |
se_78595127 | stackoverflow | MACHINE_LEARNING | ImportError: Using `bitsandbytes` 8-bit quantization requires Accelerate | ImportError: Using `bitsandbytes` 8-bit quantization requires Accelerate
I encountered an error when downloading a model from huggingface. It was working on Google Colab, but not working on my windows machine. I am using Python 3.10.0.
The error code is shown below:
E:\Internships\ConsciusAI\.venv\lib\site-packages\hu... | https://stackoverflow.com/questions/78595127/importerror-using-bitsandbytes-8-bit-quantization-requires-accelerate | python, machine-learning, huggingface-transformers, llama3 | 1,717,835,838 |
se_79544819 | stackoverflow | MACHINE_LEARNING | Conversion of model weights from old Keras version to Pytorch | Conversion of model weights from old Keras version to Pytorch
I want to transfer pretrained weights from an old project on github : https://github.com/ajgallego/staff-lines-removal
The original Keras model code is:
def get_keras_autoencoder(self, input_size=256, nb_filter=96, k_size=5):
input_img = Input(shape=(1... | https://stackoverflow.com/questions/79544819/conversion-of-model-weights-from-old-keras-version-to-pytorch | python, machine-learning, keras, pytorch, computer-vision | 1,743,349,281 |
se_69543907 | stackoverflow | MACHINE_LEARNING | PyTorch `torch.no_grad` vs `torch.inference_mode` | PyTorch `torch.no_grad` vs `torch.inference_mode`
PyTorch has new functionality torch.inference_mode as of v1.9 which is "analogous to torch.no_grad... Code run under this mode gets better performance by disabling view tracking and version counter bumps."
If I am just evaluating my model at test time (i.e. not trainin... | https://stackoverflow.com/questions/69543907/pytorch-torch-no-grad-vs-torch-inference-mode | machine-learning, pytorch, artificial-intelligence, gradient-descent, inference | 1,634,055,683 |
se_75481225 | stackoverflow | MACHINE_LEARNING | I am creating a flutter app to detect hand gestures and convert them in Text for deaf and dumb people | I am creating a flutter app to detect hand gestures and convert them in Text for deaf and dumb people
Is there anybody who can provide me a road map on how to start the project, from where I can get the data set, and how to convert hand gestures to text? or is there any SDK or API, it will be great if you can provide ... | https://stackoverflow.com/questions/75481225/i-am-creating-a-flutter-app-to-detect-hand-gestures-and-convert-them-in-text-for | flutter, dart, machine-learning | 1,676,618,492 |
se_39532572 | stackoverflow | MACHINE_LEARNING | How to replace an Embedding layer with a Time Distributed Dense after training? | How to replace an Embedding layer with a Time Distributed Dense after training?
I have the following problem:
I want to use a LSTM network for text classification. In order to speed up training and make code more clear I want to use an Embedding layer along keras.Tokenizer in order to train my model.
Once I trained ... | https://stackoverflow.com/questions/39532572/how-to-replace-an-embedding-layer-with-a-time-distributed-dense-after-training | machine-learning, nlp, neural-network, embedding, keras | 1,474,032,085 |
se_48403445 | stackoverflow | MACHINE_LEARNING | How to select features for logistic regression from scratch in python? | How to select features for logistic regression from scratch in python?
I have been trying to code logistic regression from scratch, which I have done, but I am using all the features in my breast cancer dataset, and I would like to select some features (specifically ones that I've found scikit-learn has selected for i... | https://stackoverflow.com/questions/48403445/how-to-select-features-for-logistic-regression-from-scratch-in-python | python, machine-learning, logistic-regression, feature-selection | 1,516,715,731 |
se_42489 | stackoverflow | MACHINE_LEARNING | How to implement a "related" degree measure algorithm? | How to implement a "related" degree measure algorithm?
I was going to Ask a Question earlier today when I was presented to a surprising functionality in Stackoverflow. When I wrote my question title stackoverflow suggested me several related questions and I found out that there was already two similar questi... | https://stackoverflow.com/questions/42489/how-to-implement-a-related-degree-measure-algorithm | algorithm, machine-learning, indexing, nlp, full-text-search | 1,220,473,264 |
se_47299624 | stackoverflow | MACHINE_LEARNING | How to understand loss, acc, val_loss, val_acc in Keras model fitting? | How to understand loss, acc, val_loss, val_acc in Keras model fitting?
Here are my Keras model results (train on 4160 samples, validate on 1040 samples):
Epoch 1/20
4160/4160 - loss: 3.3455 - acc: 0.1560 - val_loss: 1.6047 - val_acc: 0.4721
Epoch 2/20
4160/4160 - loss: 1.7639 - acc: 0.4274 - val_loss: 0.7060 - val_ac... | https://stackoverflow.com/questions/47299624/how-to-understand-loss-acc-val-loss-val-acc-in-keras-model-fitting | tensorflow, machine-learning, keras, deep-learning | 1,510,721,765 |
se_64746124 | stackoverflow | MACHINE_LEARNING | how to convert sparse numpy array to Dataframe? | how to convert sparse numpy array to Dataframe?
below is the code snippet,
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
ct = ColumnTransformer(transformers=[('encoder',OneHotEncoder(),[2,3,4])],remainder='passthrough')
X = np.array(ct.fit_transform(x_data))
X.shape
i g... | https://stackoverflow.com/questions/64746124/how-to-convert-sparse-numpy-array-to-dataframe | arrays, python-3.x, pandas, numpy, machine-learning | 1,604,898,216 |
se_79519426 | stackoverflow | MACHINE_LEARNING | Error When Using Batch Size Greater Than 1 in PyTorch | Error When Using Batch Size Greater Than 1 in PyTorch
I'm building a neural network to predict how an image will be partitioned during compression using VVC (Versatile Video Coding). The model takes a single Y-frame from a YUV420 image as input and uses a CSV file containing the ground truth block positions and sizes ... | https://stackoverflow.com/questions/79519426/error-when-using-batch-size-greater-than-1-in-pytorch | python, machine-learning, pytorch, training-data, pytorch-dataloader | 1,742,369,309 |
se_72429838 | stackoverflow | MACHINE_LEARNING | Difference between sum and mean in .backward() in calculating the loss and backpropagated through the network | Difference between sum and mean in .backward() in calculating the loss and backpropagated through the network
I know we should convert the tensor to scalar before applying backward(), but when to sum and when to mean?
some_loss_function.sum().backward()
-OR-
some_loss_function.mean().backward() | https://stackoverflow.com/questions/72429838/difference-between-sum-and-mean-in-backward-in-calculating-the-loss-and-backp | machine-learning, pytorch | 1,653,891,222 |
se_79536891 | stackoverflow | MACHINE_LEARNING | Using zip() on two nn.ModuleList | Using zip() on two nn.ModuleList
Is using two different nn.ModuleList() zipped lists correct to build the computational graph for training a neural net in PyTorch? nn.ModuleList is a wrapper around Python's list with a registration of a module for training.
I'm building a network which consists of 2x interchanging typ... | https://stackoverflow.com/questions/79536891/using-zip-on-two-nn-modulelist | python, machine-learning, deep-learning, pytorch, computer-vision | 1,743,012,149 |
se_79531266 | stackoverflow | MACHINE_LEARNING | Concatenating TF-IDF Data and Categorical Data for CatBoost Model | Concatenating TF-IDF Data and Categorical Data for CatBoost Model
I've been trying to concatenate TF-IDF data with categorical data. However, when concatenating, the categorical data is automatically converted to float by default. Since CatBoost doesn't support float for categorical features, this causes an error for ... | https://stackoverflow.com/questions/79531266/concatenating-tf-idf-data-and-categorical-data-for-catboost-model | python, machine-learning, tf-idf, catboost, catboostregressor | 1,742,824,416 |
se_79535519 | stackoverflow | MACHINE_LEARNING | How to Implement Backpropagation Without Auto-Differentiation for a Feedforward Neural Network? | How to Implement Backpropagation Without Auto-Differentiation for a Feedforward Neural Network?
I am working on a deep learning assignment that requires implementing a feedforward neural network (FNN) from scratch using only NumPy (without TensorFlow, PyTorch, or other auto-differentiation tools). The network has thre... | https://stackoverflow.com/questions/79535519/how-to-implement-backpropagation-without-auto-differentiation-for-a-feedforward | python, machine-learning, math, neural-network, backpropagation | 1,742,968,783 |
se_52358505 | stackoverflow | MACHINE_LEARNING | Neural Network underfitting breast cancer dataset | Neural Network underfitting breast cancer dataset
I'm trying to create a neural network for binary classification on the breast cancer dataset:
https://www.kaggle.com/uciml/breast-cancer-wisconsin-data
My neural network consists of 3 layers(not including input layer):
first layer: 6 neurons with tanh activation.
sec... | https://stackoverflow.com/questions/52358505/neural-network-underfitting-breast-cancer-dataset | python, machine-learning, neural-network, deep-learning, classification | 1,537,133,094 |
se_79536194 | stackoverflow | MACHINE_LEARNING | Jupyter | The kernel appears to have died. It will restart automatically | keras.models.Sequential | Jupyter | The kernel appears to have died. It will restart automatically | keras.models.Sequential
I am building my deep learning model using Sequential model, while I am executing the model.fit my jupyter notebook dies with message The kernel appears to have died. It will restart automatically.
model_class = tf.keras... | https://stackoverflow.com/questions/79536194/jupyter-the-kernel-appears-to-have-died-it-will-restart-automatically-keras | tensorflow, machine-learning, jupyter-notebook | 1,742,986,623 |
se_79508535 | stackoverflow | MACHINE_LEARNING | Node/edge attributed directed graph embedding | Node/edge attributed directed graph embedding
What is the format of node features that graph2vec and GL2vec in karateclub require? It does mention that there should be no string features but with or without it I am running into an error with the following code:
import networkx as nx
import karateclub as kc
import matp... | https://stackoverflow.com/questions/79508535/node-edge-attributed-directed-graph-embedding | python, machine-learning, networkx, graph-theory, embedding | 1,741,942,321 |
se_51677788 | stackoverflow | MACHINE_LEARNING | Data Augmentation in PyTorch | Data Augmentation in PyTorch
I am a little bit confused about the data augmentation performed in PyTorch. Now, as far as I know, when we are performing data augmentation, we are KEEPING our original dataset, and then adding other versions of it (Flipping, Cropping...etc). But that doesn't seem like happening in PyTorc... | https://stackoverflow.com/questions/51677788/data-augmentation-in-pytorch | python, machine-learning, pytorch, dataset, data-augmentation | 1,533,318,709 |
se_65777704 | stackoverflow | MACHINE_LEARNING | Getting a very low accuracy with Neural Network | Getting a very low accuracy with Neural Network
I am trying to implement ANN on a Cifar-10 dataset using keras
but for some reason I dont know I am getting only 10% accuracy ?
I have used 5 hidden layers iwth 8,16,32,64,128 neurons respectively.
This is the link to the jupyter notebook
model = Sequential()
model.add(D... | https://stackoverflow.com/questions/65777704/getting-a-very-low-accuracy-with-neural-network | python, tensorflow, machine-learning, keras, neural-network | 1,610,984,686 |
se_73780627 | stackoverflow | MACHINE_LEARNING | Neural network low accuracy | Neural network low accuracy
The model is getting really low accuracy. This is my first time writing a neural network so I dont really know how to make it better
import tensorflow as tf
import matplotlib.pyplot as plt
#data set
data = tf.keras.datasets.cifar10
(x_train, y_train), (x_test, y_test) = data.load_dat... | https://stackoverflow.com/questions/73780627/neural-network-low-accuracy | python, tensorflow, machine-learning, keras | 1,663,635,584 |
se_79529836 | stackoverflow | MACHINE_LEARNING | TabPFN feature selection raises KeyError(f"None of [{key}] are in the [{axis_name}]") | TabPFN feature selection raises KeyError(f"None of [{key}] are in the [{axis_name}]")
I trained a tabPFN model, which I then tried applying a sequential feature selector for important feature selection. I've been getting this error
KeyError(f"None of [{key}] are in the [{axis_name}]")
on the following code:... | https://stackoverflow.com/questions/79529836/tabpfn-feature-selection-raises-keyerrorfnone-of-key-are-in-the-axis-nam | python, machine-learning, scikit-learn, feature-selection | 1,742,770,762 |
se_79528929 | stackoverflow | MACHINE_LEARNING | Why does SequentialFeatureSelector return at most "n_features_in_ - 1" predictors? | Why does SequentialFeatureSelector return at most "n_features_in_ - 1" predictors?
I have a training dataset with six features and I am using SequentialFeatureSelector to find an "optimal" subset of the features for a linear regression model. The following code returns three features, which I will call X1, X... | https://stackoverflow.com/questions/79528929/why-does-sequentialfeatureselector-return-at-most-n-features-in-1-predictor | python, machine-learning, scikit-learn, linear-regression, sequentialfeatureselector | 1,742,732,163 |
se_79528937 | stackoverflow | MACHINE_LEARNING | Regression fails with poor initial guess | Regression fails with poor initial guess
Consider a regression task where the parameters of the model differ significantly in magnitude, say:
def func(x, p):
p1, p2, p3 = p
return np.sin(p1*x) * np.exp(p2*x) * p3
# True Parameters:
p1, p2, p3 = np.pi/0.01, -1.25, 1.2356 # 314.1592, -1.25, 1.2356
The system ... | https://stackoverflow.com/questions/79528937/regression-fails-with-poor-initial-guess | python, machine-learning, optimization, pytorch, regression | 1,742,732,578 |
se_33500047 | stackoverflow | MACHINE_LEARNING | R - mice - machine learning: re-use imputation scheme from train to test set | R - mice - machine learning: re-use imputation scheme from train to test set
I'm building a predictive model and am using the mice package for imputing NAs in my training set. Since I need to re-use the same imputation scheme for my test set, how can I re-apply it to my test data?
# generate example data
set.seed(333... | https://stackoverflow.com/questions/33500047/r-mice-machine-learning-re-use-imputation-scheme-from-train-to-test-set | r, machine-learning, r-caret, r-mice | 1,446,556,329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.