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
0
votes
2answers
10 views

How to fit integer output in neural network

I have a data set that contains 104 input features and 96 output values ​​to be predicted, the input features are floating values ​​normalized to [-1,1], and each out put value would be one integer ...
-1
votes
0answers
6 views

Multiple integer output for neural network [closed]

I have a data set that contains 104 input features and 96 output values ​​to be predicted, the input features are floating values ​​normalized to [-1,1], and each out put value would be one integer ...
0
votes
0answers
10 views

Searching for ressource recommendations (books,papers) to validate the results of a Topic Model (LDA)?

Hi I am building a Topic Model Process with Python. To do this I am using the LDA. However I am having trouble to determine the ideal amount of topics. Currently I am using the CoherenceModel ...
1
vote
1answer
15 views

python tsne.transform does not exist?

I am trying to transform two datasets: x_train and x_test using tsne. I assume the way to do this is to fit tsne to x_train, and then transform x_test and x_train. But, I am not able to transform any ...
0
votes
0answers
11 views

Python Algorithm for adding and expanding new rows in excel file [closed]

Is there some kind of Python Algorithm for adding and expanding new rows in excel file, where we can +1 new city for this example and it will create multiple row with this city name AND include the ...
3
votes
1answer
100 views

What is cohen kappa metric, implementation in Python?

Can somebody explain indetail explanation on Quadratic Kappa Metric/cohen kappa metric with implementation in Python
1
vote
0answers
12 views

How to create list of multi value in a list format of each field in a single column?

I am very new to programming and python; coming from functional background. I am currently using a tutorial: https://www.analyticsvidhya.com/blog/2019/04/predicting-movie-genres-nlp-multi-label-...
1
vote
0answers
16 views
1
vote
1answer
38 views

Anomaly detection - relation between thresholds and anomalies

I'm developing an anomaly detection program in Python. Main idea is to create a new LSTM model every day, training it with the previous 7 days and predict the next day. Then, using thresholds, find ...
0
votes
0answers
11 views

Pruning of SVM classifier [closed]

I am trying to perform the pruning technique for SVM classifier. I couldn't find any python code examples for SVM pruning to get inspired.
0
votes
0answers
8 views

Implement neural network to train my data and get best 6 output from the testing dataset [closed]

I have a trainer dataset which has the average run, strike rate , runs scored and other characteristics of some player. I want to train my data in such a way so that from my tester data I get 6 best ...
2
votes
1answer
18 views

Generating random numbers from best probability distributions?

I have done some statistical distributions on real-world data. The distribution fitting gives me the below results (lognormal fits the best on data based on chi-squared test): ...
0
votes
0answers
9 views

Error :UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 124: invalid start byte [closed]

Error: ^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 124: invalid start byte I am getting this above error, any help is highly ...
0
votes
1answer
22 views

Algorithmically extract seasonality in time series data

Suppose you are trying to measure if the seasonality of a particular event stream is consistent i.e. the events in a time series happen more or less in pattern like fashion. How can you ...
0
votes
1answer
22 views

How would I load a database with multiple inconsistent headers?

I have a database with multiple headers like so: ...
-1
votes
0answers
30 views

NameError: name 'randn' is not defined [closed]

I tried to run this code and it gave me an error saying name 'randn' is not defined Kindly have a look on the code : ...
1
vote
0answers
19 views

LSTM for multiple time series regression with extremely large ranges

I have the following question for those which encountered the same dilemma as me: My target is to develop a LSTM RNN for multi-step prediction for multiple time series representing daily sales of ...
2
votes
0answers
18 views

Implementing a Kernel Adaptive Filtering model explained in a paper

In this paper, Stock price prediction using kernel adaptive filtering within a stock market interdependence approach, the authors propose a method for predicting stock prices by combining the ...
1
vote
3answers
56 views

Detect if word is «common English» word or slang word

I have a huge list of short phrases, for example: ...
0
votes
1answer
23 views

How can I override the values of 1 column in a big dataframe using a small second dataframe? [closed]

I have a Pandas dataframe (donations_df) that contains thousands of donations. Each donation row has many columns, but the two key ones for my question are: A <...
1
vote
1answer
25 views

When to use deep learning for java as opposed to python

