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

Adding anomalies to the Dataset

Recently I have been trying different Scikit-Learn anomaly detection clustering methods, like DBSCAN Isolation Forest. Based on how many training data I use, how I tweak on the algorithms ...
-2
votes
0answers
4 views

Replace Values in a column [closed]

I want to replace NR values in the above table corresponding to values exists in the same column. Please help.. i tried many ways but still not able to find.
0
votes
1answer
21 views

How to use entire file as unique sample for classification in scikit-learn?

My dataset is split in different files, since i'm using EEG data collected for BCI (Brain-Computer Interface) classification. Here is what i have: Each .txt file ...
0
votes
2answers
17 views

How can we utilize the TensorBoard

I tried the sample code form the link below. https://www.tensorflow.org/tensorboard/get_started It pretty much worked fine; just had to make a couple tweaks to get it working on my machine. I was a ...
0
votes
0answers
13 views

Comparing PCAP Datasets

I'm having some issues coming up with the best approach to compare two PCAP files. So I have two PCAPs, the first is a known bad application. The second is an unknown application. What I would like ...
0
votes
1answer
28 views

Neural network does not work on XOR

So, I am trying to implement a neural network in Python by only using NumPy. I have tried to do this by following 3Blue1Brown's video's about the topic, however, when testing my implementation, the ...
0
votes
0answers
8 views

Python how to fill null values using condition on several fields when using groupby? [closed]

I need to fill missing values at the Age field with the median according to ticket: ...
0
votes
0answers
19 views

Online courses for Anomaly Detection

As the title say I have been looking for some online courses that would teach me about anomaly detection using Unsupervised Machine Learning. I want to focus only on Scikit-Learn and not go deeper ...
1
vote
1answer
15 views
1
vote
0answers
23 views

Keras Sequential model returns loss 'nan'

I'm implementing a neural network with Keras, but the Sequential model returns nan as loss value. I have sigmoid activation ...
3
votes
1answer
24 views

Leaky ReLU inside of a Simple Python Neural Net

To build a simple 1-layer neural network, many tutorials use a sigmoid function as the activation function. According to scholarly articles and other online sources, a leaky ReLU is a better ...
1
vote
1answer
13 views

Python and GridSearchCV how to eliminate input contains NaN error when using cross validation and decision tree classifier?

I am trying to do cross validation on Decision tree classifier for kaggle's titanic dataset. The first step after cleaning data is to split into train and test sets: ...
0
votes
1answer
38 views

Getting TypeError: expected bytes, Descriptor found while importing tensorflow

I am trying to use tensorflow and keras for one of the tasks but while importing the tensorflow I am getting the below error. Till now I have removed the virtual which I have created previously and ...
1
vote
0answers
20 views

MinMaxScaling vs L1/L2-Normalization

I'm wondering about the difference or the application of the different types of rescaling data. So far, I'm aware that standardization assumes the data has a gaussian distribution. So if this is the ...
1
vote
1answer
18 views

Can I use model which is trained using Keras to Scala?

I train the NLP classification model using Keras by Python. But to deploy the trained model to a platform I need to use Scala. Can I use Scala with Keras model what I trained using Python? Thanks
1
vote
1answer
25 views

Using Tensorflow object detection API vs Keras

I am new to machine learning. I am curious to know what is the difference between using Keras instead of TensorFlow object detection API. We need to manually configure hidden layers and input layer in ...
-1
votes
0answers
10 views

Python — Recursively Reverse String by Parts [closed]

I have a function defined like below def reverse_by_parts(string, n) The function is supposed to recursively reverse the string n times as follows: Suppose ...
1
vote
0answers
20 views

How can I get the predict future following value using Tensorflow LSTM?

Thank you for reading. I'm not good at English. I am wondering how to predict and get future time series data after model training. I would like to get the values after N steps. So, I used the time ...
0
votes
0answers
10 views

Implement a randomized search to tune parameters using mlens package in python

I am using the mlens package in python to build a stacked ensemble. The code below works but I am not sure how to an additional piece: use the ...
0
votes
0answers
36 views

Finding patterns in dataset

I've got a big dataset which looks like: ...
0
votes
0answers
12 views

Dynamic sequence length in Keras LSTM layer

I'm implementing an LSTM with Keras to predict the correct words order. My dataset is composed by sentences, each sentences is ...
1
vote
0answers
11 views

Is there a cost associated with converting Koalas dataframe to Spark dataframe?

I know that pandas works "under the hood" with numpy arrays stored in dictionaries. In contrast, Koalas works with the underlying Spark framework. Does that mean that there is no extra cost associated ...
0
votes
2answers
27 views

Random Forest - ValueError: Input contains NaN, infinity or a value too large for dtype('float32')

I'm trying to apply the RandomForest method to a dataset and I get this error: ValueError: Input contains NaN, infinity or a value too large for dtype ('float32') ...
3
votes
0answers
68 views
+50

Hindsight Experience Replay (HER) results obtained 50 times faster than original paper?

I am reproducing the results from Hindsight Experience Replay by Andrychowicz et. al. In the original paper they present the results below, where the agent is trained for 200 epochs. 200 epochs * 800 ...
0
votes
1answer
24 views

Timeseries VAR vs VARMA model: issue in time to fit model

I want to use VARMA model on a data of about 80000 samples with 10 features. I tried using VARMA model from statsmodels with p=50 and q=10 but it is taking too much time to build the model. I tested ...
0
votes
0answers
15 views

Arima model aic continuously decreasing with value of m

