Stack Exchange Network

Stack Exchange network consists of 175 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
0answers
9 views

Metric (rather than RMSE, MSE, etc.) to choose the best model in terms of the ability to detect peaks better

I have created multiple regression models and wanted to choose the best one. One common metric would be RMSE, as you know. When I looked at the results, second model (RMSE = 0.15) was better able to ...
0
votes
1answer
10 views

How to load pre-processed .txt data and use it for training convolutional networks?

I have a lot of '.txt' (pre-processed) files related to C3D and I need to use this to train and test while using CNN model. How does one go about this? Most of data in each .txt files are formatted ...
1
vote
0answers
13 views

One hot encoding as input to recurrent neural networks

I'm trying to predict next label in a pattern based on previous labels using recurrent neural network. In total I have 100 labels Example of input pattern: ...
0
votes
0answers
16 views
1
vote
1answer
19 views

Predicting yearly income with linear regression using Python

How to predict the per capita income of Pakistan in 2020 by using linear regression model in Python. The training data is: ...
1
vote
1answer
9 views

From most frequent words how to extract technical skill words

I've scrape 30 job description web and stored them into a list called job_desc where each item is a job description. ...
0
votes
0answers
7 views

Any efficient way to build non-linear regression model for polynomial features?

I am trying to understand how crime frequency affect house price in certain area. To do so, I started with Chicago crime data and zillow real estate data. I want to understand the relation between ...
0
votes
1answer
10 views

Training accuracy decreases

I have a program in which I use sequence to sequence approach as a prediction model with attention. The problem is, while training, the accuracy is always decreasing at each epoch, like shown in the ...
0
votes
0answers
7 views

How delete duplicated row and with cell value ='0' [on hold]

Hi, I want delete all rows from my .csv file where: 1) row[patient_id] are duplicated 2) row[Target] == 1 So I want delete last row in my example.
0
votes
0answers
18 views

Machine learning internship interview in 2 days! What to prioritize? [on hold]

I have a technical interview for a machine learning / data science internship for supervised learning--no neural networks or deep learning--in a couple days at a small startup. This will be my first ...
0
votes
0answers
21 views

adding constraints in PuLP optimization problems in python

I want to create an optimal meal plan with minimum sugar intake for 7 days but the everyday diet plan should include food from 3 different categories. How do I add constraint that I could get food ...
0
votes
0answers
22 views

Whats the best ML model to fit my needs comparing binary samples using python [on hold]

im completely newbie in ML but have some experience in coding, i need some advice for the best model to start with in my application. imagine a table, that contains 2.646.000 lines, and 2 columns, ...
0
votes
1answer
10 views

sklearn stratifying dataset with more than one label

I have come across sklearn.model_selection.train_test_split as a method to split up the train and testing dataset. Furthermore they have a ...
0
votes
1answer
5 views

Why the loss is nan by using linear activation function in the last layer?

I want to use neural network to solve a simple regression problem, and I try to program by myself accroding to lecture Backpropagation and Neural Networks . However, I meet loss divergence problem. ...
1
vote
1answer
137 views

How to obtain original coefficients after performing gradient descent on normalized data?

I am reading data from a file using pandas which looks like this: ...
1
vote
1answer
31 views

Random forest vs. XGBoost vs. MLP Regressor for estimating claims costs

Context I'm building a (toy) machine learning model estimate the cost of an insurance claim (injury related). Aim is to teach myself machine learning by doing. I have settled on three algorithms to ...
0
votes
1answer
12 views

CVNN and Tensorflow

How the algorithm use Complex Value Neural Network ( all complex value, like: input, weight,bias and output) in python
0
votes
2answers
13 views

read csv file directly from URL / How to Fix a 403 Forbidden Error

The csv file is downloadable. I can download the file and use read_csv, But I want to read the file via direct URL in jupyter, I used the following code, but I get the ...
0
votes
0answers
24 views

Why is my Seaborn distplot creating bouncing lines instead of smooth lines?

I'm using Jupyter notebook working on the Kaggle Titanic dataset, trying to create a seaborn distplot to compare the 'Sex' variable (0 is male, 1 is female) with the 'Survived' variable (Survived is ...
1
vote
0answers
10 views

Efficient way to replace incorrect words in Series of strings

I'm working with text data, that is handwritten, so it has lots of ortographic errors. I'm currently working with pyspellchecker to clean the data and I'm using the ...
0
votes
0answers
13 views

How to Predict the Psychology of user by his/her tweets , in Python? [on hold]

I want to predict the psychology of a specific user using the tweets considering Natural Language Processing in Python. Please help me step by step using Python Code. Thanks !
0
votes
1answer
17 views

K-means clustering for one class classification

I want to know if I can use the k-means clustering algorithm for a one class classification (as in the case of one class SVM), which means I have data for 2 classes, and I labelled only the one class ...
0
votes
1answer
13 views

Printing Feature Contributions in a Random Forest algorithm from the Treeinterpreter library leading to errors

I am working on a dataset where I predict the risks of developing pancreatic cancer with respect to a number of variables. I have created a random forest, and want to find the feature contributions. I ...
1
vote
0answers
15 views

predictive clustering trees in Python?

I am faced with a time series forecasting cold-start problem, specifically I am forecasting energy consumption of businesses where historic consumption data is available only for training but not new ...
1
vote
0answers
26 views

How to visualize multivariate regression results by plotting plane of best fit?

