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

Capsule networks for binary classification not training brain images classification

Currently I am trying to implement a capsule network using Xifeng Guo's Keras code for capsule nets. I have a dataset of brain tumor images with 98 negatively labeled instances and 155 positively ...
0
votes
1answer
26 views

Neural network is not giving the expected output after training in Python

My neural network is not giving the expected output after training in Python. Is there any error in the code? Is there any way to reduce the mean squared error (MSE)? I tried to train (Run the ...
0
votes
0answers
6 views

Tensorflow MirroredStrategy() looks like it may only be working on one GPU?

I finally got a computer with 2 gpus, and tested out https://pytorch.org/tutorials/beginner/blitz/data_parallel_tutorial.html and https://github.com/tensorflow/models/tree/master/tutorials/image/...
0
votes
1answer
24 views

Naive Bayes / SVM classifiation - min. number of records (Python)

I am doing text classification with Python. I have around 120 records with 2 columns: text class I tokenize, stem and lematize the words, I also did some of my own text preprocessing. When I run the ...
2
votes
1answer
29 views

Standardscaler() not standardscaling?

I have following pipeline: estimators = [] estimators.append(('standardize', StandardScaler())) prepare_data = Pipeline(estimators) Originally, the data looks ...
0
votes
1answer
49 views

ValueError: Expected 2D array, got 1D array instead

I would like to extract the 20 most informative features of a very large set of features $X$ coming from a dataset containing clinical data by using the RFE function from scikit-learn in Python. $X$ ...
1
vote
0answers
11 views

Populating Knowledge Base - Stanford DeepMind Alternatives

I am dealing with the task to extract structured information from domain-specific unstructured documents. The end goal is to obtain a reliable, queryable system, i.e. in the form of a chat-bot or ...
0
votes
0answers
6 views

Request Twitter trends using Python and explore local trends: the code give {'errors': [{'code': 215, 'message': 'Bad Authentication data.'}]} [migrated]

I want to request Twitter trends using Python and explore local trends. Twitter categorizes trends (popular hashtags) by country or location, i.e. Worldwide, Canada, Toronto. The following are the ...
1
vote
1answer
25 views

To calculate my confusion matrix with recall and precision, my test set need to be equal(balanced)?

In my CNN, I have 200 'negative' images and 50 'positive' images in my test set and I want to make a confusion matrix. My doubt is if I have to equalize the samples in the dataset because if I keep ...
0
votes
1answer
22 views

empty fields to be filled with previous values

In the above sample data, I have empty fields and now the task is to fill the fields with previous values. my columns are dates and the values are a number of items present for that particular article ...
0
votes
0answers
18 views

Split time series data into Train Test and Valid sets in Python

I'm working on a project in which I have combined 2 datasets if time series (e.g D1, D2). D1 was with the 5-minutes interval and ...
0
votes
0answers
12 views

Combining several Multi-Output-Models into a single Multi-Output-Model

I'm trying to create a k-Nearest-Neighbor based model of 76-dimensional input data $I$ and 44-dimensional output data $O$. Through domain knowledge I know that only certain input dimensions are ...
2
votes
1answer
23 views

5 digit number mis-reads analysis

Nothing to do with number recognition in the classical 'hand-written' sense Disclaimer above to avoid this being counted as a repeat. I have a selection of 96 serial numbers, and a separate ...
0
votes
0answers
16 views

Trying to determine if inputs are integers or floating point using an ANN

i am new to machine learning and just getting started on keras. One of the things i am trying to do is feed a neural network with two inputs (numbers) and find out if it is an integer or a float. ...
0
votes
0answers
59 views

Python Keras model performs much worse than R Keras model

I got this R Keras model from GitHub that performs really well. GitHub repo ...
0
votes
1answer
12 views

Which technique was semantic similarity improved from

Am looking for a material that explains how semantic similarity began,which problem leads to the application of semantic similarity method and proper explanation of it's algorithm.
0
votes
0answers
3 views

Plotly Bar Graph Color Scale [migrated]

I'm trying to keep a bar graph values on the same color scale - for example: ...
3
votes
0answers
56 views

Are there any graph embedding algorithms like this already?

I wrote an algorithm for generating node embeddings based on the graph's topology. Most of the explanation is done in the readme file and the examples. The question is: Am I reinventing the wheel? ...
0
votes
1answer
12 views

Why the first prediction of neural network in PyTorch is slower than following predictions?

So I have ResNet50 trained to classify images. For each prediction I track the time needed for it (input and model are moved to GPU): ...
0
votes
2answers
24 views

Managing NaN in target variables (testing)

Please can someone advise me on how to handle NaN in my target variables set? I've tried a variety of things but none is working. Here's what I've tried: Imputing zeros (0) in Y_test Replacing NaN ...
0
votes
0answers
7 views

Differnt loglikelihood values in RandomSearch/GridSearch and LDA . How to synchronize them?

I am doing a sensitivity analysis for some lda parameters in python. This is what I want to do: -Do RandomSearch to find optimal Parameters and therefore the optimal lda model. As Validation measure ...
1
vote
2answers
32 views
1
vote
0answers
15 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 ...
2
votes
0answers
58 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 = ...
2
votes
0answers
18 views

Voronoi Diagram Algorithm for Geo Locations? [closed]

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

How to convert photo to a vector drawing

I am using the following code to convert photo to a drawing: ...
2
votes
0answers
23 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
16 views

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

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
17 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
21 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
7 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
11 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
35 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
12 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
16 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
6 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
11 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
13 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
9 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
41 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
25 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
8 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
69 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
31 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
6 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
8 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
17 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
50 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 ...