Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is a general-purpose, dynamic, strongly typed language with many 3rd-party libraries for data science applications.

0
votes
1answer
10 views

How to add values to new row to a csv in python

So what I'm trying to do is iterate over a (grayscale?) image and look at each pixel and write that pixel's grayscale value to the second row(the first row is the pixel number). Code isn't doing ...
0
votes
1answer
12 views

Combine results from multiple models

I am using chunks of 100000 rows at a time from the CSV file to train the a simple LASSO model. How do i combine all of these models trained from these different chunks? I would like to use all ...
0
votes
0answers
11 views

Which sklearn classification would perform best on shape= (2000, 1024) w/ binary features?

I have a training data set that is roughly 2000 rows by 1024 columns all binary data either 1's or 0's. The labels are numbers that equate to the letters of the alphabet so this basically a hand ...
0
votes
1answer
8 views

How can I merge 2+ DataFrame objects without duplicating column names?

This is for work. TLDR: Bottom-line question at the bottom. I am gathering and parsing test results produced by an old test setup whose output formatting is not likely to change anytime soon. I've ...
0
votes
1answer
10 views

Python Code to find the number of hapax legomena in a Text or Words_List

In corpus linguistics, a hapax legomenon is a word that occurs only once within a context, either in the written record of an entire language, in the works of an author, or in a single text. The term ...
0
votes
4answers
26 views

remove special character in a List or String

