We’re rewarding the question askers & reputations are being recalculated! Read more.

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

(Py)Spark infrastructure for use in Java/C# website

Lets say I have experience creating ML models in Python, and have decided on training my models on Spark using Pyspark. This will form part of an ML infrastructure for a website with a Java or C# ...
0
votes
0answers
4 views

Help regarding generative modeling

I have data in form of n dimensional points. I have to train generative model where i pick a class through multinoulli distribution. Then each dimension of actual point is generated by some ...
0
votes
0answers
15 views

K-fold Cross Validation: Implementing stratification on the IRIS-Data set

As i am diving into the topic of Machine Learning and trying to learn some main concepts of evaluating models, i read a bunch of literature about the k-fold Cross Validation. I understand how it ...
0
votes
1answer
5 views

Free API for historical weather US data?

I am trying to retrieve a free R-Python API that provides historical weather data in US. In fact wunderground API is no longer available. Any suggestion?
1
vote
1answer
12 views

How to plot time series data from SQLite database

I am trying to plot time series data by accessing the SQLite database. I successfully connect the database by coding the below script,however, i couldn't figure out how to plot the time series data ...
1
vote
1answer
14 views

GridSearchCV vs RandomSearchCV and How it works?

GridSearchCV vs RandomSearchCV Can somebody explain in-detailed differences between GridSearchCV and RandomSearchCV? And how the algorithms work under the hood? As per my understanding from the ...
0
votes
0answers
8 views

How to save a trained ml model(e.g. decision tree) in database and load it using Flask to predict user submitted data?

I have tried the following way. It worked, but it is giving a different prediction in Flask vs Jupyter (which is correct) ...
1
vote
2answers
31 views
0
votes
2answers
26 views

Is it a best practice to exclude retweets from the data set?

I am going to build machine learning algorithm to identify fake tweets. The data set has huge retweets which I think might be an issue. Do you think given that the focus is the original tweet, it is ...
0
votes
0answers
17 views

CNN implementation low accuracy on MINST data

I'm trying to implement VGG11 (Model A of Table 1 from https://arxiv.org/pdf/1409.1556.pdf) on the MINST dataset but I'm getting ~10% train & test accuracy (as bad as random guessing). I had to ...
0
votes
0answers
38 views

Error loading a model (.h5 file) after training yolo-keras classification model

I am working on realtime object detection using my laptop's camera with Yolo and Keras. I have trained a model and the resulting output is a .h5 file containing (from my understanding) the model and ...
1
vote
1answer
30 views

How to calculate accuracy, precision and recall, and F1 score for a keras sequential model?

I want to calculate accuracy, precision and recall, and F1 score for multi-class classification problem. I am using these lines of code mentioned below. ...
1
vote
2answers
25 views

Replace data in Pandas dataframe based on condition by locating index and replacing by the column's mode

Hopefully, you don't mind me posting a question here instead of the regular stack exchange forum. I'm learning ML basics and practising pandas. assuming the data frame is called df, column name = ...
0
votes
2answers
21 views

How to optimize input parameters given target and scoring parameters

I'm new to machine learning/optimization, so I apologize in advance if this has been answered before. I don't know which search terms to use. I have a large dataset where I have a number of input ...
2
votes
2answers
30 views

Pandas datetime error when reading from excel file

I am trying to read an excel file that has two columns using pandas. This is how the data looks in excel file: ...
-1
votes
0answers
6 views

What point processes can I use to model Spikes? [on hold]

I would like to know in Python. I'm new to Python and I don't know how to proceed.
0
votes
0answers
20 views

3d density of population visualisation on map Python

I am looking for Python module, in which I could create 3d visualization of population density on map. To create 3d plot like this:
0
votes
1answer
12 views

Fast processing: changing the column value in a geospatial environment

I have a table whose header looks like this: complaint_type, borough, street_name, incident_zip, latitude, longitude. 1) I want to check if the "incident_zip" column of each row is in a specific list ...
1
vote
1answer
30 views

Is there any way to create column based on some previous column in PANDAS dataframe?

Given: I have Pandas Dataframe as shown below ...
0
votes
0answers
32 views

Data Analysis on normally distributed salary with Outliers

I have created normally distributed data with 2 outliers ...
0
votes
0answers
14 views

Can I use/modify an Autoencoder to handle missing data?

I am about to implement an Autoencoder to detect anomalies. Therefore, e.g., in my test set, there is a situation where the data stream broke for some days. This results in a lack of data and should ...
0
votes
2answers
25 views

How to get an intution for generating Keras CNN layers for a model

I am going through tutorial for handwritten text recognition. And to do hand written digit recognition the author has constructed a Keras model as follows: ...
0
votes
0answers
17 views

Preprocessing for Text Classification in Transformer Models (BERT variants)

This might be silly to ask, but I am wondering if one should carry out the conventional text preprocessing steps for training one of the transformer models? I remember for training a W2V or Glove, ...
-1
votes
0answers
26 views

Python Neural Network choose correct text

Hey I am new into the neural network scene. I would like to create a network which takes as input several file names. To train it I would say which files are usable and which are not. For example: ...
-2
votes
0answers
10 views

How can I extract vehicles model from a text using feature extraction? [closed]

I'm working on a project in which I should read thousands of emails and extract features from their bodies, among these features "vehicle model", for example in this text: ...
-1
votes
1answer
26 views