I am implementing multivariate linear regression using numpy, pandas and matplotlib. I am ...
0
votes
0answers
10 views

When to use BayesianSearcCV and how it works?

Can somebody highlight when to use BayesianSearchCV and how it works? I have seen the implementation of same on kaggle and wanted to explore it further. Below is the link where the implementation ...
3
votes
1answer
65 views

Replace a value in a column if that value appears only once

I have a dataframe, I want to replace the values in one column by "other" if the value count of that value in that column is exactly 1 ...
0
votes
0answers
11 views

IndexError: too many indices for array when switching dataset to MNIST

I am trying to run a Transfer Learning Code from Github Section 9. Transfer learning for large image classification. I have gotten the original code to work with the flower dataset and inception v3. I ...
0
votes
0answers
8 views

Facial Recognition Using One shot Learning Research Paper

1) I am looking for a latest Research Paper for "Facial Recognition Using One shot Learning" for my semester Project. I want to implement that paper and want to improve that. i have searched on ...
1
vote
1answer
16 views

How to explain get_weight with autoencoder in keras?

I built an autoencoder model of three layers with 9 5 9. Input dim =9, encoder dim =5, output dim=9 When I get the model weights, ...
1
vote
0answers
8 views

Question with tensorflow overfiting on mnist dataset

I am a beginner in the Tensor Flow and I am trying to figure out the overfitting issue. I took an example in a quite popular GitHub repo and modify a little bit. https://github.com/floydhub/...
1
vote
1answer
64 views

retrieve food groups from food item list

I have a dataframe of food items as follows: I have to create a food_group list that gives the food group it belongs to, for-example all type of yogurts should be in one group called yogurt. I used ...
0
votes
0answers
48 views

operands could not be broadcast together with shapes (1,12) (3,) [on hold]

I have the following code, and I get operands could not be broadcast together with shapes (1,12) (3,) error. Why? ...
0
votes
0answers
13 views

Tournament prediction

Question: Given a series of wins, losses, and draws from before, is it possible to determine the bracket for a tournament? I've been wondering for a while whether it's possible to determine a ranking ...
0
votes
1answer
12 views

Remove columns with a certain number of consecutive zeros

I'm using pandas and I am dealing with time series of sales. What I would like to do is to remove the columns where a certain number of consecutive zeros appear, since forecasting for sparse series ...
-1
votes
0answers
27 views

How to read in and process a txt-file in Python [on hold]

I know this is a very basic question - I still hope this is the correct forum to post it: Consider a txt-file that consists of 32 columns and a huge number of rows. Columns are separated through <...
4
votes
2answers
51 views

How do I decide if I need to go for Normalization and not Standardization or vice-versa?

While designing a ML model, how do I decide if I need to go for Normalization and not Standardization or vice-versa? On what factor is this decision made?
0
votes
0answers
19 views

Add Header name without using pandas

I want to add header name without using pandas. In my program I have given two columns in my txt file where header name is missing: ...
1
vote
1answer
20 views

Multi class Imbalanced datasets under-sampling imblearn

I have an imbalanced dataset. I am looking to under-sample. Even though, the oversampling process takes less time, the model training takes a lot of time. I have taken a look at imbalanced-learn ...
2
votes
1answer
27 views

algorithm to predict numeric values with sklearn

I'm new to ML and trying to learn it. I scraped information (using python) from a website where people try to sell their cars. I put data in a pandas data frame. Now I'm wondering how should I predict ...
1
vote
0answers
6 views

Sequence classification using oneClass SVM

In the code below, I'm using a sequence to sequence approach as a prediction model for anomaly detection, The data set I'm working with is ADFA-LD. The training phase is done using only normal ...
1
vote
2answers
22 views

Combining Latitude/Longitude position into single feature

I have been playing with 2 dimensional machine learning using pandas (Trying to do something like this: https://github.com/freeman-lab/spark-ml-streaming), and I'd like to combine Lat/Long into a ...
2
votes
1answer
31 views

How can I get variable values from a plot?

I would like to know if there is any way in python to automatically determine the values of point a and b marked in the graph below. Said a different way, finding the values when my plot shows a ...
1
vote
0answers
25 views

Keras load pre-trained weights. Shape mismatch

I have some trouble loading pre-trained weights with Keras. Let's say I have a keras model model and that my weights are stored at ...
0
votes
1answer
46 views

How to create dictionary with multiple keys from dataframe in python?

I have a pandas dataframe as follows, I want to convert it to a dictionary format with 2 keys as shown: ...
0
votes
0answers
16 views

Can McNemar's test be applied to evaluate multiclass models?

Full Disclosure: I did a semi-cross post of this question due to low traffic on Cross Validated. Once I get an answer on any of the two questions, I will link the answer back to the respective other. ...
0
votes
0answers
18 views

Complex Value Neural Network with .csv

This is the part of my program in python: Path of input data and output data for learning. ...
1
vote
0answers
13 views

How to use Kaggle Api in Google Colab for directly using dataset?

I know that we can use Kaggle's api directly in google colab which downloads the dataset. The commands are : ...
2
votes
1answer
47 views

Delete all rows between two values in a dataframe that repeat multiple times in a column

I have dataframe and let's say inside of it is a column_A. This column_A has 3 strings as values, call them 'new_records', 'deletions', 'changes' that repeat across the dataframe multiple times in ...