GUI and Desktop Applications
int64
0
1
A_Id
int64
5.3k
72.5M
Networking and APIs
int64
0
1
Python Basics and Environment
int64
0
1
Other
int64
0
1
Database and SQL
int64
0
1
Available Count
int64
1
13
is_accepted
bool
2 classes
Q_Score
int64
0
1.72k
CreationDate
stringlengths
23
23
Users Score
int64
-11
327
AnswerCount
int64
1
31
System Administration and DevOps
int64
0
1
Title
stringlengths
15
149
Q_Id
int64
5.14k
60M
Score
float64
-1
1.2
Tags
stringlengths
6
90
Answer
stringlengths
18
5.54k
Question
stringlengths
49
9.42k
Web Development
int64
0
1
Data Science and Machine Learning
int64
1
1
ViewCount
int64
7
3.27M
0
55,568,832
0
0
0
0
1
false
0
2019-01-21T00:41:00.000
0
2
0
Can I use tensor flow GPU without a graphics card? Outsource training to AWS/Cloud?
54,282,272
0
python,amazon-web-services,tensorflow,google-cloud-platform,gpu
Use Kaggle kernel to run and save the file in system thats a easy and smart way out.
Background I have a school project that has this specific item I want to construct an object detector for. I was planning on making a custom dataset, labeling the image, and then using tensorflow to train my classifier. I was reading an article and it said if I didn't have a gpu with 2GB or more it would be better to t...
0
1
78
0
54,288,478
0
0
0
0
1
false
0
2019-01-21T10:54:00.000
1
1
0
Classifier for time based data to binary label
54,288,421
0.197375
python,machine-learning,neural-network,recurrent-neural-network
Yes it definitely is feasible and also very common. Search for any document classification tasks (e.g. sentiment) for examples of this kind of tasks.
I have access to a dataframe of 100 persons and how they performed on a certain motion test. This frame contains about 25,000 rows per person since the performance of this person is kept track of (approximately) each centisecond (10^-2). We want to use this data to predict a binary y-label, that is to say, if someone h...
0
1
37
0
54,296,537
0
1
0
0
1
false
0
2019-01-21T19:15:00.000
3
3
0
importing numpy in different python versions
54,296,469
0.197375
python,numpy
You can install numpy in python3 with help of pip3 command instead of pip. Yes you should change python3 as default as python2 support is going to end this year.
I have a problem with importing numpy for python3, I'm new in coding and followed all steps. I want to import numpy in python3 but not in python2 which is set by defaultn my mac mojave 10.14.2. I have Python 2.7.10 by default on my mac and can switch now to Python 3.7.2 in shell. I installed pip 18.1 as described in P...
0
1
876
0
54,297,972
0
0
0
0
1
false
0
2019-01-21T21:11:00.000
0
1
0
AttributeError: no attribute 'shape'
54,297,834
0
python
Just to give some advice. You could/should describe your problem a bit more clear. I just Googled the file you mentioned yolo_opencsv.py and its part of Object detection (YOLO, SSD, Faster R-CNN) with OpenCV and Python library. It always a good idea to mention the tool/library you are using (and are having problems wit...
When i run the coding in this yolo_opencv.py file : The console shows this error: File "", line 40, in Width = image.shape[1] AttributeError: 'NoneType' object has no attribute 'shape'
0
1
2,273
0
54,303,388
0
0
0
0
1
false
0
2019-01-21T21:13:00.000
0
3
0
Persistent Machine Learning
54,297,846
0
python,machine-learning
Use python pickle library to dump your trained model on your hard drive and load model and test for persistent results.
I have a super basic machine learning question. I've been working through various tutorials and online classes on machine learning and the various techniques to learning how to use it, but what I'm not seeing is the persistent application piece. So, for example, I train a network to recognize what a garden gnome looks ...
0
1
309
0
54,324,410
0
0
0
0
1
false
1
2019-01-23T09:38:00.000
0
1
0
Python to java image proccesing translation
54,324,148
0
java,python,tensorflow,image-processing,keras
Tensorflow themselves say: Caution: The TensorFlow Java API is not covered by the TensorFlow API stability guarantees. This however doesn't mean that your application will not be stable. The key take-away here is that whatever you will build is not guaranteed to work out of the box when new versions are released. ...
I have some Python image processing code that uses Keras and TensorFlow Libs, which is needed to be converted to Java Framework. My main problems are: a. TensorFlow for java is not stable yet, so I have to find another equivalent Java Lib. b. I haven't found Java image processing library that covers the Keras image pr...
1
1
63
0
54,325,913
0
1
0
0
1
false
0
2019-01-23T11:08:00.000
-1
1
0
Is it possible to write large numbers with spaces in the code
54,325,854
-0.197375
python
You can try writing your number in a scientific-style way? Like 1e6 instead of 1000000 or 1,000,000...
I'm trying to run a Monte-Carlo control algorithm, and keep getting frustrated when setting the number of steps in the code. It needs to be a large number (thousands, millions...) and it is hard to read it at a glance so I need to count zeros whenever I change it. I tried entering it as N_EPISODES = 1 000 000 or N_E...
0
1
459
0
54,328,218
0
1
0
0
1
false
0
2019-01-23T13:14:00.000
2
2
0
How to save (write) a list of images from a dataset into a new folder - openCV Python?
54,328,126
0.197375
python,opencv,computer-vision
Assuming you have OpenCV correctly installed on your machine, you can first read the images with img = cv.imread(filename) and then write them with cv.imwrite(filename, img).
I'm so much newbie in openCV/Python tasks. I use Python 3.7 and openCV 4 running by a JNotebook. The question: I wanna save just 1,000 images from a dataset with 10,000 pictures, extracting them from it and write only those 1,000.jpeg in a new folder, is it possible using openCV package in Python? I've already had a li...
0
1
3,167
0
54,338,545
0
0
0
0
1
false
0
2019-01-24T02:02:00.000
0
1
0
What does it mean to use K-means clustering on a data set that indicates relative distances from one item to another?
54,338,377
0
python
K-means clustering assigns items to clusters such that the total intra-cluster distance is minimized. Hence, the only input that is needed is a distance function d(a,b). Often, the items are vectors in a normed vector space and d is chosen as d(a,b) = ||a-b|| for some norm ||x||. But in general, any distance function t...
what does it mean to use K-means clustering on a data set that indicates relative distances from one item to another? For example, each item is given a relative distance to every other item.
0
1
26
0
54,392,629
0
1
0
0
1
true
0
2019-01-24T06:26:00.000
1
2
0
I have installed pandas_datareader in pip but when I try to import the same in Jupyter Notebook it says Module not found
54,340,532
1.2
python,jupyter-notebook
I could resolve this, I went to my venv and executed this command: python -m pip install ipykernel and then upgraded pip and it started working. Thank you, Mohit
(py1) C:\Users\XXXXX>pip list Version ----------------- ---------- certifi 2018.11.29 chardet 3.0.4 idna 2.8 lxml 4.3.0 numpy 1.16.0 pandas 0.23.4 pandas-datareader 0.7.0 ...
0
1
546
0
58,307,961
0
0
0
0
1
false
0
2019-01-24T08:33:00.000
0
2
0
Calculate Imbalance Ratio for a multi-class dataset
54,342,353
0
python,dataset,data-mining,data-science
IR = (negative_class/positive_class) Where positive_class is the number of minority class samples and negative_class is the number of majority class samples.
How can i calculate Imbalance Ratio for a dataset which is imbalanced? I came across a way in which it defined (it's taken from a paper): given by the imbalance ratio (IR), defined as the ratio of the number of instances in the majority class to the number of examples in the minority class Now, is this one of the rig...
0
1
1,656
0
54,351,092
0
0
0
0
1
false
1
2019-01-24T09:40:00.000
1
1
0
How to install coco dataset in colab?
54,343,491
0.197375
python,google-colaboratory
I suspect you need a leading / in your path. (Typically, the Drive FUSE mount path is /content/...)
I have coco dataset(19 gb), the dataset upload googledrive but colab is not find this data despite use this code import sys sys.path.insert(0, 'content/gdrive/My Drive/caption').How can I find this file? import sys sys.path.insert(0, 'content/gdrive/My Drive/caption')
0
1
1,305
0
69,872,171
0
0
0
0
4
false
16
2019-01-24T10:11:00.000
0
5
0
Why does my google colab session keep crashing?
54,344,101
0
python,data-visualization,google-colaboratory
I would first suggest closing your browser and restarting the notebook. Look at the run time logs and check to see if cuda is mentioned anywhere. If not then do a factory runtime reset and run the notebook. Check your logs again and you should find cuda somewhere there.
I am using google colab on a dataset with 4 million rows and 29 columns. When I run the statement sns.heatmap(dataset.isnull()) it runs for some time but after a while the session crashes and the instance restarts. It has been happening a lot and I till now haven't really seen an output. What can be the possible reason...
0
1
32,699
0
69,688,669
0
0
0
0
4
false
16
2019-01-24T10:11:00.000
2
5
0
Why does my google colab session keep crashing?
54,344,101
0.07983
python,data-visualization,google-colaboratory
This error mostly comes if you enable the GPU but do not using it. Change your runtime type to "None". You will not face this issue again.
I am using google colab on a dataset with 4 million rows and 29 columns. When I run the statement sns.heatmap(dataset.isnull()) it runs for some time but after a while the session crashes and the instance restarts. It has been happening a lot and I till now haven't really seen an output. What can be the possible reason...
0
1
32,699
0
63,649,402
0
0
0
0
4
false
16
2019-01-24T10:11:00.000
0
5
0
Why does my google colab session keep crashing?
54,344,101
0
python,data-visualization,google-colaboratory
For me, passing specific arguments to the tfms augmentation failed the dataloader and crahed the session. Wasted lot of time checking the images not coruppt and clean the gc and more...
I am using google colab on a dataset with 4 million rows and 29 columns. When I run the statement sns.heatmap(dataset.isnull()) it runs for some time but after a while the session crashes and the instance restarts. It has been happening a lot and I till now haven't really seen an output. What can be the possible reason...
0
1
32,699
0
61,336,224
0
0
0
0
4
false
16
2019-01-24T10:11:00.000
5
5
0
Why does my google colab session keep crashing?
54,344,101
0.197375
python,data-visualization,google-colaboratory
Another cause - if you're using PyTorch and assign your model to the GPU, but don't assign an internal tensor to the GPU (e.g. a hidden layer).
I am using google colab on a dataset with 4 million rows and 29 columns. When I run the statement sns.heatmap(dataset.isnull()) it runs for some time but after a while the session crashes and the instance restarts. It has been happening a lot and I till now haven't really seen an output. What can be the possible reason...
0
1
32,699
0
54,346,332
0
0
0
0
1
false
0
2019-01-24T11:28:00.000
2
2
0
Scikit-Learn Random Forest regression: mix two sets of true values (y)
54,345,579
0.197375
python,scikit-learn,random-forest
The problem is that an algorithm alone doesn't know which label is better. What you could do: Train a classifier on data which you know is correct. Use the clasifier to predcit a value for each datapoint. Compare this value to the two list of labels which you already have and choose the label which is closer. This so...
I am training Random Forests with two sets of "true" y values (empirical). I can easy tell which one is better. However, I was wondering if there is a simple method, other than brute force, to pick up the values from each set that would produce the best model. In other words, I would like to automatically mix both y se...
0
1
314
0
54,356,646
0
0
0
0
2
false
0
2019-01-24T15:26:00.000
0
3
0
How to Measure the difference between features in dataframe?
54,350,062
0
python,machine-learning,statistics,data-mining,feature-selection
Can you try to use KS-test for your features? for example, feature 1, split by it's class. then you get two groups. Then test if they come from different distribution or just record the p-value. when you have all the test result or p-value, make another model with the samples that comes from different distribution / ve...
I have a dataframe with around 20000 rows and 98 features (all the features are numerical) and a target feature with binary values: 0 and 1. Basically, there are two population (first population with target value 1 --50%--, and the second with target value 0 -50%- balanced data). In a classification problem, I tried to...
0
1
203
0
54,350,594
0
0
0
0
2
false
0
2019-01-24T15:26:00.000
0
3
0
How to Measure the difference between features in dataframe?
54,350,062
0
python,machine-learning,statistics,data-mining,feature-selection
Aside from using the coefficients of the support vectors from your model, you could try build other models. A decision tree approach will explicitly show you which input features split the data - those nearer the root being more important, for some definition of important. If you try a feature reduction technique, like...
I have a dataframe with around 20000 rows and 98 features (all the features are numerical) and a target feature with binary values: 0 and 1. Basically, there are two population (first population with target value 1 --50%--, and the second with target value 0 -50%- balanced data). In a classification problem, I tried to...
0
1
203
0
54,350,414
0
0
0
0
1
false
0
2019-01-24T15:38:00.000
0
2
0
Smart way to detect too far away point from a row of points?
54,350,293
0
python,math,row,geospatial,point
try arcgis. build two new attributes in arcgis with their X and Y coordinate,then calculate the distance between the points you want
I'm working on a python script whose goal is to detect if a point is out of a row of points (gps statement from an agricultural machine). Input data are shapefile and I use Geopandas library for all geotreatments. My first idea was to make a buffer around the 2 points around considered point. After that, I watch if my...
0
1
136
0
54,363,252
0
0
0
0
1
true
0
2019-01-25T09:21:00.000
1
1
0
Predicting values using trained MNB Classifier
54,362,232
1.2
python,python-3.x,classification,sentiment-analysis
I don't know the dataset and what is semantic of individual dictionaries, but you are training your model on a dataset which has form as follows: [[{"word":True, "word2": False}, 'neg'], [{"word":True, "word2": False}, 'pos']] That means your input is in form of a dictionary, and output in form of 'neg' label. If you ...
I am trying to train a model for sentiment analysis and below is my trained Multinomial Naive Bayes Classifier returning an accuracy of 84%. I have been unable to figure out how to use the trained model to predict the sentiment of a sentence. For example, I now want to use the trained model to predict the sentiment of ...
0
1
119
0
54,380,618
0
1
0
0
1
false
1
2019-01-25T17:25:00.000
1
1
0
Device memory array's life time
54,370,090
0.197375
python,cuda,gpgpu,numba
What is the lifetime of a device array and an array that is copied to GPU memory? Are their value preserved from one kernel call to another? In Numba, global memory allocations are preserved until they are freed. Do I need to put the device arrays definitions inside the loop (before I call the kernel) or do I ju...
I have a cuda kernel written in numba-cuda that processes large arrays that do not fit in GPU memory at once. So, I have to call the kernel multiple times to process the entire arrays. The kernel is called in a loop and, inside the loop, after GPU is done the computation, I copy and aggregate the results back to a host...
0
1
476
0
54,374,671
0
0
0
0
1
false
0
2019-01-26T00:38:00.000
0
2
0
Keras LSTM Paradigm
54,374,608
0
python,keras,lstm,recurrent-neural-network
I'm not sure, but your batch_size could be set automatically, time_steps is equal to number of feature sets so for [[0.4, 0.8, -1]] its 1 for [[0.4, 0.8, -1],[1, 1.6, -0.2]] its 2 etc. Try to reshape your data to (shape[0],3).
I have a single time series that has multiple input features and a single output (classification). I would like to create a model that would predict the output at every step. My data looks like this: x: [[0.4, 0.8, -1], [1, 1.6, -0.2], ....] y: [[1], [0], ...] So when given a single feature vector, I would like my mode...
0
1
108
0
54,446,294
0
0
0
0
1
false
0
2019-01-26T01:26:00.000
0
1
0
Understanding "PREDICT" function output in python lightGBM implementation
54,374,866
0
python-3.x,predict,lightgbm
Suppose that you are doing regression from X ϵ Rn to y ϵ R1. For a given point, x, You can view the model prediction f(x) as a linear function of the feature contributions such as : f(x) = contribution(x1) + contribution (x2) + ... + contribution(xn) + mean(y) The first n columns of your array correspond to the contrib...
When using the Python PREDICT method in lightGBM with predict_contrib = TRUE, I get an array of [n_samples, n_features +1]. What does the n_feature+1 correspond to? I thought first that it could be the log odds of class 1 but the value does not correspond to the right probability.
0
1
862
0
54,376,403
0
0
0
0
1
false
55
2019-01-26T01:39:00.000
34
10
0
How to fix this strange error: "RuntimeError: CUDA error: out of memory"
54,374,935
1
python,pytorch
The error occurs because you ran out of memory on your GPU. One way to solve it is to reduce the batch size until your code runs without this error.
I successfully trained the network but got this error during validation: RuntimeError: CUDA error: out of memory
0
1
201,166
0
63,150,254
0
0
0
0
1
false
1
2019-01-26T08:40:00.000
2
2
0
OpenCV2 createBackgroundSubtractorMOG Attribute not found
54,376,883
0.197375
python-3.x,opencv,background-subtraction
there are two subtraction packages in opencv. BackgroundSubtractorMOG() it's at cv2.bgsegm.BackgroundSubtractorMOG(),to use you must install opencv-contrib-python
I am using cv2 version 4.0.0 and python version 3.7.2. I am trying to subtract Background using this method cv2.createBackgroundSubtractorMOG2() and its working well. But when I use cv2.createBackgroundSubtractorMOG() its not working its showing me AttributeError: module 'cv2.cv2' has no attribute 'createBackground...
0
1
3,478
0
54,395,217
0
0
1
0
1
true
1
2019-01-26T14:10:00.000
0
1
0
Calculating the trace of a large sparse matrix
54,379,162
1.2
python,c++,scipy
The solution was as simple as: np.array(Mat.diagonal()).sum() Thanks @hpaulj !
I have a sparse large matrix (linear dimension of 2*10^6) for which I want to calculate its trace. Calculating it brute force takes 16 seconds to access each diagonal element (hence I could do it in a YEAR!). I was thinking of saving it to the disk using scipy.io.mmwrite and reading it with a c++ code which should be ...
0
1
476
0
54,387,971
0
0
0
0
1
true
1
2019-01-27T11:55:00.000
1
1
0
How to approach variable image sizes for Image Classification?
54,387,850
1.2
python,image-processing,machine-learning,classification,multiclass-classification
The common approach is to crop the tumor on each image. You will obtain different tumor image size. Then rescale the tumor images to the smallest one. Choose wisely the resampling technic for the rescale depending on the algorithm you will use for classification. The fastest one would be nearest neighborhood resampling...
I am working on classification of brain tumors. The dataset is comprised of brain images from various angles, with a border and mask of the tumor position. I have cropped the rectangle that contains the tumor, as the other parts of the image are irrelevant and vary due to the different angles from which the image is ta...
0
1
236
0
54,405,935
0
0
0
0
1
true
0
2019-01-28T15:21:00.000
2
1
0
Why can't I apply sort_values to a dataframe more than once?
54,405,063
1.2
python,pandas,data-analysis
When you use .sort_values(['a', 'b']) you are first sorting the dataframe by the column a, and then within those sortings, sorting by b. Think of it almost as grouping by the first sort, then sorting within those groupings. If there was a c, it would sort the c column within the a b groups. If you do .sort_values('a')....
Say for example I have a multi-column dataframe. I want to arrange my data by sorting column a ascending first, then by column b ascending also. I am able to achieve this by the ff. code: df.sort_values(['b','a']). Note the reversed order of the arguments. My question is, why doesn't df.sort_values('a').sort_values('b'...
0
1
78
0
54,614,230
0
0
0
0
1
true
1
2019-01-28T21:49:00.000
1
1
0
Mac OS (Mojave) - Pycharm backend : TkAgg not working, graphs are blank
54,410,776
1.2
python-3.x,matplotlib,backend
if you use virtualenv in Mojave, you have to install matplotliv (v1.3.1) at virtualenv. ** NOT VERSION 2.2.3 **. so, try the below command (btw, in your code, 'TkAgg' is needless): $pip install --no-cache-dir matplotlib==1.3.1 everything will be fine.
I am fairly new to python (and Stackflow) so apologies if this is a repost. I am currently run Pycharm on my iMac (with Mac OS Mojave), python install from Anaconda. I am having some issues with Matplotlib as everytime I plot a graph I don't see anything. The backend currently uses TkAgg. I googled the issue and came ...
0
1
1,210
0
54,411,400
0
1
0
0
1
false
0
2019-01-28T22:44:00.000
1
3
0
Extracting a date at the end of a pandas dataframe
54,411,374
0.066568
python,string,pandas,datetime,dataframe
row.split(", ")[-1] is the string 23/09/2012, now you can use the date module to extract that into a Date object. And use try/except for error handling.
I have a column of data that is in the following format: bla bla bla, bla bla bla, bla bla bla, bla bla bla bla bla bla, 23/09/2012 Is there an easy way to extract the date at the end of the string from all rows? It is in the same DD/MM/YYYY format every time. I could split on the last , but it would be good if I could...
0
1
96
0
61,452,667
0
1
0
0
1
false
4
2019-01-29T16:22:00.000
0
4
0
Disabling Downloads on Jupyter Notebooks
54,425,431
0
python,security,jupyter
I have achieved this by putting Jupyter Hub behind ALB (Application load balancer), AWS and have a rule that basically routes every request with path "/files" to a 503 error page. This can even be achieved using nginx as well. Just to bear that in mind, the download request path is "/files".
My goal is to disable the downloading of csv data from my JupyterHub environment. Is there any way to do this?
0
1
3,699
0
54,437,112
0
1
0
0
1
false
0
2019-01-30T06:21:00.000
0
1
0
with python 3.6, Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
54,434,432
0
tensorflow,pip,installation,python-3.6
if you have anaconda do conda install tensorflow. anaconda version of tensorflow is faster than pip anyways.
C:\WINDOWS\system32>pip install tensorflow Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow I installed the Python (3.6 64-bit), and wanna install tensorflow in Anaconda3. And I upgraded pip to the latest versio...
0
1
450
0
54,451,861
0
0
0
0
1
false
0
2019-01-30T19:13:00.000
1
1
0
How to use NLTK DependencyGrammar package In NER
54,447,937
0.197375
python,nlp,nltk
NER algorithms are normally trained to recognize well known enities such as places,names etc. P1234U does not fall into any of the well known categories. I would suggest a simple regex search with constraints on max length of the invoice id and check the accuracy on that.
How to use NLTK DependencyGrammar package in Named Entity Recognition (NER)? Eg. sentence that I am looking is: “what is the status of my invoice P1234U?” And I would like to extract P1234U as the invoice number. Without much training I would like to do this, so no SPACY solution please. I would prefer to go in a knowl...
0
1
68
0
54,451,152
0
0
0
0
1
false
0
2019-01-30T22:26:00.000
0
2
0
Apply KNN from small supervised dataset to large unsupervised dataset in Python
54,450,495
0
python,scikit-learn,knn
In machine learning there are two broad types of learners, namely eager learners (Decision trees, neural nets, svms...) and lazy learners such as KNN. In fact, KNN doesn't do any learning at all. It just stores the "labeled" data you have and then uses it to perform inference such that it computes how similar the new s...
I have trained and tested a KNN model on a small supervised dataset of about 200 samples in Python. I would like to apply these results to a much larger unsupervised dataset of several thousand samples. My question is: is there a way to fit the KNN model using the small supervised dataset, and then change the K-value f...
0
1
388
0
54,996,195
0
1
0
0
1
true
2
2019-01-31T02:48:00.000
1
1
0
Jupyter: How can you pretty-print many data frames from the code in one cell?
54,452,598
1.2
python,pandas,jupyter,pretty-print
As mentioned in the comment, using display instead of print does the job.
When you run a function that returns a Pandas data frame in a Jupyter cell, it prints out this very aesthetic table. When you give an explicit command to print, it looks much worse. I have a list of data frames and I'd like to print each. Is there a way to get the nice version of the print using a for-loop?
0
1
176
0
54,469,052
0
1
0
0
1
false
4
2019-01-31T19:59:00.000
0
5
0
Sort dict by key and retrieve value
54,468,377
0
python,python-3.x,sorting,dictionary
Another approach would be to create a generator object yielding the values of the dict, cast them to a list and then print it. print(list(val for val in scores.values()))
Given scores = { 0.0: "bob", 5.2: "alex", 2.8: "carl"} To get the output [ "bob", "carl", "alex" ] I can do print([ scores[key] for key in sorted(scores.keys()) ]) Is this the best (most "pythonic") way? I was thinking I could use scores.items() in conjunction with sorted(key=...) to avoid the dictionary lookup, but no...
0
1
928
0
54,469,054
0
0
0
0
1
false
0
2019-01-31T20:39:00.000
0
1
0
XGBOOST faster than random forest?
54,468,877
0
python-3.x,machine-learning
Mainly, the parameters you choose have strong impact in the speed of your algorithm, (e.g learning rate, depth of the tree, number of features etc.), there's a trade-off between accuracy and speed, so i suggest you put the parameters you've chosen for every model and see how to change it to get faster performance with ...
I am doing kaggle inclass challege of bosten hosing prices and learnt that XGBoost is faster than RandomForest but when implemented was slower.i Want to ask when XGBoost becomes faster and when RandomForest??.I am new to machine learning and need your help.Thanking in advance
0
1
1,525
0
54,469,843
0
1
0
0
1
false
6
2019-01-31T21:52:00.000
3
3
0
What does [i,:] mean in Python?
54,469,789
0.197375
python,python-3.x,numpy,scikit-learn,linear-regression
I guess you are also using numpy to manipulate data (as matrix) ? If based on numpy, ans[i,:] means to pick the ith 'row' of ans with all of its 'columns'. Note,when dealing with numpy arrays, we should (almost) always use [i, j] instead of [i][j]. This might be counter-intuitive if you used Python or Java to manipul...
So I'm finished one part of this assignment I have to do. There's only one part of the assignment that doesn't make any sense to me. I'm doing a LinearRegression model and according to others I need to apply ans[i,:] = y_poly at the very end, but I never got an answer as to why. Can someone please explain to me what ...
0
1
7,360
0
54,477,319
0
0
0
0
1
true
0
2019-02-01T00:17:00.000
0
1
0
Keras giving error "ModuleNotFoundError: No module named 'tensorflow'" even though tensorflow-gpu is installed
54,471,160
1.2
python,tensorflow,keras
I just reinstalled both tf and keras and now everything is working fine. Don't know what had went wrong. Maybe the installation was not proper first time.
I have tensorflow-gpu and keras installed in Python 3.6.8. But when I tried importing keras, it is giving the the error of Module not found. Also the error statements show the error is at a line inside keras at import tensorflow as tf. How to make keras import tensorflow-gpu instead of tensorflow? Do I have to go to th...
0
1
1,130
0
54,485,647
0
0
0
0
2
false
0
2019-02-01T09:06:00.000
0
4
0
Clustering structured data in Deep learning
54,476,162
0
python,deep-learning,cluster-analysis,data-science
Yes. If you do a little bit of literature research yourself you will find that people have repeatedly published clustering with deep neural networks. Except that it doesn't seem to work anywhere but on MNIST data...
Are there any Deep Learning literature/references where they performed clustering in structured data? I know it can be done using Kmeans, GMM etc. But is there any chance that cluster analysis to be done using Deep Neural Nets and the like? Thanks.
0
1
490
0
55,927,272
0
0
0
0
2
false
0
2019-02-01T09:06:00.000
0
4
0
Clustering structured data in Deep learning
54,476,162
0
python,deep-learning,cluster-analysis,data-science
Two other Potential Methods: KMeans + Autoencoder (a simple deep learning architecture with kmeans and reducing the dimensionality of the data using autoencoders). Deep Embedded Clustering algorithm (advanced deep learning)
Are there any Deep Learning literature/references where they performed clustering in structured data? I know it can be done using Kmeans, GMM etc. But is there any chance that cluster analysis to be done using Deep Neural Nets and the like? Thanks.
0
1
490
0
54,650,272
0
0
0
0
1
true
2
2019-02-01T10:12:00.000
0
1
0
AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' on using "from keras.utils import HDF5Matrix"
54,477,273
1.2
python,tensorflow,keras,hdf5
I got the solution. It was because I was importing both HDF5Matrix and tables in same program. Due to some reason both cannot be imported in same program. I think it is because both make use of h5py in backend, so importing both is causing some conflict.
I just reinstalled python into my system with all necessary modules. But when I run a program with the import statement from keras.utils import HDF5Matrix, it is giving attribute error. The place where the error is coming is: File "h5py\h5r.pxd", line 21, in init h5py._conv File "h5py\h5r.pyx", line 145, in init h5py...
0
1
3,723
0
54,485,609
0
0
0
0
1
false
0
2019-02-01T12:53:00.000
0
1
0
Clustering: if my features are all in 0-1 range do i still have to use standard scaling
54,479,965
0
python-3.x,cluster-analysis
You don't "have" to use either. Standard scaling as well as [0;1] scaling (which is not the same) are just two popular heuristics for weighting variables. Neither is "correct*. If you have a better reason to weight variables differently, you may as well just do that. Things don't get more "correct" by scaling. Reducing...
I am trying to run clustering algorithm on a dataset with 14 features. Of those features, except for one, every feature lies between 0 to 1. The remaining one feature is a continuous variable between 0 to 8000. Do i need to use the standard scaler on all the features or just this one feature ( 0 - 8000) before clusteri...
0
1
20
0
54,485,944
0
0
0
0
1
true
0
2019-02-01T19:12:00.000
1
1
0
PyTorch: Is there a way to store model in CPU ram, but run all operations on the GPU for large models?
54,485,815
1.2
python,gpu,cpu,pytorch
I do not believe this is possible. However, one easy work around would be to split you model into sections that will fit into gpu memory along with your batch input. Send the first part(s) of the model to gpu and calculate outputs Release the former part of the model from gpu memory, and send the next section of the ...
From what I see, most people seem to be initializing an entire model, and sending the whole thing to the GPU. But I have a neural net model that is too big to fit entirely on my GPU. Is it possible to keep the model saved in ram, but run all the operations on the GPU?
0
1
162
0
54,488,348
0
1
0
0
1
false
0
2019-02-01T23:10:00.000
0
1
0
Error when trying to import matplotlib: "import is not recognized as internal or external command"
54,488,308
0
python,anaconda
You are not running import matplotlib in a python interpreter. Run python.exe first
On my Anaconda navigator, matplotlib is installed however when I run import matplotlib it will give me an error message saying: "import is not recognized as internal or external command, operable program or batch file." Did I not download it? How do I check that I've successfully installed it?
0
1
323
0
54,777,333
0
0
0
0
1
false
0
2019-02-02T00:39:00.000
0
1
0
innerjoin between two large pandas dataframe using dask
54,488,890
0
python,pandas,distributed-computing,dask
You might try using smaller partitions. Recall that the memory use of joins depend on how many shared rows there are. Depending on your data the memory use of an output partition may be much larger than the memory use of your input partitions.
I have two large tables with one of them is relatively small ~8Million rows and one column. Other is large 173Million rows and one column. The index of the first data frame is IntervalIndex (eg (0,13], (13, 20], (20, 23], ...) and the second one is ordered numbers (1,2,3, ...). Both DataFrame are sorted so DF1 cat...
0
1
343
0
54,505,574
0
0
0
0
1
false
0
2019-02-02T02:41:00.000
0
2
0
Loading and using a trained TensorFlow model in Python
54,489,497
0
python,tensorflow
(Answering my own question) I realized that the easiest way to do this was to use the tf.estimator API. By initializing an estimator that warm starts from the model directory, it's possible to just call estimator.predict and pass the correct args (predict_fn) and get the predictions immediately. It's not required to de...
I trained a model in TensorFlow using the tf.estimator API, more specifically using tf.estimator.train_and_evaluate. I have the output directory of the training. How do I load my model from this and then use it? I have tried using the tf.train.Saver class by loading the most recent ckpt file and restoring the session. ...
0
1
215
0
54,490,809
0
0
0
0
2
false
0
2019-02-02T05:43:00.000
2
2
0
Finding corners of a polygon represented in a 2D array
54,490,347
0.197375
python
i have an idea about how u can make a function for this by your self. according to what i understand only the for corners can have more than one "0" next to it. if you take array[x,y] to be a point. array[x-1,y],array[x+1,y],array[x,y+1],array[x,y-1] are the 4 point close to it. you can make a loop to go through the a...
I have a 2D array of 0's and 1's where the 1's represent the edges and inside of a quadrilateral, and 0's are everything outside. What is the best way to find the coordinates of the four corners? I'm using Python so any libraries that can help are fine, but an algorithm in any language would be helpful as well.
0
1
815
0
54,490,817
0
0
0
0
2
true
0
2019-02-02T05:43:00.000
1
2
0
Finding corners of a polygon represented in a 2D array
54,490,347
1.2
python
In the absolutely general case (e.g. allowing for concave hulls or darn-near-triangular shapes) this will involve some uncertainty. But since you are dealing with a restricted subclass, it's easier. You might start with kernel convolution. Consider overlapping squares of (say) 3x3 pixels: you can design a function that...
I have a 2D array of 0's and 1's where the 1's represent the edges and inside of a quadrilateral, and 0's are everything outside. What is the best way to find the coordinates of the four corners? I'm using Python so any libraries that can help are fine, but an algorithm in any language would be helpful as well.
0
1
815
0
57,942,410
0
0
0
0
4
false
3
2019-02-02T15:59:00.000
4
6
0
How to set fixed step size with scipy.integrate?
54,494,770
0.132549
python,scipy,integrate,runge-kutta
Scipy.integrate is usually used with changeable step method by controlling the TOL(one step error) while integrating numerically. The TOL is usually computed by checking with another numerical method. For example RK45 uses the 5th order Runge-Kutta to check the TOL of the 4th order Runge-Kutta method to determine the i...
I am looking for a way to set a fixed step size for solving my initial value problem by Runge-Kutta method in Python. Accordingly, how I can tell the scipy.integrate.RK45 to keep a constant update (step size) for its integration procedure? Thank you very much.
0
1
5,393
0
64,495,201
0
0
0
0
4
false
3
2019-02-02T15:59:00.000
2
6
0
How to set fixed step size with scipy.integrate?
54,494,770
0.066568
python,scipy,integrate,runge-kutta
If you are interested in data-wise fix step size, then I highly recommend you to use the scipy.integrate.solve_ivp function and its t_eval argument. This function wraps up all of the scipy.integrate ode solvers in one function, thus you have to choose the method by giving value to its method argument. Fortunately, the ...
I am looking for a way to set a fixed step size for solving my initial value problem by Runge-Kutta method in Python. Accordingly, how I can tell the scipy.integrate.RK45 to keep a constant update (step size) for its integration procedure? Thank you very much.
0
1
5,393
0
64,773,397
0
0
0
0
4
false
3
2019-02-02T15:59:00.000
1
6
0
How to set fixed step size with scipy.integrate?
54,494,770
0.033321
python,scipy,integrate,runge-kutta
You've said you want a fixed-time step behaviour, not just a fixed evluation time step. Therefore, you have to "hack" your way through that if you not want to reimplement the solver yourself. Just set the integration tolerances atol and rtol to 1e90, and max_step and first_step to the value dt of the time step you want...
I am looking for a way to set a fixed step size for solving my initial value problem by Runge-Kutta method in Python. Accordingly, how I can tell the scipy.integrate.RK45 to keep a constant update (step size) for its integration procedure? Thank you very much.
0
1
5,393
0
66,190,287
0
0
0
0
4
false
3
2019-02-02T15:59:00.000
1
6
0
How to set fixed step size with scipy.integrate?
54,494,770
0.033321
python,scipy,integrate,runge-kutta
I suggest to write your own rk4 fixed step program in py. There are many internet examples to help. That guarantees that you know precisely how each value is being computed. Furthermore, there will normally be no 0/0 calculations and if so they will be easy to trace and prompt another look at the ode's being solved.
I am looking for a way to set a fixed step size for solving my initial value problem by Runge-Kutta method in Python. Accordingly, how I can tell the scipy.integrate.RK45 to keep a constant update (step size) for its integration procedure? Thank you very much.
0
1
5,393
0
54,509,633
0
0
0
0
1
false
0
2019-02-04T02:26:00.000
1
1
0
pandas read csv with extra commas and quotations in column
54,509,495
0.197375
python,pandas
Are you able to regenerate the csv? If yes, change the delimit character to a pipe, I.e | . If not, you may be forced to take the long route... because there is no way for any code to figure out which characters are delimiting/quoting and which are part of the value if you have both commas and quotes lurking inside the...
I'm reading a basic csv file where the columns are separated by commas. However, the body column is a string which may contain commas and quotations. For example, there are some cells like "Bahamas\", The" and "Germany, West" I have tried text = pd.read_table("input.txt", encoding = 'utf-16', quotechar='"', sep = ',')...
0
1
372
0
54,530,692
0
0
0
0
1
false
0
2019-02-04T13:19:00.000
0
2
0
SURF: How could we get the value of sigma from the keypoint radius
54,517,035
0
opencv,image-processing,computer-vision,surf,opencv-python
This value s = size*1.2f/9.0f is not montioned in the bay's article scale= L*0.4 or scale= L* 1.2/3 any one can explain me this part??
In the SURF technique, and more precisely within the feature description stage, the authors have stated (if I understand correctly) that the description will be performed in a area of 20 times sigma. Sigma represents the scale on which the keypoint was detected. Sigma = 0.4 x L where L = 2^Octave x level+1. If we use ...
0
1
95
0
54,541,372
0
0
0
0
1
false
0
2019-02-04T18:03:00.000
1
1
0
spark-submit --master local[n] cannot create multi-threads
54,521,867
0.197375
python,apache-spark,pyspark
Just find the problem: there is another user running his own spark task on the same instance which occupying resources.
I write pyspark code to deal with some spark-sql data. Last month, it worked perfectly when I ran spark-submit --master local[25]. From top command, I could see 25 python threads. However, nothing change but today the spark-submit only create one thread. I wonder what kind of things can cause such problem. This is on ...
0
1
68
0
54,809,376
0
0
0
0
1
true
0
2019-02-05T12:40:00.000
0
1
0
How to check learning feasibility on a binary classification problem with Hoeffding's inequality/VC dimension with Python?
54,534,664
1.2
python,machine-learning
Well here is how I handled it : I generate multiple train/test samples, run the algorithm on them, calculate Ein as the train set error, Eout estimated by the test set error, calculate how many times their differnces exceeds the value of epsilon (for a range of epsilons). And then I plot the curve of these rates of exc...
I have a simple binary classification problem, and I want to assess the learning feasibility using Hoeffding's Inequality and also if possible VC dimension. I understand the theory but, I am still stuck on how to implement it in Python. I understand that In-sample Error (Ein) is the training Error. Out of sample Error...
0
1
172
0
54,540,745
0
0
0
0
1
true
1
2019-02-05T18:17:00.000
1
1
0
Python: given a plane equation draw a subset of points that belong to it
54,540,676
1.2
python,matplotlib,linear-algebra,mplot3d
For a plane a simple approach that would work is pick a coefficient that's not 0 (let's suppose is c) pick random values for the other two coordinates (x and y in this case) compute z with (d - ax - by)/c
As the title say, let's assume I have a plane equation: ax+by+cz=d (e.g. -4x + 5y + 9z = -9) I want to draw n random points (let's say 500) that belong to that plane. Can somebody help me with that? I saw that from mpl_toolkits import mplot3d has the function plot_surface(x,y,z) but (as it says) it plots the surfa...
0
1
446
0
57,832,051
0
0
0
0
1
false
31
2019-02-05T22:54:00.000
0
6
0
Is it possible to do multivariate multi-step forecasting using FB Prophet?
54,544,285
0
python,machine-learning,time-series,forecasting,facebook-prophet
This might be late, however if you are reading this in 2019, you can implement multivariate time series using LSTM, Keras.
I'm working on a multivariate (100+ variables) multi-step (t1 to t30) forecasting problem where the time series frequency is every 1 minute. The problem requires to forecast one of the 100+ variables as target. I'm interested to know if it's possible to do it using FB Prophet's Python API. I was able to do it in a univ...
0
1
28,022
0
54,551,132
0
0
0
0
1
false
9
2019-02-06T08:25:00.000
15
2
0
convert Dataframe to 2d Array
54,549,284
1
python,dataframe,conv-neural-network,convolution
You just need to call .values on the DataFrame. If for example your dataframe is called df, then you can pass df.values to your convolutional neural network.
I have a data-frame of size (140000,22) dimensions. i have to create 2d array of equal dimensions to pass it into convolution neural network . Can you please guide how to transform on this dataframe
0
1
21,926
0
54,557,235
0
0
0
0
1
true
1
2019-02-06T15:27:00.000
2
3
0
Can accuracy_score and precision_score be equal?
54,557,082
1.2
python,scikit-learn,logistic-regression,sklearn-pandas
Precision = True Positive / (True Positive + False Positive) Accuracy = (True Positive + True Negative) / (True Positive + False Positive + True Negative + False Negative) Therefore, if there are no negative predictions, these two values will be equal.
I am trying to build a logistic regression model in python 3 using sklearn library. Let's stick to below short versions going forward, dv - dependent variable idv - independent variable Now I have idv1, idv2, idv3, idv4, idv5, idv6, idv7, idv8 & idv9. Out of which idv6 to idv9 are categorical variables (idv6 & idv7 ha...
0
1
780
0
56,294,966
0
0
0
0
1
false
0
2019-02-06T17:21:00.000
1
2
0
Python equivalent for MATLAB binofit
54,559,209
0.099668
python,python-2.7
I think the function you suggested is good enough. I ran some test comparing Matlab binofit and Python statsmodels.stats.proportion.proportion_confint. The test was empyrical like testin 100K experiments like [phat,pci] = binofit(x,n,alpha) with min_conf,max_conf = proportion_confint(x,n,alpha=alpha,method='beta'). The...
In MATLAB, binofit returns the maximum likelihood estimate of the success of binomial probability distribution and confidence intervals. statsmodels.stats.proportion.proportion_confint returns confidence intervals as well, but couldn't find a function for maximum likelihood estimate of the binomial probability distrib...
0
1
319
0
66,913,904
0
1
0
0
1
false
18
2019-02-06T17:41:00.000
0
6
0
How to change python version in Anaconda?
54,559,566
0
python,tensorflow,anaconda,jupyter-notebook,jupyter
You just can change the python version by creating a new environment in anaconda. It will ask for the python version when you create an environment
I am trying to get into deep learning. I installed Anaconda to use jupyter and generally not to care about installing all of those packages like matplotlib etc myself. But I cannot install tensorflow as it works only with Python 3.4, 3.5, or 3.6 but I have 3.7. After I read about it I installed python 3.6.8. I uninsta...
0
1
88,747
0
54,573,011
0
0
0
0
1
false
2
2019-02-07T04:21:00.000
1
2
0
How keras model H5 works in theory
54,566,249
0.099668
python,python-3.x,keras,deep-learning,conv-neural-network
When you save your model as h5-file, you save the model structure, all its parameters and further informations like state of your optimizer and so on. It is just an efficient way to save huge amounts of information. You could use json or xml file formats to do this as well. You can't classifiy anything only using this...
After training the trained model will be saved as H5 format. But I didn't know how that H5 file can be used as classifier to classifying new data. How H5 model works in theory when classifying new data?
0
1
1,209
0
54,581,374
0
0
0
0
1
true
1
2019-02-07T17:57:00.000
1
1
0
Is there a way to find the n most distant vectors in an array?
54,579,473
1.2
python,vector,cluster-analysis,doc2vec,dimensionality-reduction
Wouldn't a random sample from all vectors necessarily encounter any of the various 'regions' in the set? If there are "natural joints" and clusters to the documents, some clustering algorithm should be able to find the N clusters, then the smaller number of NxN distances between each cluster's centroid to each other c...
I have an array of thousands of doc2vec vectors with 90 dimensions. For my current purposes I would like to find a way to "sample" the different regions of this vector space, to get a sense of the diversity of the corpus. For example, I would like to partition my space into n regions, and get the most relevant word vec...
0
1
244
0
54,585,712
0
1
0
0
1
true
3
2019-02-08T03:38:00.000
9
1
0
How to reset Colab after the following CUDA error 'Cuda assert fails: device-side assert triggered'?
54,585,685
1.2
python,pytorch,google-colaboratory,tensor
You need to reset the Colab notebook. To run existing Pytorch modules that used to work before, you have to do the following: Go to 'Runtime' in the tool bar Click 'Restart and Run all' This will reset your CUDA assert and flush out the module so that you can have another shot at avoiding the error!
I'm running my Jupyter Notebook using Pytorch on Google Colab. After I received the 'Cuda assert fails: device-side assert triggered' I am unable to run any other code that uses my pytorch module. Does anyone know how to reset my code so that my Pytorch functions that were working before can still run? I've already tri...
0
1
11,545
0
54,720,270
0
0
0
0
1
false
0
2019-02-08T04:55:00.000
0
1
0
I´m trying to filter data of colums from a Data Frame, but the index names contain white spaces
54,586,159
0
python,pandas,filter,row,spaces
Hi everyone I found the solution. The problem with the method I used was it did not work when the index had spaces in the name so there is another way to get rid of the null values using the following structure: df1 = df[df["ColumnName With Spaces"].notnull()] From here you will filter all the rows in the "df" with ind...
I`m trying to filter the rows of a Data Frame, but since the index name of the column has white spaces, I've not been able to do it The DDTS Number is the name of the column It worked when there is no spaces data[data3.(DDTS Number) != null] I've tried different syntax but I don't if there is way to do it without to r...
0
1
36
0
54,623,195
0
0
0
0
1
true
1
2019-02-08T06:28:00.000
1
1
0
Why random_state parameter is used in NMF and LDA algorithm ? What are the benefits of using random topics generated every time?
54,587,051
1.2
python,lda,topic-modeling,nmf
The algorithms for both are stochastic - meaning they use randomness as a part of estimating a good answer. It's done that way to make it tractable, and in the case of LDA, the whole model is stochastic, providing you ideally with a probabilistic distribution (called "the posterior distribution") of answers, but instea...
For Topic Modelling , Why random_state parameter is used in NMF and LDA algorithm ? What are the benefits of using random topics generated every time ?
0
1
545
0
54,603,217
0
0
0
0
1
false
4
2019-02-09T02:31:00.000
3
1
0
Simplest way to index within a dimension
54,602,610
0.53705
python,tensorflow
Found it! tf.batch_gather and tf.batch_scatter.
I have two tensors x and y that have equal shape in the first k dimensions. The second tensor contains indices to retrieve values from the first along to the last dimension. For a rank of 3, then the output z should be such that z[i_1, i_2,...,i_k, j] = x[i_1, i_2,...,i_k, y[i_1, i_2, ...,i_k, j]]. I currently have a m...
0
1
46
0
54,608,871
0
0
0
0
1
false
0
2019-02-09T15:50:00.000
0
1
0
How to reach streaming learning in Neural network?
54,607,881
0
python,tensorflow,machine-learning
There is no some special function for it in TensorFlow. You make a single training pass over a new chunk of data. And then another training pass over another new chunk of data, etc till you reach the end of the data stream (which, hopefully, will never happen).
As title, I know there're some model supporting streaming learning like classification model. And the model has function partial_fit() Now I'm studying regression model like SVR and RF regressor...etc in scikit. But most of regression models doesn't support partial_fit . So I want to reach the same effect in neural net...
0
1
29
0
54,611,524
0
0
0
0
1
true
3
2019-02-09T18:33:00.000
8
1
0
Instance normalization and group normalization missing update
54,609,375
1.2
python,tensorflow
You should understand why does batch_norm need to add ops in UPDATE_OPS. tf.layers.batch_normalization function will generate four variables, namely gamma, beta, moving_mean and moving_variance, and only gamma, beta are in tf.GraphKeys.TRAINABLE_VARIABLES. When it is in the training phase, moving_mean and moving_varia...
In tensorflow, there is well-known batch normalization which adds the weights update ops to tf.GraphKeys.UPDATE_OPS. But in the case of instance normalization there is no update op added. When using tf.contrib.layer.batch_norm, I can specify the is_training parameter which adds the update op to collection. But for tf.c...
0
1
918
0
54,617,927
0
1
0
0
1
false
2
2019-02-10T15:10:00.000
0
2
0
dependent variable One hot encoder
54,617,771
0
python,machine-learning
OneHotEncoder will create k number of columns if there are k classes for a single variable. For example : it will create 2 variables if gender values in that dataset are Male/Female, It will create 3 Variables if gender values are male/Female/PreferNotToSay Now, You don't want multiple variables in your predicate y, S...
I am new to machine learning my question is: Do we need to encode dependent variable y if it contains three class segments 1,2,3 and I want to know if there is need to encode the dependent variable when it contains no
0
1
1,860
0
56,425,972
0
0
0
0
2
true
3
2019-02-11T05:44:00.000
6
2
0
Back-propagation and forward-propagation for 2 hidden layers in neural network
54,624,562
1.2
python,neural-network,deep-learning
● Let X be a matrix of samples with shape (n, d), where n denotes number of samples, and d denotes number of features. ● Let wh1 be the matrix of weights - of shape (d, h1) , and ● Let bh1 be the bias vector of shape (1, h1). You need the following steps for forward and backward propagations: ► FORWARD PROPAGATIO...
My question is about forward and backward propagation for deep neural networks when the number of hidden units is greater than 1. I know what I have to do if I have a single hidden layer. In case of a single hidden layer, if my input data X_train has n samples, with d number of features (i.e. X_train is a (n, d) dimen...
0
1
1,732
0
54,625,251
0
0
0
0
2
false
3
2019-02-11T05:44:00.000
1
2
0
Back-propagation and forward-propagation for 2 hidden layers in neural network
54,624,562
0.099668
python,neural-network,deep-learning
For Forward Propagation, the dimension of the output from the first hidden layer must cope up with the dimensions of the second input layer. As mentioned above, your input has dimension (n,d). The output from hidden layer1 will have a dimension of (n,h1). So the weights and bias for the second hidden layer must be (h1,...
My question is about forward and backward propagation for deep neural networks when the number of hidden units is greater than 1. I know what I have to do if I have a single hidden layer. In case of a single hidden layer, if my input data X_train has n samples, with d number of features (i.e. X_train is a (n, d) dimen...
0
1
1,732
0
54,629,669
0
0
0
0
2
true
3
2019-02-11T11:28:00.000
3
4
0
Fastest way in numpy to sum over upper triangular elements with the least memory
54,629,601
1.2
python,arrays,performance,numpy
You can replace np.diag(A).sum() with np.trace(A); this will not create the temporary Nx1 array
I need to perform a summation of the kind i<j on symmetric matrices. This is equivalent to sum over the upper triangular elements of a matrix, diagonal excluded. Given A a symmetric N x N array, the simplest solution is np.triu(A,1).sum() however I was wondering if faster methods exist that require less memory. It seem...
0
1
1,810
0
54,630,624
0
0
0
0
2
false
3
2019-02-11T11:28:00.000
1
4
0
Fastest way in numpy to sum over upper triangular elements with the least memory
54,629,601
0.049958
python,arrays,performance,numpy
The fastest method with the least memory, in pure numpy is going to be to sum the entire thing and subtract the diagonal. It may feel wasteful in terms of FLOPS, but note that the theoretical savings relative to that implementation are only a factor 2. If that means anything to you, you probably should not be using num...
I need to perform a summation of the kind i<j on symmetric matrices. This is equivalent to sum over the upper triangular elements of a matrix, diagonal excluded. Given A a symmetric N x N array, the simplest solution is np.triu(A,1).sum() however I was wondering if faster methods exist that require less memory. It seem...
0
1
1,810
0
54,661,633
0
0
0
0
1
true
4
2019-02-11T17:56:00.000
0
1
0
nlp multilabel classification tf vs tfidf
54,636,433
1.2
python,nlp,tf-idf,multilabel-classification,tfidfvectorizer
Tf method can give importance to common words more than necessary rather use Tfidf method which gives importance to words that are rare and unique in the particular document in the dataset. Also before selecting Kbest rather train on the whole set of features and then use feature importance to get the best features. Yo...
I am trying to solve an NLP multilabel classification problem. I have a huge amount of documents that should be classified into 29 categories. My approach to the problem was, after cleaning up the text, stop word removal, tokenizing etc., is to do the following: To create the features matrix I looked at the frequency ...
0
1
240
0
54,640,039
0
0
0
0
1
false
2
2019-02-11T22:14:00.000
1
2
0
Run a polynomial regression without combinations of the features
54,639,963
0.099668
python,scikit-learn,regression,polynomials,non-linear-regression
Tbh, this seems like very weird idea to me. A lot of strength of poly features come out of interaction features. I'm pretty sure there's nothing built-in, but you can take a look at PolynomialFeatures pre-processor, and make your own with modification. You'll need to "revert" logic of interaction_only parameter just b...
I am running a polynomial regression for order p. To make it simple, we use order p = 2 in this question. Suppose we have X with two feature x1, x2 and y. And I am trying to run a polynomial regression of y = ε + α + β1•x1 + β2•x2 + β3•x1^2 + β4•x2^2 I find that the sklearn have a sklearn.preprocessing.PolynomialFeatur...
0
1
843
0
54,641,758
0
1
0
0
1
false
1
2019-02-12T01:46:00.000
1
1
0
How can I convert .mat files to NumPy files in Python?
54,641,709
0.197375
python-3.x
I think you have two options to read it. Reading it in python: import scipy.io mat = scipy.io.loadmat('fileName.mat') Converting it to .csv in MATLAB in order to read it in python later: FileData = load('FileName.mat'); csvwrite('FileName.csv', FileData.M);
So I have a .mat file It is a little over 1 GB but I don't know how much data or lines of code is on it. I want to convert this .mat file to a NumPy file in Python so I can look at the data and see what is in it. How do I do this conversion?
0
1
3,092
0
54,647,401
0
0
0
0
1
false
0
2019-02-12T09:55:00.000
0
1
0
How to create a word2vector model from imdb dataset and get it's featuremap using CNN
54,647,276
0
python,nltk,word2vec,sentiment-analysis
If the size of your dataset is quite large you can easily employ Deep Learning to complete your project. First, you need to create a pipeline to convert your data into well representable form, and then feed into the model. And do not worry about computational costs if you are writing in TensorFlow, the Google Cloud TP...
I'm a newbie to python, i need to complete a project on IMDB Review sentiment analysis. I did not quiet understand how to train the imdb dataset aclImdb_v1.tar to a model. Please show me how to train a model from this dataset. Below is the method I need to implement for my project. Text Reviews -> Embedded Layer -> Wo...
0
1
84
0
54,650,088
0
0
0
0
1
true
1
2019-02-12T12:10:00.000
8
2
0
Does pandas read the whole file even when usecols is used?
54,649,847
1.2
python,pandas
According to the documentation, it will read the whole file (no way to only read columns from disk), but will only parse and store the columns given in the use_cols variable (emphasize mine): usecols : list-like or callable, optional Return a subset of the columns... Using this parameter results in much faster parsing...
I'm using pandas to read a file inside a rest service. The file is huge with more than 100 columns. But I only want to read just first two columns. I know I can use usecols in read_csv but I was wondering how exactly it works? Does pandas read the whole file and filter out the required columns? Or does it only read the...
0
1
454
0
54,711,863
0
0
0
0
1
false
2
2019-02-12T15:13:00.000
0
2
0
saspy: write large SAS table to local csv
54,653,191
0
python,csv,sas,saspy
With saspy V2.4.3, you could try to_csv() to create the csv file on the SAS server, then download(), which is new in 2.4.3, to pull the csv over to your local filesystem.
The SASData object has to_csv and to_df_CSV methods, but both of these write to locations on the host machine (where the SAS session is running). Is there a way to write a large SAS data table to .CSV on my local machine from a remote connection? The option on the saspy Github page was to get the DataFrame, via to_df, ...
0
1
1,164
0
54,665,528
0
1
0
0
3
true
66
2019-02-13T08:24:00.000
70
5
0
ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package
54,665,527
1.2
python,pandas,pickle
This error comes off due to encoding of formerly saved pickle file. If you updated pandas to newly amended version, it produces this import error.
When I tried to read a pickle file that saved by a former version of pandas, it yielded an ImportError. ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package There was no hit on stackoverflow so i would like to share my solution for this particular problem.
0
1
62,757
0
54,785,333
0
1
0
0
3
false
66
2019-02-13T08:24:00.000
10
5
0
ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package
54,665,527
1
python,pandas,pickle
I had the same problem, but for me, it seemed to come from the pickle package / interaction with the pandas package. I had Pandas version 0.23.4. I saved some pickle files with pandas.Dataframe.to_pickle, with python 3.6.6 & Pandas version 0.23.4. Then I upgraded to python 3.7.2 (Pandas version 0.23.4), and was enable...
When I tried to read a pickle file that saved by a former version of pandas, it yielded an ImportError. ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package There was no hit on stackoverflow so i would like to share my solution for this particular problem.
0
1
62,757
0
58,784,510
0
1
0
0
3
false
66
2019-02-13T08:24:00.000
2
5
0
ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package
54,665,527
0.07983
python,pandas,pickle
conda update pandas If you use conda package manager.
When I tried to read a pickle file that saved by a former version of pandas, it yielded an ImportError. ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package There was no hit on stackoverflow so i would like to share my solution for this particular problem.
0
1
62,757
0
54,708,388
0
0
0
0
3
true
71
2019-02-13T08:43:00.000
102
3
0
When importing tensorflow, I get the following error: No module named 'numpy.core._multiarray_umath'
54,665,842
1.2
python-3.x,numpy,tensorflow,anaconda
I also had the same issue. It got resloved once i upgraded the numpy from 1.15.4 to 1.16.1. If you're using pip: pip install numpy --upgrade Numpy that came with Anaconda3 is of version 1.15.4. so i upgraded and it worked. Side note: if you're also using scikit-image in your script, be aware that numpy 1.16.3 has a co...
I have installed Ancaconda3 and Tensorflow. When I try to import Tensorflow in python shell I receive the following error: ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ImportError: numpy.core.multiarray failed to import The above exception was the direct cause of the following exception: Trace...
0
1
76,204
0
56,179,177
0
0
0
0
3
false
71
2019-02-13T08:43:00.000
2
3
0
When importing tensorflow, I get the following error: No module named 'numpy.core._multiarray_umath'
54,665,842
0.132549
python-3.x,numpy,tensorflow,anaconda
You can use two options in python 3.6 Install py pip -m install numpy==1.14.5 Upgrade py pip install numpy --upgrade Note: the version most recently is 1.14.5
I have installed Ancaconda3 and Tensorflow. When I try to import Tensorflow in python shell I receive the following error: ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ImportError: numpy.core.multiarray failed to import The above exception was the direct cause of the following exception: Trace...
0
1
76,204
0
56,356,627
0
0
0
0
3
false
71
2019-02-13T08:43:00.000
2
3
0
When importing tensorflow, I get the following error: No module named 'numpy.core._multiarray_umath'
54,665,842
0.132549
python-3.x,numpy,tensorflow,anaconda
Kindly check whether you have installed the numpy package from pip. Because if you are running on conda evironment, then all packages need to be downloaded from there. Please use the below mentioned statement for this purpose conda install -c anaconda numpy Also make sure that the numpy version supports the Python vers...
I have installed Ancaconda3 and Tensorflow. When I try to import Tensorflow in python shell I receive the following error: ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ImportError: numpy.core.multiarray failed to import The above exception was the direct cause of the following exception: Trace...
0
1
76,204
0
54,677,347
0
1
0
0
1
true
3
2019-02-13T17:18:00.000
2
2
0
RAM usage after importing numpy in python 3.7.2
54,675,983
1.2
python,numpy,conda,ram
You can't avoid this cost, but it's likely not as bad as it seems. The numpy libraries (a copy of C only libopenblasp, plus all the Python numpy extension modules) occupy over 60 MB on disk, and they're all going to be memory mapped into your Python process on import; adding on all the Python modules and the dynamicall...
I run conda 4.6.3 with python 3.7.2 win32. In python, when I import numpy, i see the RAM usage increase by 80MB. Since I am using multiprocessing, I wonder if this is normal and if there is anyway to avoid this RAM overhead? Please see below all the versions from relevant packages (from conda list): python...........3...
0
1
1,002
0
54,861,503
0
0
0
0
1
false
4
2019-02-13T21:43:00.000
0
1
0
Remote interpreter and local plot in PyCharm?
54,679,917
0
python,matplotlib,ssh,pycharm,xserver
Interacting with visualisations on separate windows is slow, not just on PyCharm but any IDE that you specify visualisations to be loaded separately. This is because they are loaded on either tkinter or any of the available modules like Qt5 and if you're on a mac, you can also use the inbuilt OSX rendering. Especially ...
I'm using PyCharm with a remote interpreter. My code is showing a scatter figure using matplotlib. I can see the figure normally and interact with (zoom and rotate), but the interaction is too slow. I think this is because it's done through the SSH X-server. My question is how to manually make the figure interactions g...
0
1
815
0
54,683,752
0
1
0
0
1
false
2
2019-02-14T04:58:00.000
0
3
0
How can I upgrade Numpy in just one version of Python?
54,683,455
0
python,python-2.7,numpy,opencv,pip
Extending the first answer by JCutrer, after installing numpy on the specified version, you need to run the python.exe interpreter of the specified version. So, assuming you did c:\python27\Scripts\pip.exe install --upgrade numpy, the libraries have been installed for python27, now you can run python from the below p...
I am trying to get OpenCV working, but the issue with this is that my Python27 Numpp version is too old. Every time I write "install --upgrade numpy", I am told that Numpy is already up to date in C:Python37. How can I update Numpy in C:Python27 rather than 37? Any help would be much appreciated.
0
1
14,288
0
57,377,131
0
1
0
0
1
false
1
2019-02-14T21:39:00.000
1
1
0
Getting ImportError on spyder when trying to open a DataFrame after updating pandas and numpy
54,699,473
0.197375
python,pandas,spyder
I had the same problem. I solved it installing the pandas version 0.24.2 pip install pandas==0.24.2
I was trying to run some commands that needed me to update pandas, and then numpy, and so I did. Problem is now, when I try to look into a DataFrame in the variable explorer, they don't open and I get this error instead: ImportError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a pac...
0
1
788
0
54,706,020
0
0
0
0
1
false
0
2019-02-15T00:17:00.000
0
1
0
How to create a 2 value data table for keras
54,701,027
0
python,pandas,tensorflow,keras,neural-network
Sir even i'm new to neural network but i have some knowledge if you want to do this in exactly this manner then i'm no help but your can try doing this by genetic algo which will surely work for this
I am trying to make my first neural network in keras (python) that takes in the x and y distances to the next pipe and outputs whether or not the bird should flap. How would I go about creating an input data set from the game and then turning that into something keras can use for training? I don't have very much knowle...
0
1
117
0
54,702,197
0
0
0
0
1
true
0
2019-02-15T01:18:00.000
1
1
0
Tensorflow: why tf.nn.conv2d runs faster than tf.layers.conv2d?
54,701,429
1.2
python,tensorflow
If you try to follow the chain of function calls, you will find that tf.layers.conv2D() makes calls to tf.nn.conv2D() so no matter what you use, tf.nn.conv2d() will be called, it will be just faster if you call it yourself. You can use traceback.print_stack() method to verify that for yourself. NOTE This does not mean ...
I am writing a simple implementation of AlexNet. I tried with using tf.nn.conv2d and tf.layers.conv2d, and the results turn out that the loss dropped faster when using tf.nn.conv2d, even the structure is exactly the same. Does anyone know any explanation for that?
0
1
92
0
54,704,727
0
0
0
0
1
true
0
2019-02-15T06:03:00.000
0
1
0
TensorFlow why we still use tf.name_scope when we already have the function tf.variable_scope
54,703,473
1.2
python,tensorflow
You can use tf.variable_scope to add a prefix on both variables created with tf.get_variable and operations: as you said, this allows also variable sharing but it also makes the first call to tf.get_variable the definition of new variable under this scope. tf.name_scope adds a prefix only at the operations: variables d...
I do not understand why we also need the function tf.name_scope when we already have tf.variable_scope. From the Tensorflow official API, I see that the tf.variable_scope is more powerful because it can have an effect on tf.get_variable. When we create layers and want to share variables, we always use tf.variable_scope...
0
1
53
0
54,704,764
0
0
0
0
1
false
1
2019-02-15T06:50:00.000
1
3
0
What is difference between SGD classifier and SGD regressor in python?
54,704,015
0.066568
python-3.x,machine-learning,scikit-learn
Well, it's in the name. SGD Classifier is a model that is optimized (trained) using SGD (taking the gradient of the loss of each sample at a time and the model is updated along the way) in classification problems. It can represent a variety of classification models (SVM, logistic regression...) which is defined with th...
What is difference between SGD classifier and SGD regressor in python sklearn? Also can we set batch size for faster performance in them?
0
1
1,733
0
54,735,778
0
0
0
0
1
false
0
2019-02-15T11:48:00.000
0
1
0
How to insert a sum row of groupby sums
54,708,714
0
python,pandas,sum,pandas-groupby
after the groupby use df.reset_index() to convert the df to a dataframe again
I am trying to insert a new row of totals after groupby sum. I can get the groupby sums of my table. I can also compute the sum of groupby sums with a second groupby sum. I tried and searched here to find a solution to insert/append each sum of sums as a new row (e.g. named Total) after each group, but to no avail. Fir...
0
1
93
0
54,800,843
0
1
0
0
1
false
0
2019-02-15T12:19:00.000
0
2
1
How to access data from the vision capture cards to opencv?
54,709,269
0
python,c++,opencv
It might be possible to have the DVI stream written to a file, FFMPEG/gstreamer read the file stream, and then pipe the input into OpenCV.
I am trying to get data from an a endoscope into my opencv code in python. The endoscope machine has a dvi output and I have a Datapath vision capture card which helps read it into my system. I understand that opencv can only read from usb cameras or ip webcams. I was wondering if anyone has done this kind of a read in...
0
1
838
0
54,793,162
0
1
0
0
6
false
33
2019-02-15T19:21:00.000
10
11
0
Numpy is installed but still getting error
54,715,835
1
python,numpy,tensorflow
I was getting the error when I was trying to use Keras. This can be fixed by removing the numpy package continuously by running pip3 uninstall numpy. And checking the successful un-installation by opening a python terminal and importing numpy package.
I am trying to run jupyter notebook and getting following error. I am using Win 7 with anaconda python 3.7. ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['c:\users\paperspace\anaconda3\envs\tensorflow10\lib\site-packages\numpy']. One method of fi...
0
1
64,552