Python naming columns [closed]

I have the below code in Python. When the output publishes the second column, which has the values, has no column name so I can't refer to it in subsequent functions. How can I add a column heading to ...
0
votes
0answers
29 views

UserWarning: `Sequential.model` is deprecated

C:\Users\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\engine\sequential.py:110: UserWarning: Sequential.model is deprecated. ...
0
votes
1answer
18 views

Target encoding before split on skewed data

Hi My data is distributed like follow: And I only have categorical variables on many many levels. As I need to make a regression task I thought about doing leave one out encoding on my categories. ...
0
votes
1answer
24 views

'list' object has no attribute 'values' when we are using append in python

Here I have a dataset with three inputs. Here I generated y value using append. After the append I got the output like this: y.append(rec.iloc[0]['y']) Then I ...
0
votes
0answers
20 views

How to define quadratic weighted kappa as eval_metric in catboost classifier

I am using catboost for a multiclass classification problem. I want to use quadratic weighted kappa as the evaluation metric. Catboost already has WKappa as an eval_metric but it is linearly weighted ...
0
votes
0answers
31 views

Fully-Configured Deep Learning Virtual Machines in Python (VirtualBox or VMware)

Fully-Configured environment setup for Deep Learning Virtual Machines in Python (VirtualBox or VMware) Often when we start working on any new technology, the most common challenge that we face is "...
0
votes
0answers
17 views

Using normal distribution data with high amplitude

I am using some data from a csv file to train a model which detects credit card fraud. The data set is from Kaggle and has 284,xxx samples each with 30 features. After some visualization in Python, ...
3
votes
2answers
194 views

Need machine learning algorithm to fill in time-series data

I am currently dealing with a time-series data set with cyclical gaps every 30 minutes (30 minutes of data, 30 minutes of no data). Is there a relatively simple way of using scikit-learn (or some ...
1
vote
2answers
26 views

Does the predict function in machine learning understand categorical data

I understand that before feature engineering one has to split the dataset into train and test data, so as to avoid bias in the analysis. I also understand that the machine learning model does not ...
0
votes
0answers
20 views

Clustering data using KMeans centroids of base period for pattern analysis

I have a data frame consisting of 12 months of Customer Transaction Level Data. The data is unsupervised. The data is divided into 6 sets of 2 months period each. Taking first period as the base, I am ...
2
votes
0answers
37 views

Python: Plotting equation with the Dirac Delta function

I am attempting to plot the expected diffraction pattern from a sharp razor which has a formula of: $$ I(p) = \frac 14 \delta^2(p) + \frac {1}{4\pi^2p^2}$$ where $p = \frac {\sin\theta}{\lambda}$ I ...
-1
votes
2answers
55 views
1
vote
0answers
21 views

Linear Regression on data with bimodal outcome

I have a data set with 3,000 features and continuous dependent variables of time with 18,000 instances. The histogram of the dependent variables show that the they have a bimodal distribution. I am ...
0
votes
0answers
11 views

I am unable to change the title of similar_to_air_force_one and search for value 'Til There Was You (1997)' in it [closed]

The error says for line 18 TypeError: 'str' object cannot be interpreted as an integer ...
0
votes
1answer
17 views

k-fold cross validation procedure to split the data into training and test [closed]

i'm trying to do a k-fold cross validation procedure to split the data into training and test subsets but i'm not sure how to do this: ...
0
votes
0answers
11 views

How to keep a list entry based on first appearance of a year? [migrated]

I have a list of lists: I've been experimenting with different loops and for statements, but can't seem to get it to work. What I'd like to do is keep the entry based on first appearence of the year....
2
votes
0answers
26 views

Did I do the right thing in my CNN Keras (class imbalance - augmentation)

To implement my Binary CNN in keras, I had a dataset of ~~35000 images but only 700 is from one class and all the others are from the other class, so what I did: I get the 700 unique images from class ...
0
votes
0answers
16 views

How do I get confidence intervals for an ElasticNet in sklearn?

I need to produce a row for the confidence interval for every field that I am calculating coefficients and scores off of. So here is my code so far- ...
2
votes
1answer
30 views

Dataset from sequence of messages

I have a sorted dataset by datestamp which looks like this: ...
0
votes
0answers
5 views

How to generate alignments for word-based translation models if number of words are different in both sentences

I am working on implementing IBM Model 1. I have a parallel corpus of some 20,00,000 sentences (English to Dutch). Also, the sentences of the two docs are already aligned. Aim is to translate a Dutch ...
0
votes
0answers
20 views

Should I remove the background of my training images?

The images in my dataset look are as below: The images have either a purple background or a white one. But the trained model (cnn) will be tested on images from the field ,that is, they will most ...
2
votes
0answers
54 views

Results are too good.. what is wrong? How to predict correctly?

I am about to evaluate a neural network and want to check whether the predictions make sense. The variables: ...
1
vote
2answers
131 views

How to install Polynote on Windows?

I've been searching around the Internet for a while but I have not been able to find detailed instructions on how to install Polynote (The polyglot notebook with first-class Scala support.) for ...
2
votes
1answer
20 views

What is difference between “cv2.filter2D” vs Keras “Conv2D” function

When I have to sharpen an image using opencv, I use: ...