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
4
votes
1answer
47 views

Is there an NLP corpus that contains common medical terms?

I am trying to use the NLTK library to extract keywords denoting medical symptoms from medical reports of patients. For example, I have a medical report as follows: s:a 33 year old female ...
0
votes
0answers
29 views

Unable to Predict the custom trained mobilenet in browser using TensorflowJS

I am new to TensorflowJS and Javascript. I trained a mobilenet with images of diamonds using Tensorflow Object Detection so that it can detect Diamonds. The model is saved in SavedModel format. I ...
1
vote
1answer
62 views

How can i increase the memory of Jupyter?

What I have: I have a data set (35989 rows × 16109 columns) and is unfortunately confidential. But i receive this error massage: ...
0
votes
1answer
16 views

Target and output shape/type for binary classification using PyTorch

so I have some annotated images that I want to use to train a binary image classifier but I have been having issues creating the dataset and actually getting a test model to train. Each image is ...
0
votes
0answers
34 views

How to tell which class is which with SHAP values in a summary plot?

I ran a random forest classifier to predict pollen color based on various environmental variables. The possible predictions are purple or yellow. I want to run a summary plot in shapely to get an ...
0
votes
0answers
9 views

I need help outlining the workflow for predicting winner in book prize

I would like to predict the winning book in a yearly book prize that has been going on since the 1950s. As to now, I have data about candidates and winning books (title, editor, text, etc.). The ...
3
votes
2answers
340 views

How exactly does DQN learn?

I created my custom environment in gym, which is a maze. I use a DQN model with ...
0
votes
0answers
16 views

ValueError: Input 0 of layer sequential_1 is incompatible with the layer:

Input 0 of layer sequential_1 is incompatible with the layer: expected axis -1 of input shape to have value 35 but received input with shape [None, 1] state and action are just a number.. like 1,2 ,3....
1
vote
0answers
34 views

Why is this binary state format so much more efficient than a non-binary one?

I am teaching myself Deep Q Learning (and machine learning in general) using python and tensorflow to play Snake. My initial learning came mostly from this article. I have rewritten it in my own ...
0
votes
1answer
40 views

What is the best solution to replace NaN values?

I'm thinking about using the normal distribution of a specific column that has missing values and replace them by random values generated using the normal distribution function of numpy on that ...
0
votes
0answers
10 views

SelectKBest for regression `f_regression` behaves weird when changing the random_state parameter when splitting

I am working on a regression project using the Audi dataset from Kaggle. I have looked at other notebooks and i saw that people use SelectKbest. I tried using the same thing, but when I was splitting ...
1
vote
1answer
23 views

How to specify output_shape parameter in Lambda layer in Keras

I don't understand how to specify the output_shape parameter in the Lambda layer in Keras/Tensorflow. The documentation says: ...
0
votes
0answers
21 views

ImportError: DLL load failed while importing _pywrap_tfe when running exe file created by Pyinstaller

I have created the exe file of my code which uses tensorflow on gpu. It seems that building process using Pyinstaller goes fine. However, when I run the exe file in a system without GPU, I get the ...
0
votes
1answer
18 views

Unsynchronized time series visualization

I would like to visualize a large amount of events composed of time serie windows. A typical event would be: Problem is, my events are not synchronized, and so if I plot them all, it would look like: ...
1
vote
1answer
20 views

Interpretation of Autocorrelation plot

I am trying to understand better how to read the autocorrelation plot here for a timeseries data. I ran the following code and got the output as a chart show below. ...
0
votes
0answers
12 views

Optimizing Tensorflow Graph Trace for Ram

I'm implementing an attention model in Tensorflow 2.0. One 'issue' I've run into is that building the graph for a very long decoder can use a lot of ram and take a long time to compute. That is, if ...
1
vote
1answer
24 views

Dimensionality reduction to correlate large number of variables

So I have this dataset with about 750 variables (columns) and 50,000 rows of entries. I would like to reduce the dimensionality of the dataset to say 25-50-100 dimensions and then compute a ...
1
vote
2answers
36 views

How to preprocess tensorflow imdb_review dataset [closed]

I am using tensorflow imdb_review dataset, and I want to preprocess it using Tokenizer and pad_sequences When I am using the Tokenizer instance and using the following code: ...
0
votes
0answers
29 views

Keras Beginner: How do I modify model.compile and model.fit as per custom loss and output?

I am a beginner experimenting with UNet deep learning model. I have implemented the basic model and was trying to incorporate weight map to the loss function to separate touching objects. My reference ...
0
votes
1answer
162 views

Python: How to plot time interval from a Dataframe in Pandas

I have the a dataframe(df) which has the data of a Job being executed at different time intervals. It includes the following details about the execution of a job: ...
1
vote
2answers
31 views

Dealing with zeros when plotting log-scaled data [closed]

I have a non-negative variable and I'd like to plot it, log-scaled I'm trying to understand how to deal with 0-values. One naive idea I had in mind is just to add <...
-1
votes
1answer
17 views

How to group clusters with semantic similarity?

I have a list of job titles. I found the semantic similarity between them by using word2vec in spacy. Now I want job titles ...
0
votes
1answer
16 views

Normalized 2D tensor values are not in range 0-1

Below function takes in 2D tensor and normalizes it using broadcasting .The issue is except all values to be in range 0-1 but the result has values outside this range . How to get all values in 2D ...
1
vote
1answer
26 views

How to create a multi label classification network in Keras if I have the training data with various accuracy?

I'm trying to create a neural network that finds the most effective treatment for each patient. I have a medical database for training. The inputs are histological and pathological data (mostly 0/1 ...
0
votes
1answer
33 views

Statsmodel logit with sample weights

Using sklearn I can consider sample weights in my model, like this: ...
0
votes
0answers
21 views

