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

Can I make Jupyter Notebook interactive in Github? [migrated]

Using the following code, I created a slider widget in my local machine Jupyter Notebook. ...
0
votes
1answer
33 views

Streamlit widgets doesn't display in Jupyter Notebook

I'm trying to create streamlit widgets in Jupyter Notebook but when executing the following code nothing happens. ...
3
votes
2answers
46 views

Keras OOM for data validation using GPU

I'm trying to run a deep model using GPU and seems Keras running the validation against the whole validation data set in one batch instead of validating in many batches and that's causing out of ...
0
votes
0answers
10 views

Can we combine two or more time series models at a time to get forecast results.? [closed]

I have created a time series model it will take one features to give forecast results, so that i am having many features like that, What my thought is can we combine two all features models in one ...
0
votes
0answers
12 views

How to troubleshoot TensorFlow error “Restoring from checkpoint failed.” [migrated]

I am new to Tensorflow, I have been using a trained model from a Git repository. The pre-trained model is saved in '../model/snapshot-38' directory. I have snapshot-38.index, snapshot-38.meta, ...
1
vote
1answer
34 views

Agent Collapse / Overfitting during Training

I'm new to reinforcement learning so please bear with me. I'm training an agent to play ms-Pacman using the actor-critic method. Below are the results of a couple of runs, in both graphs the orange ...
0
votes
0answers
29 views

how can i plot a stacked bar chart by year with two values(columns)?

not sure if this is correct medium, but i am having trouble plotting this simple data: how do i get the graph below - aplogies for this poor picture. basically i want it stacked with the risk label ...
0
votes
2answers
15 views

Standardization with positive and negatives

I have a data set that has a few columns such as: Total cost: mean = 3,000,000 Percent complete: mean = 50 final profit %: mean = 14 I know with such different orders of magnitude before I fit a ...
0
votes
2answers
29 views

Python: advice on which machine learning algorithm to use for a problem which involves lots of randomness

