Questions tagged [python]

Use for data science questions related to the programming language Python. Not intended for general coding questions (-> stackoverflow).

Filter by
Sorted by
Tagged with
1
vote
0answers
51 views

Is it possible to use Inception Model in GANs (DCGAN) using PyTorch(or any other library)?

MAIN ISSUE: Is it possible to use Inception Model (e.g. v3) for DCGAN using PyTorch(any other library)? I've tried to find info how it could be implemented but nothing has been found. It was explained ...
2
votes
0answers
45 views

Genetic Programming Python library with a Scikit-Learn inspired API

I've been working with GPlearn for the passed couple of months as part of my research, but it turns out that it provides only a binary symbolic classifier. Do you guys know any other python library ...
1
vote
2answers
91 views

Negative values in XGBoost regression

I am trying to perform regression using XGBoost. My dataset has all positive values but some of the predictions are negative. I read on this link that reducing the number of trees might help the ...
1
vote
1answer
17 views

Fuzzy and FuzzyWuzzy: what are the differences in text comparison?

I have found a lot of information about fuzzy logic, but less information about fuzzywuzzy. I would like to know more about this, the function which determines the logic, if possible, and understand ...
0
votes
1answer
12 views

How to add Error Bar to Matplotlib line plot?

I have the following dataset which I use to plot a line plot. The plot is obtained as the mean of values obtained from the data. I want to add error bars to this ...
0
votes
2answers
35 views

Is is possible to see the input labels for a randomforest model?

I have a random forest model built like this: ...
0
votes
1answer
17 views

Why can't we feed datetime to Linear Regression and how does toordinal() different from any other integer datatype?

I'm working with dates for the first time. First I knew I had to convert it to timestamps which gave me the values in "datetime64" values. But then I came to know that Linear Regression from ...
1
vote
0answers
14 views

auto_arima results summary (intercept?)

I ran auto_arima on my model from the library pmdarima and I'm trying to interpret the results printed to the console. I see two examples of similar parameters that yield different results: ARIMA(0,1,...
0
votes
2answers
895 views

ValueError: y should be a 1d array, got an array of shape (285, 30) instead [closed]

I am using this data set below and I am trying to find the support vector machine of the data set. Also I have my code and error below as well. http://scikit-learn.org/stable/modules/generated/sklearn....
3
votes
1answer
27 views

Predictive output with your own model built

I would need to better understand how can be created a machine learning algorithm from scratch using an own model developed based on boolean values, for example # of words in a text, # of punctuation, ...
1
vote
0answers
11 views

Sampling for the encoder part of the VAE

my question regards the code utilized to implement the sampling function in the encoder part of VAE. Supposing that we chose a latent dimension of 2. Before the latent representation, we have 4 ...
1
vote
0answers
19 views

Generating synthetic data based off existing real data (in Python)