In this figure, i am doing time series forecasting with arima model, where it can be clearly seen there is a seasonality of 2 years, so the value of m should be 104 for the better prediction as the ...
0
votes
1answer
17 views

How to sum all price values having in count the quantity of each one

Using pandas, I would like to sum all of the price to get the count value for each one. The Dataframe looks like this: ...
0
votes
0answers
9 views

Unsupervised classification of satellite images sequences derived from time series with SOFM in python?

I have the following data: Up to 2 images per day (time series from 2015 - 2019 with gaps) for a specific region (AOI - Germany - Hesse) with 2 variables (soil moisture, precipitation). Out of this ...
0
votes
1answer
12 views

Python and Titanic competition how to get the median of specific range of values where class is 3

I am trying to solve Kaggle's titanic competition. In the test set, there is only 1 row having Fare value as null. It's so easy to replace it with median or average of all Fare values. But I am ...
0
votes
0answers
7 views

Indexing tensors in custom loss function with Keras

I'm using a custom loss function in Keras. This is the function: ...
1
vote
0answers
22 views

Python experiment results directory structure creation/manipulation package

so we do numerous types of ML experiments using a number of frameworks. We've ended up writing an awful lot of boilerplate : read some configuration as to the experiment's parameters, variables, ...
1
vote
0answers
20 views

How can I make my own Neural Network model for Object Detection?

I'm using the ImageAI module in Python3 to do some object detection on some images I scraped from a video game. In testing, I am able to successfully detect normal world objects from a test photo of a ...
2
votes
1answer
25 views

How do I know the best pruning criteria for decision trees?

Right now,I am working on decision trees on python,how do I know what would be the best pruning criteria based on my data?
0
votes
0answers
5 views

Cost function in ANN converges to 0.5 and the values of outputs all converge to 0

I have written a simple ANN to understand its internal structure better. However for the past few days I could not understand why it does not perform in the expected way. The way I defined COST ...
2
votes
1answer
27 views

Outlier Detection using K-Means using one column

I have done and read a csv file and then plotted the values of a single column using K-means ...
1
vote
1answer
14 views

Does the Koalas library allow to use all Pandas machine learning libraries like Scikit-Learn, XGBoost, and TensorFlow?

I would like to implement a model based on some cleaned and prepared data set. I already have a bit of experience with PySpark, but from a data scientist's perspective it can be cumbersome to work ...
2
votes
1answer
37 views

Semantic text simiarity using BERT

Given two sentences, I want to quantify the degree of similarity between the two text-based on Semantic similarity. Semantic Textual Similarity (STS) assesses the degree to which two sentences are ...
-1
votes
1answer
35 views

Opinion on recommander systems [closed]

I write this message to ask your opinions about some questions : First, some context : I want to build a project of recommander system for a many shop, what I have ? All the history data about sell, ...
0
votes
0answers
12 views

Is it possible to convert Neural Network code in Python into Matlab code?

I want to convert the code written in Python into Matlab code. May I know is it possible to do that. Share the available ways or methods to do the conversion. May I know is there any Online ...
2
votes
1answer
55 views

Extract relevant features from time series data

I have a time series data set from a sensor and the task is to predict the time before a failure event is occurred. The data set has one feature and has almost 20 million rows. This is a regression ...
0
votes
0answers
10 views

How to make ongoing prediction with panel data with Keras

I have trained a CNN model in Keras for predicting risk of an event happening, where the labels are 0 or 1(one-hot). Input data:...
0
votes
1answer
9 views

ensemble learning with code [closed]

I am trying to create a stacked model using ANN or RNN for NLP as my accuracy is coming 76.5% so I need a python code of stacked ANN or RNN.
0
votes
0answers
9 views

Same Output for every row when doing prediction. Thus I am having wrong predictions

I have implemented an emotion analysis using lstm method, I have trained my model in the first part of the codes and i am now am doing the prediction part. When I run my system, I am having same ...
0
votes
0answers
19 views

Variable selection involving mixture of numerical, high cardinal,low cardinal features

Consider a dummy dataframe: A B C D …. Z 1 2 as we 2 2 4 qq rr 5 4 5 tz rc 9 This dataframe has 25 independent variables and one target variable ,the ...
0
votes
0answers
19 views

How does one apply a arbitrary map to a TensorFlow tensor?

BACKGROUND Consider the following code ...
0
votes
0answers
17 views

Is there a function that could find slope of a curve ignoring peaks?

Let's say I obtained a timeserie (in blue) (with some missing data) that is (as far as i understood) : - following a general trend between specific points - more or less cyclic I have drawn the red ...
-1
votes
0answers
11 views

Plotly - how to smoothen out boundaries in contour plot?

I'd like to smoothen out the boundaries in a contour plot of Plotly, between values that have a numerical value for z and those that have None. Do you know a way to do that? Thank you in advance!
2
votes
1answer
31 views

Tokenization of data in dataframe in python

I am performing tokenization to each row in my dataframe but the tokenization is being done for only the first row. Can someone please help me. thank you. Below are my codes: ...
0
votes
0answers
4 views

Multiple graphs instead one using Matplotlib [migrated]

The code below takes a dataframe filters by a string in a column and then plot the values of another column I plot the values of the using histogram and than worked fine until I added Mean, Median ...
0
votes
2answers
47 views

Cannot make a single prediction: Is this behavior normal?

I am running a hate speech classifier published by Davidson et al. The principle is simple, the classifier takes as an input an annotated ('hateful', 'offensive', 'neither') dataset of tweets. It ...

1 2 3 4 5 82