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
3 views

Calculation of Neural network biases in backpropagation

While learning neural networks I've found a basic Python working example to play with. It has 3 input nodes, 4 nodes in a hidden layer, 1 output node. 5 data sets for training. The initial code is ...
1
vote
0answers
19 views

Keras - Implementation of custom loss function with multiple outputs

I am trying to replicate (a way smaller version) of the AlphaGo Zero system. However, in the network model, I am having a problem. The loss function I am supposed to implement is the following: $$l = ...
0
votes
0answers
7 views

How to represent LSTM layer in Progressive Neural Network?

I am trying to use LSTM layers for my sequence prediction problem. When LSTM layer has called with the inputs, it returns the corresponding output and hidden layer state and the cell state. But as ...
1
vote
0answers
11 views

Voronoi Diagram Algorithm for Geo Locations?

As per my Understanding: Voronoi diagram: A Voronoi diagram is a simple concept, and it's based on the minimal distance needed to reach a landmark. If you need to go to a metro station, the most ...
0
votes
1answer
16 views

How to convert photo to a vector drawing

I am using the following code to convert photo to a drawing: ...
2
votes
0answers
19 views

Adding learning episodes to epochs with Keras

I want to implement a prototypical network (https://arxiv.org/pdf/1703.05175.pdf) with keras (there are some implementations in pytorch and tensorflow, but those are not ideal for me). This NN is ...
0
votes
0answers
10 views

Deriving columns and filling them with existing data of the column values

hello guys need help in solving the problem, in the given image I have a column named as the filename which has more than 10000 rows basically there are CSV file names. I want to create columns based ...
0
votes
1answer
16 views

Value error in an embedding layer

I am new to deep learning and I am trying to build a book recommender system using embedding layers. I use one layer for the book and one for the user. I am having trouble with fitting the model. ...
0
votes
1answer
13 views

Preprocessing of 3D CAD files for Keras Conv3D input

I'd like to apply some machine learning on 3D CAD data. File format should ideally be mesh-based like STL. Keras offers 3D convolutional layers (https://keras.io/layers/convolutional/), so it can ...
0
votes
0answers
6 views

Huge forecast errors on certain days for an otherwise good ARIMA pricing prediction

I've built an ARIMA model for an electricity pricing forecast that gives a 24-hour prediction using 17 training days. The model automatically picks its parameters based on a minimal AIC score. I've ...
0
votes
0answers
9 views

Anonymizing the CSV data using Python Faker

To protect the sensitive customer data, I came across a useful python project faker. However, this project only generates the fake values after random iterations. Is it possible to anonymize the ...
0
votes
0answers
25 views

Iris classification with Python neural network

I am trying to implement a simple neural network with Python which will classify the Iris dataset flowers. I would like to keep the code as simple as possible and not use any ready-made libraries. I ...
0
votes
0answers
4 views

Tuning parameters in Affinity Propagation

I am doing Affinity Propagation clustering and trying to do tuning, but it takes time. A lot of time actually. As I am beginner I do not know how to get clusters. I need cluster numbers from 1 to 20 ...
0
votes
0answers
12 views

What types of variables are these? And what types of tests could I run?

So, I recently made a sheet of data collected from the 2010 Census on Cincinnati neighborhoods. The data is from demographics about the neighborhoods of the city such as median household income and ...
0
votes
0answers
5 views

Effective Time Series Forecasting using Keras/LSTM

I am working on time series forecasting for an engineering component (turbo charger). I have dataset containing field data from sensors (=features) taken every day for different turbocharger for their ...
0
votes
1answer
9 views

How to extract sub sentences from sentence mentioning a particular subject?

I am trying to solve an NLP problem. For a given sentence like : "The Pasta was delicious, the Pizza was average" I want to extract the sentiment attached to food items. Having built my own NER ...
0
votes
0answers
12 views

Get cosine similarity with constraint on the size of strings

I want to get the similarity between strings (in python) However, I also want to add a weight based on the size of the strings. If the cosine similarity is 1, but the string is of 2 words, I want the ...
0
votes
0answers
7 views

Error on prediction keras multi_gpu_model

I've an issue running a keras model on a Google Cloud Platform instance. The model is the following one: ...
-1
votes
1answer
39 views

How to find and calculate correlation in a data set which has category and continuous variables? [duplicate]

I am working on an Insurance domain use case to predict if an existing customer will buy a second insurance policy or not. I have a few personal details saved under different categories like Marital ...
1
vote
2answers
24 views

Is it possible to know the output vectors of MLP Classifier of scikit learn?

I'm a beginner with scikiti-learn library. I have an ANN with 3 input, 2 hidden layers and 3 output. ...
0
votes
0answers
7 views

Precision-Recall for CNN place recognition problem

Given 3450 query and 3450 reference images in a place recognition problem, I plot the ...
0
votes
2answers
28 views

what is the difference between euclidean distance and RMSE?

I'm searching for a loss function that fits my Project. Actually I have two question but they are in the same direction. I take a look at the definition of the root mean squared error and the ...
1
vote
1answer
27 views

Why are my Decision Tree Leafs not pure?

I'm making a using DecisionTreeClassifier from SKlearn (v0.21.3) with its default settings, using Python. I do not want regularize it in any way, I want it to ...
0
votes
0answers
5 views

Is there any library available for Manifold learning using 'Diffusion map' in python?

I would like to use an unsupervised learning with technique called 'Diffusion map based manifold learning' in python. The original paper on diffusion map is here. I have already checkout pydiffmap ...
0
votes
0answers
6 views

How bit precision while training can impact DNN's accuracy - Libraries that would support inference with quantized types

I would like to check how bit precision impacts DNN's accuracy. Do you know any C/C++/Python libraries that wouldn't require huge rework for supporting inference with quantized types? For example, I ...
0
votes
0answers
7 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
5 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
1answer
11 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
31 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
2answers
25 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
11 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
33 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
2answers
37 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
41 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
34 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
27 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
22 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
33 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
7 views

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

I would like to know in Python. I'm new to Python and I don't know how to proceed.
0
votes
0answers
22 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
13 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
35 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
15 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
27 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
18 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
27 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: ...
0
votes
0answers
30 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. ...