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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
1answer
9 views

High RMSE and MAE and low MAPE

I have used a few regression models on the same dataset and obtained error metrics for them as shown below, The RMSE(Root Mean Squared Error) and MAE(Mean Absolute Error) for model A is lower than ...
2
votes
0answers
9 views

Scikit-learn average_precision_score() vs. auc score of precision_recall_curve()

I've been searching around for an explanation to this, and haven't come across one yet- in scikit-learn, when I compute the auc() of the ...
2
votes
0answers
8 views

Fully connected layer output explodes, but weights, gradients, and inputs all have sane values

I'm trying to train a GAN, and the architecture includes a fully connected layer before the output activation function. In my case, by the second training iteration this layer's output always explodes....
2
votes
0answers
5 views

How to find coreset of a given dataset in python?

I am trying to implement the core-means algorithm, which is basically k-means using coreset. I have searched up and down but could not find any libraries or modules which could help me with this. ...
2
votes
0answers
9 views

Handling large word embedding matrix in Python

I have a pre trained Glove word embedding matrix (U) of dimension (400000 * 50). Now for the purpose of query expansion I need to perform the operation matmul(U*U.T). This is the term by term ...
0
votes
0answers
11 views

plot and measure uncommon part of kdeplot

As you can see this code generate that picture: ...
0
votes
0answers
17 views

Different results for Linear Regression using lm (R) vs linear_model (sklearn-python)?

I'm implementing a linear regression to compare users (categorical variable) to a percent difference (target variable and continuous). When I was using linear_models from sci-kit learn (python), the ...
1
vote
0answers
13 views

Improving the accuracy of my activity classifier

I'm extremely new to machine learning. I recently discovered turicreate and wanted to use it on a project to classify data spit out by the accelerometer and ...
0
votes
1answer
9 views

What would be the best way to map similar ngrams

I'm trying to map similar ngrams using Wordnet and synsets. For example: elder brother and older sibling should map to the same ...
0
votes
0answers
23 views

how to check the classes the keras classifier/Neural Network is trained on?

I have trained a CNN using keras for Image classification with 3 classes. The results are bad and I'm trying to understand what the classifier has learnt and what it has not. It's only giving me an ...
0
votes
2answers
20 views

Custom conditional Keras metric