Results of quadratic SVM in Matlab are different from the results obtained in Python

I am trying to replicate a quadratic SVM classifier from Matlab to Python, however I am having different results regarding the accuracy. In Matlab the accuracy is 0.8955 meanwhile in Python the ...
0
votes
0answers
7 views

Multilingual alternatives for med7

I'm looking for alternatives for med7 library for other common languages. Training a custom NER model for different languages seems like not the right option to ...
0
votes
1answer
42 views

Any pythonic way to auto determine imbalance class problem, specially in multiclass scenario?

A data is imbalanced if a target class proportions are unequal and typically, heavily biased. But, what is the exact measurement of this heavy bias? Before applying imbalance techniques (SMOTE, ADASYN,...
0
votes
1answer
13 views

How can I preprocess text to feed into a SVM?

I am using an IMDB dataset which contains reviews of the movies in the column text and the rating 0 or 1 in the column label. I am preprocessing the text using Tfidf using sklearn. The code for the ...
0
votes
1answer
61 views

to generate consistent encoding for words in Keras using tf.keras.preprocessing.text.one_hot

I am using keras(tensorflow) to convert text into encodings using tensorflow.keras.preprocessing.text.one_hot I have used it for training dataset as below ...
1
vote
0answers
14 views

Watch list of Tweets with unknown model

I have a pre-trained model that I load after import gensim using model = KeyedVectors.load_word2vec_format('path', binary = True)...
1
vote
1answer
22 views

What is different between R2 and mean of R2 in multiclassification probelm? Which one is correct?

I have a question. I have a big dataset (unfortunately confidential). What I did? I have trained my model with Naive-Bayes. ...
0
votes
2answers
27 views

How match output (pred value) to input value

I'm working with data(with 4 columns which are p(product), M(name of the store)), I want predict the demand of store for that I sued SVR on the data by theses formulation: ...
0
votes
0answers
9 views

Downloading table in latex format from Stargazer using python

I have installed Stargazer to accumulate all the result and obtained the results in a well-organized way. I have used the following command to get result in latex format. But, the output generated ...
1
vote
1answer
72 views

Plot Two Categorical Variables

How to plot two categorical variables in Python or using any library? I want to plot the Playing Role of a Cricketer (Batsman, Bowler, etc.) VS Bought_By (Franchise Names, e.g., CSK, DC, etc.). The ...
0
votes
0answers
20 views

Generate Knowledge graph from text paragraph as input using python

I want to plot a knowledge graph from text paragraph as input in python, So wanted to know is there any transfer learning model, machine learning method or python library which helps in generating ...
0
votes
0answers
14 views

How to make an lstm ensemble with different input shapes using keras

This is what I got so far for making an lstm ensemble with one model input for each of the lstm models and for the ensemble model and it works perfectly. ...
1
vote
0answers
28 views

Apply error analysis on the iris dataset for a specific type of misclassification

Suppose that I have the well known iris dataset and I want to perform error analysis on the misclassified examples, more specifically for a specific class. I don't ...
0
votes
0answers
16 views

Why does Catboost outperform other boosting algorithms?

I have noticed while working with multiple datasets that catboost with its default parameters tends to outperform lightgbm or xgboost with its default parameters even on a tabular dataset with no ...
0
votes
1answer
38 views

IterativeImputer Evaluation

I am having a hard time evaluating my model of imputation. I used an iterative imputer model to fill in the missing values in all four columns. For the model on the iterative imputer, I am using a ...
0
votes
2answers
96 views

Keras/Tensorflow: model.predict() returns a list. How do I match the output with my class names?

I have a CNN built in Keras. I have saved it and am now using the model.predict() function to make predictions from it. Whenever I run the following code, ...
0
votes
0answers
13 views

Dimension issue with keras concat layer when using tf.Data

I decided to switch to using a tf.Data input for my CNN model and now I am getting the following error message ...
1
vote
0answers
16 views

How to preprocess data for multiple rows instance? [closed]

I have a machine learning problem where I must detect anomalies in (let say) taxes declaration. So I have multiple rows for each enterprise, each row describing the tax declaration a the time (date,...
1
vote
0answers
12 views

Is it possible for a times series to not have any residual component after additive/multiplicative decomposition?

After conducting a times series additive decomposition using statmodels, the chart shows only a trend component, and there isn't any seasonal or residual component observed. I was wondering how ...
2
votes
1answer
40 views

How to handle highly Imabalanced classification?

I have been dealing with a classification problem. Real issue is the imbalance here I have ~500,000 -ve samples and ~300 +ve samples.End result is predicted probabilities NOT hard 0-1 classification ...
-1
votes
1answer
22 views

Multiplying a dataframe by a larger one [closed]

I have two dataframes df1 and df2 with the same columns but not the same row number. I want to multiply them element-wise such ...
0
votes
1answer
365 views

How to use inverse_transform in MinMaxScaler for pred answer in a matrix

I am working on a data, for preding output, I used SVR by bellow code: ...
2
votes
0answers
85 views

How SHAP value explains contribution of features for outliers event?

I'm trying to understand and experiment with how the SHAP value can explain behaviour for each outlier events (rows) and how it can be related to shap.force_plot(). ...
0
votes
0answers
36 views

Looking for a machine learning algorithm that can classify line plots into two groups?

I have a dataset of many 2-D line plots that represent height versus position measured from an AFM. I am interested in training a model by classifying these lines into two groups: presence of a defect ...
0
votes
0answers
16 views

Accessing group elements in groupby

I had a doubt about groupby operations. Lets suppose I have grouped my data based on one column and got 5 groups as output. I know that we can iterate over these groups and apply functions to them as ...

1
3 4
5
6 7
105