I am looking for an approach to generate synthetic data for anomaly detection. We have real data, but want to inject anomalies to battle-test the model (the real data is too limited for likely future ...
0
votes
1answer
18 views

Combine K-nearest neighbor with categorical embedding

I've tried a few ways to do my multi-class classification. For categorical data, I used the embedding technique with Tensorflow, which moves the entity closer with its similarity. This technique ...
1
vote
1answer
16 views

Catboost multiclassification evaluation metric: Kappa & WKappa

I am working on an unbalanced classification problem and i want to use Kappa as my evaluation metric. Considering the classifier accepts weights (which i have given it), should i still be using ...
1
vote
0answers
10 views

Passing reduced/different feature data to LimeTabularExplainer compared to the original model

I am trying to use LimeTabularExplainer class and explain_instance function to find explainations of my LightGbm (lgb) model. However, the lgb model uses complex feature set which are not ...
1
vote
0answers
20 views

How to Ensemble Machine Learning Models?

I want to Ensemble my predictions for the StratifiedKFold of LGBM and XGBoost into another LGBM Model. I had written the following code which works when the data set has an ID_COL, but in this data ...
1
vote
0answers
13 views

Narrow confidence Interval of forecast

I am new to data science so please accept my apology in advance. I am trying to predict the value using ARIMA. I have got weekly value for the current year. Based on the available weekly values, I ...
0
votes
1answer
23 views

Pull Random Numbers from my Data (Python)

Let's imagine I have a series of numbers that represents cash flows into some account over the past 30 days in some time window. This data is non-normal but it does represent some distribution. I ...
0
votes
1answer
36 views

training gradient boosting algorithm in python testing in Golang

What are the best strategy to train and save a gradient boosting algorithm, e.g. LightGBM or XGboost or Catboost in Python but load the model in GoLang and make prediction with Golang ?
1
vote
1answer
51 views

My corr() function in Python keeps resulting in an “ValueError: The truth value of a Series is ambiguous…” [closed]

I am a very inexperienced programmer, this is my first question on the Data Science StackExchange, I sorry if it is formatted poorly or comes across as basic. For some strange reason, in Python, ...
1
vote
0answers
19 views

PyTorch: Train without dataloader (loop trough dataframe instead)

I was wondering if it is bad practice to instead of using built in tools such as dataloader just loop trough each row in a pandas df. Lets say I am doing text classification and my training loop looks ...
0
votes
1answer
31 views

grid search result max_features = 'sqrt' in random forest - how to understand

I did a grid search at random forest params. the result of print(randomforestreg.best_params_) The result is = {'max_depth': 28, 'n_estimators': 500 ',max_features'...
1
vote
1answer
24 views

How do I control sensor data readings against (measured) outside influences?

I need some hints in this problem I have. I have a dataset of electro-dermal activity readings that are, by nature, influenced by the movements of the person that is being surveyed. In the same ...
1
vote
0answers
17 views

How to train Ngram models

i am fairly new to Natural language processing and a might be misunderstanding some concept of of it, i am doing some homework: Training N-GRAMS i wanted to know ...
0
votes
0answers
10 views

Intuition behind CNN Training Accuracy being Different than Loaded Model predicted on same exact data

I am trying to display some metrics in my final evaluation of several CNN models that I have trained using Tensorflow/Keras. I want to list the training accuracy for demonstration sake. However, I am ...
1
vote
0answers
368 views

ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type int) in Python

I have written the following code for a neural network to perform regression on a dataset, but I am getting a ValueError. I have looked up to different answers and ...
0
votes
0answers
11 views

Python make_scorer giving incorrect outputs for Root Mean Square Logarithmic Error

I want to generate a grid search for which I need the scoring parameter based on which the search will take place. I have defined the following function to provide ...
0
votes
0answers
25 views

How to balance dataset using fit_generator() in Keras?

I am trying to use keras to fit a CNN model to classify 2 classes of data . I have imbalanced dataset I want to balance my data equally. How I can do that ?? Any help would be appreciated The main ...
0
votes
0answers
13 views

How Adaboost works?

I have a basic doubt about Adaboost that pseudoalgorithms doesn't clearly explain. At each iteration, it uses a subset (that is resampled based in the errors of the previous weak learner). After ...
2
votes
0answers
34 views

AUC on ROC Curve near 1.0 for Multi-Class CNN but Precision/Recall are not perfect?

I am building a ROC Curve and calculating AUC for multi-class classification on the CIFAR-10 dataset using a CNN. My overall Accuracy is ~ 90% and my precision and recall are as follows: ...
0
votes
0answers
33 views

Would this be viewed as overfitting?

I've read on one site that "if val_loss starts increasing and val_acc also increases, it could be a sign of overfitting". I thought these model results fit well, however, does the results ...
0
votes
0answers
23 views

Regression ANN getting high root mean squared error values after re scaling dataset

I have a data set on predicting solar power generation, I am getting root mean squared loos of 0.3196 on training set on scaled values, but when I inverse transform them my loss rises to 298 on ...
0
votes
2answers
51 views

What makes the validation set a good representative of the test set? [closed]

I am developing a classification model using an imbalanced dataset. I am trying to use different sampling techniques to improve the model performance. For my baseline model, I defined an AdaBoost ...
4
votes
1answer
141 views

What's wrong with my implementation of the Adaline algorithm?

I'm working through the textbook called Learning From Data and one of the problems from the first chapter has the reader implement the Adaline algorithm from scratch and I chose to do so using Python. ...
2
votes
1answer
23 views

Automation of finding a starting point of measurement in a large dataset

I am looking for a way to automatically find a starting point of rising in my signal in Python. The data are collected with the frequency 10k (0.0001 s each) so the differences between each point are ...
0
votes
1answer
36 views

ANN regression accuracy and loss stuck

I have a data set on predicting solar power generation,the dataset has 20 independent var and 1 dependent. The accuracy of my model is stuck at 60%. I have tried several models but this accuracy is ...
0
votes
0answers
8 views

Python using collection's counter and simple count on dataframe are returning different results for products that are most often sold together

I am following a real data science project on youtube and learning some new scripts and techniques to go around the data and extract insights. The teacher wants to check what are the products that are ...
0
votes
0answers
22 views

How to analyze the abnormal trajectory of the vehicle?

I use this code to mark the latitude and longitude of the vehicle with red points on the map: ...
-3
votes
1answer
24 views

regex for JSON only for one nested data [closed]

Hi guys do you know how to change this regex, that it only looks for test :
1
vote
0answers
35 views

How do I model time series data that contains a unique ID and a constant time step?

My data currently looks like this (after processing, 15 mins timesteps): ...
0
votes
1answer
37 views

How to predict custom value after using linear regression?

I'm new to machine learning, and I'm currently practicing by playing around with datasets that I find on Kaggle. Currently I'm trying to predict the price of an Audi, based on the model, mileage and ...
2
votes
1answer
61 views

Is is possible to train on Hypergraphs in Keras?

I know that vanilla Keras doesn't support operations with graphs. For example, the Spektral library, based on Keras API, provides some layers to work with simple graphs. However, it doesn't support ...
0
votes
1answer
34 views

Creating a image classification model [closed]

I am working on a dataset to classify facial expressions. Dataset has 7 classes, training images 28000 and test images 7000. I created 2 models Model1: this model has 11 layers. Initially model was ...
4
votes
1answer
49 views

Why do Isolation Forest implementations turn it into a supervised learning problem (with random values for the target?)

I am looking at various implementations of the Isolation Forest in python and R. Both sklearn in python and solitude in R use a y variable with the ExtraTrees regressor. Since, Isolation Forest is ...
4
votes
1answer
128 views

Why you shouldn't upsample before cross validation

I have an imbalanced dataset and I am trying different methods to address the data imbalance. I found this article that explains the correct way to cross validate when oversampling data using SMOTE ...
0
votes
0answers
8 views

Keras error on concatenating a list of tensors

I'm reproducing two versions of what I believe to be the same code, but one of them works, the other doesn't: ...
1
vote
1answer
21 views

Pytorch LSTM not training

So I am currently trying to implement an LSTM on Pytorch, but for some reason the loss is not decreasing. Here is my network: ...
0
votes
1answer
33 views

How to get used to matricial/vectorial operations?

I came to data science/machine learning from another background in computer science and i feel that i'm lacking of experience with matricial/vectorial operations. Python or Matlab, for instance, ...
1
vote
0answers
14 views

Getting vague results using VAR time series forecasting in python!

Firstly, I am a beginner in this field of Data Science and have tried to implement some time series models for wind speed forecasting. Also, I am aware of the fact that some regression models might ...
2
votes
4answers
159 views

Is it possible to get worse model after optimization?

I am trying recently to optimize models but for some reason, whenever I try to run the optimization the model score in the end is worse than before, so I believe I do something wrong. in order to ...

1 2 3
4
5
97