I'm new to machine learning so I'll summarize my problem with two examples without getting technical (because I can't). The dog vs. cat classification example is solvable, in the sense that a human ...
4
votes
3answers
217 views

How to get K most different rows in csv?

We have boring CSV with 10000 rows of ages (float), titles (enum/int), scores (float). How to select 1000 most different rows? I look for a general solution that ...
1
vote
0answers
14 views

How to fix the error in the following code in Python and Keras?

I am unable to figure out the problem with the code (see below). I am also providing error trace after the code. Goal of the code is to use a dataset (with numerical and categorical variables) to ...
0
votes
0answers
19 views

A pretrained model for mathematical equations characters detection

I am working on a project to convert equations to LaTeX code. After segmenting out the characters, I got stuck on the detection part and was looking for some pre-trained model that could detect ...
0
votes
3answers
20 views

Problem of having imbalanced classes in the test set while using oversampling

I have an imbalanced dataset. My classes are 0 and 1. The number of 0 class instances is about 20 times more than the number 1 class instances. I know that I should apply oversampling after train test ...
0
votes
0answers
15 views

Determining common columns among many datasets without having to manually inspect them

I have a bunch of datasets (10+) and I want to be able to join/ relate them to one another through columns that may contain similar values. For example, date and location are common columns that could ...
1
vote
0answers
12 views

Why KMeans.score() gives very high value?

I'm working on Udacity's Identify Customer segments project. My problem now is that after applying StandardScaler on the dataset after procedures of cleaning, I used PCA(n_components=36).fit_transform(...
0
votes
2answers
27 views

How to evaluate which dimensionality reduction technique is a better fit? [closed]

If I use different dimensionality reduction techniques such as PCA and t-SNE, how can I evaluate which method are more suitable on my dataset? I am using python to do this.
0
votes
1answer
36 views

Association Rules with Python (coded dataset)

I have this dataset which I really need to use association rules techniques on. The dataset has like 90 variables, many of which are ordinal. Thing is, the data is already coded using numbers instead ...
0
votes
1answer
29 views

Random forest confusion matrix encountered invalid values

I am doing classificaion using random forest classifier in python (scikit learn). I have many different databases, each one has 33 observations and the prediction is based on 600 columns. The script ...
0
votes
1answer
13 views

Best Approach to Forecasting Numerical Value Based on time series and categorical data?

Consider a dataset of thousands of car repairs that have been performed. In simplest of terms, the columns to consider are the time of year when it was broken (seasonal changes in demand for car ...
0
votes
1answer
31 views

Error with pandas dataframe (needs to be 1-dimensional)

I am trying to determine the conformal predictions for my model with my data. But it gives me following error that occurs at icp.calibrate(X_cal, y_cal) : ...
0
votes
1answer
28 views

Separate business emails from personal emails

I am working on a classification problem where I would like to separate business emails from personal emails to analyse their behaviours separately. I am thinking about using regex but after looking ...
0
votes
1answer
56 views

Is this attribute numeric or categorical (ordinal)? Help!

So I have this dataset I need to perform several techniques on as part of a data mining/machine learning project of some sort in PYTHON. There are a couple of features however, that have me very ...
-2
votes
1answer
18 views

Accuracy of a forecasting model for prediction of COVID-19 occurence

My goal is to find the best performing forecasting model for the occurrence of COVID-19 in Toronto. I pre-train the network with data on the occurrence of SARS in ten countries and Toronto. Then I ...
0
votes
1answer
17 views

Multidimensional K-Means wiith sklearn, centroids problem when plotting

I am working with a dataset (X) to predict 12 clusters with K-Means using python SKLEARN library: ...
1
vote
1answer
51 views

Naive Bayes always predicting the same label

I have been trying to write a naive bayes classifier from scratch that is supposed to predict the class label of the nominal car.arff dataset. However the classifier always predicts the most common ...
0
votes
1answer
19 views

How can I reshape this array?

I have few difficulties in picking values from an array. Here is a simplified version of the concerned part of the code. (If you would like to put the whole code please mention it) ...
1
vote
1answer
19 views

Overfitting results with Random Forest Regression

I have one image that contains for each pixel 4 different values. I have used RF in order to see if I can predict the 4th value based on the other 3 values of each pixel. for that I have used python ...
-1
votes
1answer
18 views

How to Select Rows from Pandas DataFrame with condition [closed]

I have a dataframe (csv file) which consists of about 8000 songs (column name "Song")of e.g. 20 singers(column name "Artist"), so each singer has more than one song. I want to ...
0
votes
0answers
21 views

Concatenate/combine specific data from multiple HDF5 files into a single CSV file in Python(with code for converting single hdf file to csv file) [closed]

Suppose I have multiple HDF5 files in my E:\NASA directory and want to compile/concatenate the lat (path in HDF5: xxx.HDF5/NS/latitude), ...
0
votes
2answers
33 views

How can I explain this chart showing 5-days moving average?

I have plotted the frequency of items sold through time, trying to determine the trends by moving average. I considered a 5-days window. I would like to know if this approach makes sense and how I ...
0
votes
0answers
14 views

Time Series Analysis / Modeling with auto_arima

I recently dived into Time Series and was attempting at doing some data analysis and modeling. I'm using the following dataframe ...
0
votes
1answer
17 views

Canny edge detection not working on Gaussian blurred images

I am trying to detect edges on this lane image. First blurred the image using Gaussian filter and applied Canny edge detection but it gives only blank image without detecting edges. I have done like ...
0
votes
1answer
15 views

Question about reshaping array size for KNN Classifiers

I keep trying to run a new set of data through my KNN Classifier but would recieve the message: ValueError: query data dimension must match training data dimension ...
1
vote
0answers
19 views

Why is Tensorflow LSTM training slower on a machine with far better components?

Training an LSTM using the exact code and dataset on two different machines with different components yields different results in terms of training time. However, for my case, the results were the ...
1
vote
1answer
23 views

XGBoost - feature importance just depends on the location of the feature in the data

I'm trying to do some feature selection using XGBoost, but the feature importance chart just spits out the features in order of appearance. The feature that is in the first column in the xtrain data ...
0
votes
0answers
15 views

Transfer learning with Keras for medical image classification

Good afternoon; I'm trying to do Transfer Learning from pre-trained model on imagenet to solve a classification task with Lung CT slices. These slices are stored in ...
0
votes
3answers
39 views

How do i get dummies for this dataset

I am using an udemy course for MachineLearning and I am trying to form a dummy for my variable the column is Country I want to change to France Germany Spain France ...
0
votes
1answer
10 views

How do feature selection on a sparse matrix?

Say I want to do features selection on a sparse matrix, i.e., 10,000 rows x 1500 features, but the matrix is mostly sparse. Let's say the features are all numeric and the target is binary and discrete....
0
votes
0answers
10 views

How could I implement POS Tagger using HMM with Viterbi Algorithm in Python(IPython)?

I was trying to implement a POS tagger for resource-scarce language. For the implementation, I've my own manually tagged corpus in a quite small amount. Having this corpus, I've been dealing with the ...
1
vote
0answers
24 views

XGBoost model performance barely budging, and max_depth is basically irrelevant

I have a dataset that includes 62 features and around 1 million observations. The 62 features are mostly socioeconomic status indicators for students as they start a school year. The labels are the ...
0
votes
1answer
22 views

plot gridsearch csv results how?

how can i plot my results from gridsearch csv? ...
1
vote
1answer
16 views

Image classification using cnn [closed]

I did image classification using CNN and it successfully classified the images but How to save predicted images to separate folder for example i have two classes cat and dog after prediction how to ...
3
votes
1answer
46 views

Why would GradientBoostClassifier do better than XGBoostClassifier? [duplicate]

I am working on the Kaggle home loan model and interestingly enough, the GradientBoostClassifier has a considerably better score than XGBClassifier. At the same time it seems to not overfit as much. (...
0
votes
1answer
16 views

Predicting evolution of an unknown mathematical function with machine learning?

Is it possible to predict how a mathematical function evolves using ML? I am studying radioactive decay of polonium 210 and I have gathered data for its decay throughout a couple of weeks. I was ...
0
votes
2answers
32 views

Validation Curve Interpretation

I have been reading about the validation_curve function from scikit learn. When I run this it takes too long. Therefore, I am plotting the results from grid search ...
1
vote
0answers
19 views

How to extract embeddings of categorical variables

I am little bit confused about encoding categorical variables. There are other posts/blogposts on this issue but none is talking about the problem I am facing. I have a dataset with mixed variables (i....
1
vote
0answers
14 views

Explain FastText model using SHAP values

I have trained fastText model and some fully connected network build on its embeddings. I figured out how to use Lime on it: complete example can be found here: https://medium.com/@ageitgey/natural-...
1
vote
1answer
41 views

How Calculate Effect (percentage) label of the input variables on the output variable by BernoulliNB

a description problem below. I have 10 words like X1 , X2 , X3 , ... , X10 and three Label like short , long , hold. My problem is that how calculate Effect (percentage) label of the input variables ...
0
votes
0answers
12 views

Digitize graphs. Pull out data from points in a scatter plot

I have a project where I would like to extract data from a series of scatter plots that are image files (Jpeg or png). The plots are similar but the axes scales are not always exactly the same. I have ...
0
votes
1answer
10 views

How to enable GPU on GradientBoostingClassifier?

Is there a way to enable GPU on GradientBoostingClassifier?

1
2
3 4 5
93