I have been asked to explore options to build deep learning based applications using java, so i happend to browse a website called dl4j (https://deeplearning4j.org) which has got implemantations of ...
0
votes
0answers
10 views

Population Data

I'm trying to creating a heatmap using Esri Arcgis but need to find a data set of the population within a 1-mile and 3-mile radius. Does anyone know if there is a free data set that I could use? ...
0
votes
1answer
17 views

Weight pruning of CNN

I was confused when i was reading about weight pruning on CNN. Is it applied for all the layers including convolutional layers or only it is done for dense layers?
0
votes
0answers
5 views

Using Complex Event Processing Engine for Machine Learning Models

we are running several models to detect events on customer and financial data using a cron-tab. (runs every 5 minutes currently) Some of these events are described as a model (often using ML methods ...
0
votes
0answers
11 views

Fragment level classification

Is there a tutorial or an example on fragment level classification task? I have to identify and classify specific n-grams in a text? The training data contains examples labeled as span or not span. (...
0
votes
0answers
19 views

Logistic regression, where is my mistake

I am doing assigment on Logistic Regression on Andrew Ng DL course, and can't understand where is my mistake, ...
1
vote
0answers
14 views

Bayesian network in Python: both construction and sampling

For a project, I need to create synthetic categorical data containing specific dependencies between the attributes. This can be done by sampling from a pre-defined Bayesian Network. After some ...
1
vote
0answers
19 views

Detect blur image using ssdmobilenet and tensorflowlite

I have clear images of cards vs blurry images of card. My task is to capture photo when the image is not blurry, as you can see from the description I need this code to run in real time on android ...
0
votes
0answers
14 views

Nan loss on training Keras regression model

I have defined the following model in Keras wherein I am trying to apply regression on some data. My input dimension is of size (300, 250) where each of the 300 values represents a cluster center and ...
1
vote
0answers
10 views

Deep Q Learning - training slows down significantly

I'm trying to build a deep Q network to play snake. I designed the game so that the window is 600 by 600 and the snake's head moves 30 pixels each tick. I implemented the DQN algorithm with memory ...
-1
votes
0answers
8 views

I am getting the value error in my code [closed]

ValueError: Error when checking input: expected dense_1_input to have shape (8,) but got array with shape (7,)
0
votes
1answer
25 views

How to apply a different Loss function to one specific Label?

I got a recurrent neural network in Keras, which classifies on 14 labels. The first label is the most important one and should be predicted with the highest accuracy. The other labels don't have to be ...
0
votes
1answer
16 views

Choosing the periodicity in a SARIMA model

Given the order (P,D,Q,s) of a SARIMA model, s is an integer representing the number of periods in a season. Intuitively, I suppose it would be 12 for monthly data ...
2
votes
0answers
13 views

Design of Deep Learning Architecture?

How is a deep learning architecture designed? Can somebody explain in-detail, steps involved for designing a deep learning architecture?
1
vote
0answers
20 views

Algorithms and Techniques used for Route Optimization

What are the algorithms/techniques used for route optimization problems like VRP in Data Science? Vehicle Routing Problem (VRP) can be described as the problem of creating a set of optimal routes ...
0
votes
1answer
26 views

bad input shape (5634, 2)

I tried everything and I am not sure how to resolve the following error: "ValueError: bad input shape (5634, 2)" This is my first machine learning example so please bear with me. This is the python ...
2
votes
1answer
18 views

What is Continuous Ranked Probability Score (CRPS)?

I came across some evolution metric at Kaggle: Continuous Ranked Probability Score (CRPS): Mathematically, $C = \frac{1}{199N} \sum_{m=1}^{N} \sum_{n=-99}^{99} (P(y \le n) -H(n - Y_m))^2,$ where P ...
0
votes
0answers
20 views

Customize loss function for Music Generation LSTM (?)

I have to carry out a Music Generation project for a Deep Learning course I have this semester and I am using Pytorch. The dataset is songs in midi format and I use the python library mido to extract ...
0
votes
0answers
14 views

The added layer must be an instance of class Layer. Found: <keras.layers.normalization.BatchNormalization object at 0x0000024B0C16B780>

I don't know why BatchNormalization is giving the following error. Googled out but couldn't find any relevant answers My code appears to be this:
0
votes
0answers
14 views

Do I need to train a separate DeepFake model for every input person?

I would like to create a deep fake model of a specific person (we will call him Steve). I would then like to be able to upload a video of any random person and swap their face with Steve's. So far I ...
1
vote
1answer
11 views

Fraud risk propagation in large scale network

What's the best approach to do some graph analytics and risk propagation in a network using python where multiple accounts are connected through a relationship and few of the accounts in the network ...
0
votes
0answers
18 views

Predict clusters most common coordinates [closed]

I have a data mass of 15,000 coordinates, e.g.: [512,150], [148,12], [240,600]... I clustered this data to find 5 groups. For these 5 groups, I want to predict the most common coordinates. I am ...
0
votes
0answers
13 views

IndexError: index 3 is out of bounds for dimension 0 with size 3 #1 [closed]

I using pytorch . i Working on custom image detection with yolo using pytorch. I do transfer learning. While training i faces the error "index 3 is out of bounds for dimension 0 with size 3 #1" i do ...
1
vote
1answer
40 views

How to do time series regression without scikit and numpy in Python?

On a recent Hackerrank interview I was faced with the following problem: Given a set of timestamps (format 2019-11-26 11:00) and their corresponding stock prices (single float value), approximate ...
0
votes
0answers
26 views

Logistic Regression Plotting Learning Curve and Decision Boundary with Python

I already trained a dataset with Logistic Regression. However , I could not find any plotting code blocks of learning curve and decision boundary of my trained data. I put my codes at below. So , how ...
0
votes
0answers
8 views

Integrating Dagster with Django ORM

I want to integrate Dagster into ongoing Django project. Dagster runs out of Django context and eventually there is no way to directly access django ORM without calling ...
0
votes
0answers
36 views

Pytorch CrossEntropyLoss expected long but got float

have you done some research before asking the question? Yes. I have done a lot of online searching, and others had similar problems. There solution was to use .float() when entering into the loss ...
4
votes
1answer
56 views

SHAP value can explain right?

I face a problem with using SHAP value to interpret the Tree-based model. (https://github.com/slundberg/shapsd) First, I have input around 30 features and I have 2 features that have high positive ...
1
vote
3answers
214 views

ROC curve interpretation

I trained a CNN model and a combined CNN-SVM model for classification. I wanted to compare their performance using ROC curve but I was confused which model is better. How to interpret the given ROC ...
-1
votes
1answer
22 views

Recommend another product only on purchase history of users available

I have data in the following format. ...