I am trying to create the following metric for my neural network using keras $$ s = \left\{ \begin{array}{ll} \sum_{i=1}^{n} e^{\frac{-d_i}{10}}-1 & \quad d < 0 \\ ...
0
votes
1answer
12 views

Should the cost function be zero using TensorFlow's sigmoid_cross_entropy_with_logits?

I'm building a CNN to make a binary classification (1 or zero). For this I'm using the cost function sigmoid_cross_entropy_with_logits. But for some reason the ...
0
votes
0answers
6 views

The Meaning Behind the Cross Validation Score in Factor Analysis

In order to choose the best number of underlying factors for my data using factor analysis, I decided to use the tutorial outlined in scikit-learn's documentation. Running ...
0
votes
0answers
18 views

How to change a field in a Dataframe based on the values in another Dataframe in python [migrated]

A change at work has meant that our old department numbers will no longer be used and we will be using new department numbers in the next month. However; we still need to keep track of the old ...
0
votes
1answer
13 views

Keras backend function equivalent for str.format [on hold]

How to perform the following function using Keras backend? "{0:b}".format(37)
0
votes
0answers
9 views

anaconda navigator getting stuck at loading applications [migrated]

I have installed Anaconda on my Desktop running Ubuntu 18 Mate LTS. The output of python --version is ...
1
vote
1answer
22 views

How to give rewards to actions in RL?

I'm working on below reinforcement learning problem: I have bottle of fix capacity (say 5 liters). At the bottom of bottle there is cock to remove water. The distribution of removal of water is not ...
2
votes
1answer
30 views

NLP - How to perform semantic analysis?

I'd like to perform a textual/sentiment analysis. I was able to analyse samples with 3 labels: (positive, neutral, negative) and I used algorithms such as SVM, ...
0
votes
0answers
26 views

Timeseries sensor data for one process regression modeling

The dataset: I have a dataset containing the data of a manufactoring process. The dataset contains the process ID ("Sarzs_no"), the ID of the manufactoring machine ("Unit"), the data logged by two ...
1
vote
0answers
12 views

K-fold cross validation when using fit_generator and flow_from_directory() in Keras

I am using flow_from_directory() and fit_generator in my deep learning model, and I want to use cross validation method to train ...
1
vote
1answer
23 views

How to add noise to supervised (binary-classifier)?

Note: The question is not about validating/testing a trained model. Say i have an unlabeled features set, I want to approximate the true labels (for the sake of argument lets assume it's a binary ...
0
votes
0answers
31 views

Tensorflow deep learning Weird Accuracy

I want to build a model to classify images of a dataset( ASL signs alphabet ). The dataset is in a folder where each sub-folder contains the images of a class and the name of the class is the name ...
-1
votes
0answers
18 views

Trying to determine the best imputation method to use for missing data

Hi so I'm trying to find the best imputation method for my data. I have a very large dataset comprised of mostly questionnaires. I want to ultimately run it through a DNN. However before I do that I ...
1
vote
0answers
20 views

How to plot a heatmap-like plot for categorical features?

I would greatly appreciate let me know how to plot a heatmap-like plot for categorical features? In fact, based on this post, the association between categorical ...
-2
votes
0answers
8 views

What information can be extracted from a homepage as features for detecting phishing websites?

I want to detect Phishing Websites using different Methods. But first I have to collect data, like for example the HTTP Header, or the HTML-Code. My Question is, what features can still be extracted ...
0
votes
1answer
18 views

How can I find anomalies in each row of data?

I have some reported data I want to spot anomalies on. The columns are a facility name then monthly reports of that given facility. ...
0
votes
0answers
8 views

How choosing a value for random_state argument in sklearn.model_selection works?

I have been using sklearn for quite some time and I understand using the same number say 100 or 200 as a value for the ...
0
votes
0answers
24 views

Time Series prediction with multiple features in input data

Assume we have a time-series data that contains the daily orders count of last two years: We can predict the future's orders using Python's statsmodel library: ...
0
votes
1answer
15 views

Invalid Argument Error when running simple Convolutional Neural Network

I am running a convolutional neural network with CSV files as training and test input. I am getting a strange error that I cannot solve. ...
0
votes
1answer
18 views

how to save deep learning model and test it after training?

I have a CNN model written using tensorflow for python, the model is for classifying lung CT images (cancer/no-cancer), after training the model with training and validation data and get a reasonable ...
-1
votes
2answers
17 views

two dimensional list takes huge amount of memory

I have a 2d list which is created from lung CT image data and a label (the first item is a 3d array(image data) and the second item is a label(0 or 1)), I need this to data to train CNN model, the ...
0
votes
0answers
8 views
0
votes
1answer
29 views

using unsupervised learning algorithms on images

I am working on a project to classify images of types of cloth (shirt, tshirt, pant etc). While this is a standard supervised classification problem, the accuracy of the neural network is not good. ...
0
votes
0answers
14 views

Scorecard in R/Python, save in PMML format

Does anyone know how to build a Scorecard model in R/Python? and save it in PMML format? Is there any popular implementation in R/Python (or some other language)? Please feel free to respond even ...
1
vote
0answers
13 views

Linear approximation of the given equation with python3 [on hold]

I was given a set of raw datum and have to model it by means of some machine learning techniques. After some research, I decided to do with the method of linear approximation. Description of the ...
1
vote
1answer
33 views

Plotting in Multiple Linear Regression in Python 3

So I'm working on linear regression. So far I've managed to plot in linear regression, but currently I'm on Multiple Linear Regression and I couldn't manage to plot it, I can get some results if I ...
1
vote
0answers
19 views

same model gives different values

I built a MLP for classification problem. I used KDD99 dataset. but the problem is that when I run it it gives ech time a different value of accuracy. Is this logic? I mean could the same model for ...
0
votes
1answer
31 views

How to implement feature selection for categorical variables (especially with many categories)?

I've been trying to get some ideas of how I could treat categorical variables when doing feature selection. Mainly I've been running Random Forest feature importance on Python for which preprocessing ...
0
votes
1answer
23 views

How to verify hand written signature?

I trying to create a model for determining whether a questioned hand written signature matches known signature samples, and predict if the signature is genuine or forgeries. I'm guessing I'll have to ...
0
votes
1answer
29 views

Dataframe looks the same but the structure is different when loop

I am generating a dataframe from a JSON file, this JSON file can come from 2 different sources, so the internal structure is slightly different, so what I am doing is first detecting the source and ...
0
votes
1answer
8 views

is numpy isclose function returning bad answer?

Using numpy isclose in the following example: import numpy as np np.isclose(1533761040,1533748023.0, atol=1) Returns True, which is False.
1
vote
0answers
7 views

how to improve searching index in dataframe

Given a pandas dataframe with a timestamp index, sorted. I have a label and I need to find the closest index to that label. Also, I need to find a smaller timestamp, so the search should be computed ...
1
vote
2answers
14 views

Setting batch size: training requires twice as much memory as validating

I am using Keras with a Tensorflow backend to train an Image Classification model on a GPU. I have read somewhere that training uses roughly twice (both forward and back props) the GPU memory of ...
1
vote
1answer
16 views

sklearn nmf - question about its use

This is a complete noob question, I'm new to Python, and I understand the basics of NMF, but when implementing it in sklearn it seems a bit convoluted and I wanted to ask whether anyone knows how to ...
1
vote
1answer
9 views

ImportError: cannot import name 'StanfordCoreNLPParser'

I've been trying to extract subject-predicate-object triples from sentences and found this awesome API that did just that. However, when it was written, it used the ...
3
votes
1answer
9 views

HMMLearn Predict Next Observed Event

From my understanding you can use the transition matrix to predict the probability of going from the last predicted hidden state(state t), to the t+1 hidden state. My confusion is how in code format ...
1
vote
0answers
10 views

Multiprocessing in KNIME Python Nodes possible?

I am wondering if it is possible to enable multiprocessing in KNIME Python nodes? This is not working: ...
-1
votes
0answers
18 views

Does feature occurrences affect feature importance

Let’s say we have a data frame that looks like this: Df: A B 0 45 78 1 5 34 2 3 0 3 56 0 4 34 0 5 23 0 Does the fact that we have more values ...
0
votes
0answers
10 views

Implementing triplet loss for an arbitrarily large number of class

I'm trying to implement a triplet loss for a large number of class. I've checked out a few of its implementations in PyTorch. However, they are usually used for datasets with a limited number of ...