Input_String is Text_Corpus of Jane Austen Book output Should be : ['to', 'be', 'or', 'not', 'to', 'be', 'that', 'is', 'the', 'question'] But getting this Output : ['to', 'be,', 'or', 'not', 'to', '...
0
votes
0answers
10 views

Evaluating fuzzy C-Means clustering

I am new machine learning practitioner. I have run fuzzy c-means algorithm on a multi-label dataset (PPI dataset) on the network using skfuzzy python library. I want to evaluate the performance of the ...
0
votes
0answers
7 views

How to use boolean data to build DecisionTreeClassifier?

I was looking for solution on StackExchange, but I didn't find anything which matches my question. I am using this dataset: https://web.archive.org/web/20100704072013/http://lpis.csd.auth.gr/mlkd/...
0
votes
0answers
16 views

Regularization in Python Code

I tried to understand the code provided below. This code is for Regularization using python. ...
0
votes
1answer
14 views

Loss function returns nan on time series dataset using tensorflow

This was the follow up question of Prediction on timeseries data using tensorflow. I have an input and output of below format. ...
0
votes
0answers
6 views

how assign header by other column header and concate header and first row in pandas?

i have a data like this my desire format is this how can i do this?
0
votes
1answer
17 views

Confusion with euclidean distance implementation

I have to implement the k means algorithm from scratch using python on this data set that has 29 columns and 476 rows. With all these different data points I am confused on how I can calculate the ...
0
votes
0answers
5 views

create random forest using decision trees generated by different decision tree algorithms

We're planning to conduct a data mining study which will be using ID3, C4.5 and CART algorithms. Naturally, this would then generate three different decision trees. Would it be possible to create a ...
0
votes
1answer
19 views

sklearn.decomposition.PCA explained_variance_ratio_ attribute does not exist

When trying to identify the variance explained by the first two columns of my dataset using the explained_variance_ratio_ attribute of ...
0
votes
1answer
15 views

How can I perform backpropagation directly in matrix form?

I had made a neural network library a few months ago, and I wasn't too familiar with matrices. So, instead of performing matrix dot products (between weights and inputs, then adding a bias matrix), I ...
0
votes
2answers
20 views

Business analytics for data center

I work at a private cloud company and would like to write some forecasting or business analytics that would be helpful. For example I would like to write something in Python that would forecast when ...
0
votes
0answers
19 views

Why my perceptron doesn't train well and produces bad results on test data?

I am a newbie in Machine learning and I am writing a small code for Perceptron. This is the first time I am writing code in Python. I have four training data points (X). As they are used for ...
0
votes
0answers
15 views

Grid search for autoencoder model

I'm using autoencoder for anomaly detection. Model's output is basically the reconstructed input based on the original input. The anomalies are then calculated using the reconstrction error. I would ...
0
votes
0answers
10 views

ID3, C4.5 and CART random forest

I'm just curious, since the building blocks of random forests are decision trees, is it possible to build a random forest for each algorithm? (ex. a random forest using the ID3 algorithm)? I'm ...
0
votes
1answer
16 views

Similarity of Dictionaries Using Cosine Similarity

I'm trying to use Cosine Similarity in Python to compare users, but can't seem to get it quite right. ...
1
vote
1answer
58 views

Model Not Learning with Sparse Dataset (LSTM with Keras)

This classification problem is apparently simple and I have no idea why it's not working, perhaps I'm doing a conceptual mistake. I'm trying to make a predictor which will classify minutes on a clock ...
1
vote
0answers
15 views

python calculating degree days

I am trying to write a program in python to calculate growing degree-day for a specific insect out of average hourly temperature. The way you calculate growing degree day from hourly temperature is by ...
1
vote
1answer
33 views

TypeError: unhashable type: 'numpy.ndarray' [on hold]

I'm trying to do a majority voting of the predictions of two deep learning models.The shape of both y_pred and vgg16_y_pred are (200,1) and type 'int64'. ...
0
votes
0answers
18 views

How can I extract skills from a resume using python 3? [on hold]

I am new in python and I am trying to work in resume parsing ,so I need the skill portion of the input resume.How can I do this? any idea?
1
vote
2answers
29 views

Round numbers in dataset [on hold]

How do I round all numbers in the following dataset to two decimals? Data: (made with sklearn.datasets.make_classification) ...
1
vote
1answer
23 views

Is it possible to detect the person using face recognition on the fly?

I am building a small app for face detection in python using face_recognition and opencv ...
0
votes
0answers
12 views

How to create autoregression model for multiple inputs and one output with time interval 120min using python

Here I have data with time import from csv file. I have three inputs (x,x1,x2) with actual output value (y) with time period. I want to predict the next value using past values with time using ARIMA ...
0
votes
0answers
3 views

std::bad_alloc with densenet and hyperas

I am filing this issue after being stagnated here for couple of weeks. I am using hyperas to find the hyperparameters for my network, Densenet. My issue here is that my evaluation always fails with ...
0
votes
1answer
13 views

How to interpret the mean for output clusters for expected-maximization?

I am trying to cluster data using scikit's expectation-maximization. So I created two different data sets from a normal distribution which is I have shown in the graph below. The mean for each of the ...
1
vote
1answer
19 views

Mapping column values of one DataFrame to another DataFrame using a key with different header names

I have two data frames df1 and df2 which look something like this. ...
0
votes
0answers
12 views

Using GPU for genetic algorithm [Python] [on hold]

I'm training neural networks playing Snake through a genetic algorithm in Python, everything is fine but I noticed that it spends most of the time playing games in order to compute the fitness for ...
0
votes
0answers
8 views

Change gradient rate in the plt.imshow()

I'm plotting image in the matplotlib. Rate of the value is shown with color. I want to change gradient of color that's shown in the plot. For example: From to
0
votes
1answer
18 views

Alternatives to doc2vec?

What are some alternatives to the doc2vec embedding model? I.e models that convert paragraphs/documents into vectors, not just models that take the mean/sum of the word embeddings of each word in the ...
0
votes
0answers
23 views

Train TicTacToe NN by human moves

Last few months I started with machine learnig little bit more than just reading articles, so I'm trying to understand it in practice. I started with tic tac toe game. It looks easy and funny, and it ...
0
votes
0answers
8 views

How to feed huge datasets into Keras Models at a super fast rate?

I'm trying to find an efficient way to train a NN on a huge dataset. To understand the volume of the problem, I have 100x400mb csv files, which take up 20+GB in memory when loaded in pandas. Now the ...
0
votes
0answers
14 views

ValueError: Numpy arrays that you are passing to your model is not the size the model expected

I am trying to perform concatenation on the Bidirectinal LSTM layer. I have my model defined like this: ...
0
votes
1answer
26 views

pandas: How to impute the categorical column by the nearest neighbors?

I've a categorical column with values such as right('r'), left('l') and straight('s'). I expect these to have a continuum periods in the data and want to impute nans with the most plausible value in ...
0
votes
0answers
9 views

Python - Finding inverse CWT with pycwt

I've a vector (signal) and want to find CWT and ICWT of the this. I'm using pycwt as a library and this my code. ...
-1
votes
0answers
17 views

how to repeat some row data in python? [duplicate]

i have a dataset like this i want to change first column of data and my desire data frame is like this how can i do this?
0
votes
0answers
6 views

How to denormalize data used to train a RNN?

I am running the code defined in the "usage" section of this repo. I get the same output : Before training and testing, the data is normalized with the following code : ...
1
vote
1answer
35 views

What's going wrong with my Tic Tac Toe Q-Learning Alghoritm?

my Q-learning alghoritm currently choices the "sub optimal" option and not the best one. ...
0
votes
1answer
21 views

Generating a set of different scenarios based on some initial observations

I have a in my hands 3 different time series which model 3 different scenarios (base, downside, upside). Every of this time-series depends on a set of 11 different attributes, which take values for ...
-1
votes
0answers
5 views

Retrieve a cluster connected to a ring

I am trying to retrieve data points in a cluster in 2D space. The cluster is connected to other data points roughly in the shape of a ring. I have to do this for various clusters and rings so a non-...
0
votes
1answer
19 views

sentiment analysis nltk python

I'd like to perform sentiment analysis on stock comment using scikit and nltk. I already have about 100 comments on different stocks like "this stock will rock" which I marked as positive (1) or "this ...
0
votes
1answer
33 views

Gaussian distribution in python without using libraries

I am implementing Gaussian distribution of a variable, but it gives multiple bell shapes. It should be a single bell shape. Below is my code and plot. ...
-2
votes
0answers
32 views

how to handle rows and columns in python? [closed]

I have a dataset which has large data and is like: I tried to replace these number of first columns by their respective header but I did get a solution. I want this table in format:
1
vote
1answer
46 views

Prediction on timeseries data using tensorflow

I have an input and output of below format. (X) = [[ 0 1 2] [ 1 2 3]] y = [ 3 4 ] Its a timeseries data. The task is to predict the next ...
-1
votes
2answers
37 views

how to transformation of row to column and column to row in python pandas? [closed]

I have a large dataset I want to transform this dataset into this format I have try it through transpose but i couldn't figure out
0
votes
1answer
22 views

Error in python while scrapping data from indeed(AttributeError: 'str' object has no attribute 'text')

How can I scrape a URL such as: https://www.indeed.com/jobs?q=data+scientist+%2420%2C000&l=New+York&start=10 where I want to get the following paramters: job title, company name, job ...