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
59,307,014
0
0
1
0
1
false
3
2017-11-17T08:33:00.000
0
2
0
generalized ordered logit in R or python
47,346,321
0
python,r,logistic-regression
Try the 'VGAM' package. There is a function called vglm. example: vglm(Var2~factor(Var1),cumulative(parallel = F),data) generalized order model cumulative(parallel=T) will perform a proportional odds model. parallel=F is the default.
I would like to fit a generalized ordered logit model to some data I have. I first tried to use the ordered logit model using the MASS package from R, but it seems that the proportional odds assumption is violated by the data. Indeed, not all independent variables do exert the same effect across all categories of the d...
0
1
1,939
0
47,747,060
0
0
0
0
1
true
1
2017-11-17T11:35:00.000
0
1
0
_pickle.UnpicklingError: invalid load key, 'xff'
47,349,740
1.2
python,io,stream
Actually in my case this was appearing due to unexpectedly something else was also getting in the data after getting pickled and before being sent to other end. So I was trying to unpickle some garbage data. Thats why this contained some unidentified character.
I am creating a tuple of two objects and pickling them. And when I try to unpickle them on the server side after passing it through sockets. It gives the above mentioned error.
0
1
862
0
47,353,749
0
0
0
0
1
true
0
2017-11-17T13:20:00.000
1
1
0
how to obtain predictive posteriors in pystan?
47,351,601
1.2
python,r,stan
As far as I know, they are not any Python libraries that do what the brms and rstanarm R packages do, i.e. come with precompiled Stan models that allow users to draw from the predictive distribution in the high-level language. There are things like prophet and survivalstan but those are for a pretty niche set of models...
I'm trying to move from using stan in R (I've mainly used the brms package) to pystan, but having trouble locating any methods in pystan that will give me predictive posterior distributions for new data. In R, I've been using brms::posterior_linpred() to do this. Does anyone know if this is possible in pystan? If not, ...
0
1
174
0
47,355,283
0
0
0
0
1
false
0
2017-11-17T14:55:00.000
0
1
0
Is the validation set used for anything besides monitoring progress on the Tensorflow for poets google code lab's project?
47,353,479
0
python,machine-learning,tensorflow,deep-learning,data-science
Very briefly, you have three sets of data: training, testing, and validation. These inputs should be distinct; any duplication between data sets will reduce some desirable aspect of your final model. Training data is used just the way you think: these are the inputs that are matched with the expected outputs (after fi...
I would like to know if the validation set influences in any way the training of the network, or if it's sole purpose is to monitor the training progress (with the tensorflow for poets project in question). If doesn't, is it okay/good-practice to reduce the validation and training sets to zero once I know the accuracy ...
0
1
31
0
47,420,745
0
0
0
0
1
true
3
2017-11-18T01:31:00.000
0
2
0
Dask: subset (or drop) rows from Dataframe by index
47,361,570
1.2
python,dask
I'm not sure this is the "best" way, but here's how I ended up doing it: Create a Pandas DataFrame with the index be the series of index keys I want to keep (e.g., pd.DataFrame(index=overlap_list)) Inner join the Dask Dataframe
I'd like to take a subset of rows of a Dask dataframe based on a set of index keys. (Specifically, I want to find rows of ddf1 whose index is not in the index of ddf2.) Both cache.drop([overlap_list]) and diff = cache[should_keep_bool_array] either throw a NotImplementedException or otherwise don't work. What is the be...
0
1
1,328
0
52,067,484
0
0
0
0
1
false
1
2017-11-18T14:31:00.000
0
1
0
Multi-line text dataset in Tensorflow
47,367,180
0
python,tensorflow,tensorflow-datasets
You can try two options: Write a generator and then use Dataset.from_generator: In your generator you can read your file line by line, append to your example while doing that and then yield when you encounter your custom delimiter. First parse your file, create tf.train.SequenceExample with multiple lines and then sto...
tf.data.* has dataset classes. There is a TextLineDataset, but what I need is one for multiline text (between start/end tokens). Is there a way to use a different line-break delimiter for tf.data.TextLineDataset? I am an experienced developer, but a python neophyte. I can read but my writing is limited. I am bending ...
0
1
805
0
57,801,832
0
0
0
0
1
false
24
2017-11-18T16:24:00.000
14
2
0
Pandas read csv file with float values results in weird rounding and decimal digits
47,368,296
1
python,pandas,csv,floating-point,rounding
I realise this is an old question, but maybe this will help someone else: I had a similar problem, but couldn't quite use the same solution. Unfortunately the float_precision option only exists when using the C engine and not with the python engine. So if you have to use the python engine for some other reason (for exa...
I have a csv file containing numerical values such as 1524.449677. There are always exactly 6 decimal places. When I import the csv file (and other columns) via pandas read_csv, the column automatically gets the datatype object. My issue is that the values are shown as 2470.6911370000003 which actually should be 2470.6...
0
1
30,458
0
47,400,198
0
0
0
0
1
true
0
2017-11-19T23:58:00.000
0
1
0
How do I use the output of one RNN applied to slices as input of the next?
47,383,336
1.2
python,tensorflow,tflearn
I think you don't need map_fn, you need tf.dynamic_rnn instead. It takes an RNN cell (so it knows what's the output and what's the state) and returns the concatenated outputs and concatenated states.
Suppose I have training data X, Y where X has shape (n,m,p) I want to set up a neural network which applies a RNN (followed by a dense layer) given by f to each i-slice (i,a,b) and outputs f(m,x) which has shape (p') then concatenates all the output slices (presumably using tf.map_fn(f,X)) to form a vector of dimensio...
0
1
39
0
47,400,793
0
0
0
0
1
false
0
2017-11-20T10:37:00.000
0
1
0
Obtain distance matrix from scipy `linkage` output
47,390,019
0
python,scipy,cluster-analysis,hierarchical-clustering,linkage
The linkage output clearly does not contain the entire distance matrix. The output is (n-1 x 4), but the entire distance matrix is much larger: n*(n-1)/2. The contents of the matrix are well described in the Scopus documentation.
I would like to reconstruct a condensed distance matrix from the linkage output when using scipy.cluster.hierarchy.linkage. The input is an m by n observation matrix. I understand therefore, that the distances are computed internally and then finally output in the linkage table. Does anybody know of a solution to obta...
0
1
284
0
47,405,311
0
0
0
0
1
false
1
2017-11-21T03:52:00.000
0
3
0
Find indices of raster cells that intersect with a polygon
47,404,898
0
python,gdal,ogr
if you want to do this manually you'll need to test each cell for: Square v Polygon intersection and Square v Line intersection. If you treat each square as a 2d point this becomes easier - it's now a Point v Polygon problem. Check in Game Dev forums for collision algorithms. Good luck!
I want to get a list of indices (row,col) for all raster cells that fall within or are intersected by a polygon feature. Looking for a solution in python, ideally with gdal/ogr modules. Other posts have suggested rasterizing the polygon, but I would rather have direct access to the cell indices if possible.
0
1
3,761
0
47,534,280
0
0
0
0
1
true
1
2017-11-21T15:45:00.000
0
1
0
Is it possible to optimize a Tensorflow MLP with the averaged loss after n iterations instead of every iteration?
47,417,060
1.2
python,tensorflow,neural-network,perceptron,multi-layer
Apparently, feeding an array [x,n] (where x is the number of inputs, I would otherwise have to feed seperatley in each iteration and n is the amount of sequential pixels) to my network and then optimizing the loss computed for this input, is exactly what I was looking for.
The input of my network is n sequential pixels of a NxN image (where n is small compared to N) and the output is 1 pixel. The loss is defined as the squared difference between the ouput and the desired output. I want to use the optimizer on the average loss after iterating over the whole image. But if I try to collect ...
0
1
42
0
47,422,098
0
0
0
0
1
false
2
2017-11-21T20:13:00.000
0
3
0
pandas: split dataframe into multiple csvs
47,421,880
0
python-3.x,pandas
iterating over iloc's arguments will do the trick.
I have a large file, imported into a single dataframe in Pandas. I'm using pandas to split up a file into many segments, by the number of rows in the dataframe. eg: 10 rows: file 1 gets [0:4] file 2 gets [5:9] Is there a way to do this without having to create more dataframes?
0
1
8,708
0
59,068,008
0
0
0
0
1
false
20
2017-11-22T02:57:00.000
1
4
0
python del vs pandas drop
47,426,089
0.049958
python,python-3.x,pandas
In drop method using "inplace=False" you have option to create Subset DF and keep un-touch the original DF, But in del I believe this option is not available.
I know it might be old debate, but out of pandas.drop and python del function which is better in terms of performance over large dataset? I am learning machine learning using python 3 and not sure which one to use. My data is in pandas data frame format. But python del function is in built-in function for python.
0
1
10,359
0
47,440,890
0
1
0
0
1
false
1
2017-11-22T06:32:00.000
5
1
0
How to save installations across sessions?
47,428,195
0.761594
python-2.7,session,google-colaboratory
VMs time out after a period of inactivity, so you'll want to structure your notebooks to install custom dependencies if needed. A typical pattern is to have a cell at the top of your notebook that executes apt and pip install commands as needed. In the case of opencv, that would look something like: !apt install -y -q...
In Colaboratory, is there a way to save library installations across sessions? If so how, can I do that? I'd like to learn more about Colaboratory session management in general. Currently, everytime I have to import, for e.g. a cv2 module(as this is not available by default), I need to reinstall the module with !pip in...
0
1
309
0
47,432,646
0
0
0
0
1
true
2
2017-11-22T10:00:00.000
2
1
0
Does cross_val_score take sequential samples or random samples?
47,431,661
1.2
python,machine-learning,scikit-learn,cross-validation
This depends on what you specify in the cv parameter. If the independent variable is binary or multiclass it will use StratifiedKFold, else it will use KFold. You can also override the options by specifying a function (sklearn or otherwise) to perform the splits. The KFold function will divide the data into sequentia...
In this: cross_val_score(GaussianNB(),features,target, cv=10) Are we splitting the data randomly into 10 or is it done sequentially?
0
1
992
0
47,444,089
0
0
0
0
1
true
1
2017-11-22T21:20:00.000
2
1
0
How to create a conv layer where the filter doesn't move across one dimension
47,444,039
1.2
python,tensorflow,convolution
Yes, you could do it that way. Another is to use the stride parameter to specify the stride in each dimension. You can set the other dimension's stride to 0. stride=(1, 0) is the proper syntax, I think.
Put another way I want the filter to cover the image across one dimension and only move in the other direction. If I have an input with shape (ignoring batch size and number of input channels) (h, w), I want to have a filter to have shape (x, w) where x<h. Would creating a filter with shape (x, w) and using padding of ...
0
1
20
0
47,455,441
0
0
0
0
1
true
1
2017-11-23T12:11:00.000
0
1
0
Weird behavior with datetime: error: time data '0' does not match format '%d%b%Y:%H:%M:%S'
47,455,323
1.2
python,pandas,python-datetime
As pointed by jezrael and EdChum, i have bd data in my column. errors='coerce' option solved this problem.
I know this has been asked 1000 times before but what i am experiencing is really weird and I cant troubleshoot it. I have a date column structured like this: 24JUN2017:14:46:57 I use: pd.to_datetime('24JUN2017:14:46:57', format="%d%b%Y:%H:%M:%S") and it works fine. But when I try to input the whole column: pd.to...
0
1
111
0
47,459,041
0
0
0
0
1
false
0
2017-11-23T12:46:00.000
0
1
0
conversion of job responsibilites and requirements from job descriptions to skillset Using Nlp
47,455,914
0
python,nlp,deep-learning,nltk
Use POS tagging / Parse Trees to take the corpus of job responsibility sentences that you have accumulated and split it into some broad categories. (e.g. sentences that start out with a bunch of comma-separated verbs, sentences that have a single verb but are in the past tense (i.e. requiring the person to have some sp...
I am working on a NLP problem of rewriting job responsibilities and requirements to skill sets ready to be mentioned in the resume. Example: 1:responsibility: "Train, supervise, motivate and develop sales personnel to attain or exceed their sales territory sales goals;" 1:skill: "Have provided training,guidance and m...
0
1
53
0
47,469,592
0
0
0
0
1
false
0
2017-11-24T08:56:00.000
0
1
0
Animating modes in openmodal: roving type
47,469,591
0
python,open-source
in animation tab try a right click on model and under "roving type" select "response roved".
I am asking this for mgx4: I imported a .uff file containing FRF from Experimental Modal Analysis (EMA). I generated the mesh (geometry) of the tested structure with lines and triangle surfaces. I succeed to realize the analysis and extract eigen frequencies and modal damping. What I am still unable to do is to animate...
0
1
45
0
63,786,602
0
0
0
0
1
false
0
2017-11-24T14:22:00.000
-1
1
0
distance calculation between camera and depth pixel?
47,475,206
-0.197375
python,opencv,object,depth
The content of my research is the same as yours, but I have a problem now. I use stereocalibrate() to calibrate the binocular camera, and found that the obtained translation matrix is very different from the actual baseline distance. In addition, the parameters used in stereocalibrate() are obtained by calibrating the ...
I need to calculate distance from camera to depth image pixel. I searched through internet but I found stereo image related info and code example where I need info for depth image. Here, I defined depth image in gray scale(0-255) and I defined a particular value( let range defined 0 pixel value is equal to 5m and 255 p...
0
1
569
0
48,661,572
0
1
0
0
2
false
3
2017-11-26T14:17:00.000
4
2
0
Module 'matplotlib' has no attribute 'colors'
47,497,097
0.379949
python-3.x,matplotlib,anaconda
The notebook needs to be restarted for the new installations to take effect.
I am running an Anaconda installation of Python3 64bit on Windows. I have no idea how to put those words in a proper sentence, but I hope it gives enough information. I am taking an Udacity course which wants me to run %matplotlib inline. This gives the following error: AttributeError: module 'matplotlib' has no at...
0
1
15,407
0
53,349,221
0
1
0
0
2
false
3
2017-11-26T14:17:00.000
1
2
0
Module 'matplotlib' has no attribute 'colors'
47,497,097
0.099668
python-3.x,matplotlib,anaconda
You just need to upgrade matplotlib. pip3 install -U matplotlib
I am running an Anaconda installation of Python3 64bit on Windows. I have no idea how to put those words in a proper sentence, but I hope it gives enough information. I am taking an Udacity course which wants me to run %matplotlib inline. This gives the following error: AttributeError: module 'matplotlib' has no at...
0
1
15,407
0
47,608,446
0
0
0
0
1
false
3
2017-11-26T15:09:00.000
1
3
0
scipy.optimize.minimize('SLSQP') too slow when given 2000 dim variable
47,497,552
0.066568
python,optimization,nonlinear-optimization
Surprisingly, I found a relatively ok solution using an optimizer from for a deep learning framework, Tensorflow, using basic gradient descent (actually RMSProp, gradient descent with momentum) after I changed the cost function to include the inequality constraint and the bounding constraints as penalties (I suppose th...
I have a non-lenear optimization problem with a constraint and upper/lower bounds, so with scipy I have to use SLSQP. The problem is clearly not convex. I got the jacobian fo both the objective and constraint functions to work correctly (results are good/fast up to 300 input vector). All functions are vectorized and tu...
0
1
8,691
0
55,925,583
0
1
0
0
1
true
0
2017-11-26T21:37:00.000
0
1
0
Best way to make data loaded in main() an implicit argument of a function in Python
47,501,275
1.2
python,main,functools
I ended up going with my proposed answer: define those functions in utils.py with the data as explicit parameters, and then use functools.partial before generating the equations to make them implicit and with that codebase having been in production for over a year, it seems reasonable enough to me.
My main function loads a largish dataframe from a csv supplied by the user (along with several other data objects), and then instantiates an object that forms a bunch of equations as part of a mathematical programming problem. Many of the equations' components are returned by calls to about 5 helper functions that I de...
0
1
36
0
47,516,794
0
0
0
0
1
true
0
2017-11-27T16:32:00.000
0
3
0
How to index a pandas data frame starting at n?
47,515,644
1.2
python,pandas,csv,dataframe,indexing
you may just reset the index at the end or define a local variable and use it in `arange' function. update the variable with the numbers of rows for each file you read.
Is it possible to start the index from n in a pandas dataframe? I have some datasets saved as csv files, and would like to add the column index with the row number starting from where the last row number ended in the previous file. For example, for the first file I'm using the following code which works fine, so I got ...
0
1
1,626
0
47,526,928
0
0
0
0
1
false
1
2017-11-28T07:23:00.000
0
2
0
How to quickly check if a value exists in pandas DataFrame index?
47,526,059
0
python,pandas,dataframe
Another way could be. a=time.time() if value in set(dataframe.index) b=time.time() timetaken=b-a
When I update the dataframe, I should check if the value exists in the dataframe index, but I want to know which way is faster, thanks! 1. if value in set(dataframe.index) 2. if value in dataframe.index
0
1
2,481
0
47,536,805
0
0
0
0
1
false
3
2017-11-28T14:25:00.000
5
1
0
How can I choose eps and minPts (two parameters for DBSCAN algorithm) for efficient results?
47,533,930
0.761594
python,cluster-analysis,dbscan
The DBSCAN paper suggests to choose minPts based on the dimensionality, and eps based on the elbow in the k-distance graph. In the more recent publication Schubert, E., Sander, J., Ester, M., Kriegel, H. P., & Xu, X. (2017). DBSCAN Revisited, Revisited: Why and How You Should (Still) Use DBSCAN. ACM Transactions on Da...
What routine or algorithm should I use to provide eps and minPts parameters to DBSCAN algorithm for efficient results?
0
1
4,405
0
47,536,983
0
0
0
0
1
true
0
2017-11-28T16:10:00.000
0
1
0
Define a custom layer with 2 tensors inputs in Keras
47,536,066
1.2
python,neural-network,keras,layer
Since you don't need it to be trainable, a lambda function will also do. Or you can keep the custom layer as you have it, and set trainable to False. The weights will never be updated for this layer, and whatever you do here will forward propagate to the next layer in the model and as mentioned in the comments, backpro...
I would like to implement a custom layer. The 2 inputs of my custom layer are 2 tensors, which come from 2 seperate 2D convolution layers, is there an example?
0
1
406
0
47,562,880
0
1
0
0
1
true
0
2017-11-29T22:21:00.000
0
3
0
How to compute the product some of parts of two vectors
47,562,817
1.2
python,tensorflow
If it's just that simple do: sum([A[i]*B[i] for i in range(3)]) This sums the products of the first three values with each other. Hope this helps!
How can I compute the product sum of the first three elements of two vectors A = [a1, a2, a3, a4, a5, a6]andB = [b1, b2, b3, b4, b5, b6] (i.e. [a1b1 + a2b2 + a3b3])in python and tensorflow.
0
1
52
0
47,566,035
0
1
0
0
1
true
2
2017-11-30T04:41:00.000
0
1
0
How to change a font size within a plot figure
47,566,009
1.2
python,matplotlib,plot
You may use tick_params function like plt.tick_params(axis='y', which='major', labelsize=10)
This question already has an answer here: How to change the font size on a matplotlib plot
0
1
445
0
47,578,933
0
0
0
0
1
false
0
2017-11-30T17:01:00.000
0
2
0
Python: How to efficiently do operations using different rows of the same column?
47,578,774
0
python,pandas,dataframe
If you have unique date or DaysToReception, you can actually use Map/HashMap where the key will be the date or DaysToReception and the values will be other information which you can store using a list or any other appropriate data structure. This will definitely improve the efficiency. As you pointed out that "number...
My goal is that by given a value on a row (let's say 3), look for the value of a given column 3 rows below. Currently I am perfoming this using for loops but it is tremendously inefficient. I have read that vectorizing can help to solve this problem but I am not sure how. My data is like this: Date DaysToReception Qua...
0
1
19
0
47,585,710
0
0
0
0
1
false
0
2017-12-01T02:13:00.000
0
2
0
Load classifier on Heroku Python
47,585,666
0
python,opencv,heroku,cascade-classifier
I figured it out. All I needed to do was use the os.path.abspath() method to convert the relative path to an absolute path
I am loading a cascade classifier from a file in OpenCV using python. Since the CascadeClassifier() method requires the filename to be the absolute filename, I have to load the absolute filename. However, I am deploying and using it on Heroku and I can't seem to get the absolute path of the file. I've tried using os.ge...
0
1
174
0
47,586,784
0
0
0
0
1
false
0
2017-12-01T04:19:00.000
0
2
0
Vehicle counting based on classification (cars,buses,trucks)
47,586,587
0
python,opencv,image-processing,bounding-box
I have worked on almost similar problem. Easiest way is to train a Haar-cascade on the vehicles of similar size. You will have to train multiple cascades based on the number of categories. Data for the cascade can be downloaded from any used car selling site using some browser plugin. The negative sets pretty much dep...
I am currently working on vehicle platooning for which I need to design a code in python opencv for counting the number of vehicles based on the classification.The input is a real time traffic video. The aim is finding an average size "x" for the bounding box and say that for cars its "x", for buses its "3x" and so on....
0
1
1,211
0
47,591,883
0
1
0
0
1
false
0
2017-12-01T10:36:00.000
1
1
0
error for installing COMMIT package in anaconda 3
47,591,513
0.197375
python,anaconda,commit
If you already have the binary downloaded on the folder why you need to run pip install commit That would download and install it again right? Just run pip install . on the folder where you downloaded the package.
I am going to install commit framework (Convex Optimization Modeling for Microstructure Informed Tractography) on anaconda 3. Here I explained the process that I did: 1st, I downloaded commit and then opened an anaconda prompt and went to the location that I downloaded the folder but when I run pip install commit I fa...
0
1
30
0
47,598,201
0
1
0
0
1
false
0
2017-12-01T11:35:00.000
0
2
0
Cannot load scikit-learn
47,592,516
0
python,import,installation,scikit-learn
Have you tried to import sklearn directly from a Python interpreter ? Also, try to check in your Project Settings that sklearn is recognized as a package of the Python interpreter associated (Settings --> Project --> Project Interpreter)
When I try to import sklearn, I get the following error message: ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden. (In English: The specified module was not found) I'm working on Windows 10, 64-Bit. I'm using Python 3.6.1. (and no other version), Anaconda and PyCharm. I installed scikit-learn u...
0
1
606
0
47,685,678
0
0
0
0
2
false
1
2017-12-02T08:53:00.000
0
2
0
YOLO - tensorflow works on cpu but not on gpu
47,606,161
0
python-3.x,tensorflow,darkflow
Problem solved. Changing batch size and image size in config file didn't seem to help as they didn't load correctly. I had to go to defaults.py file and change them up there to lower, to make it possible for my GPU to calculate the steps.
I've used YOLO detection with trained model using my GPU - Nvidia 1060 3Gb, and everything worked fine. Now I am trying to generate my own model, with param --gpu 1.0. Tensorflow can see my gpu, as I can read at start those communicates: "name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.6705" "totalMem...
0
1
1,053
0
50,273,011
0
0
0
0
2
false
1
2017-12-02T08:53:00.000
0
2
0
YOLO - tensorflow works on cpu but not on gpu
47,606,161
0
python-3.x,tensorflow,darkflow
Look like your custom model use to much memory and the graphic card cannot support it. You only need to use the --batch option to control the size of memory.
I've used YOLO detection with trained model using my GPU - Nvidia 1060 3Gb, and everything worked fine. Now I am trying to generate my own model, with param --gpu 1.0. Tensorflow can see my gpu, as I can read at start those communicates: "name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.6705" "totalMem...
0
1
1,053
0
47,619,440
0
0
0
0
1
false
1
2017-12-03T12:11:00.000
1
1
0
How do I calculate the semantic similarity between two n-grams?
47,618,217
0.197375
python,fasttext,sentence-similarity
Cosine similarity might be useful if you average both word vectors in a bi-gram first. So you want to take the vector for 'his' and 'name', average them into one vector. Then take the vector for 'I' and 'am' and average them into one vector. Finally, calculate cosine similarity for both resulting vectors and it should ...
I'm trying to calculate the semantic similarity between two bi-grams and I need to use fasttext's pre-trained word vectors to accomplish this task. For ex : The b-grams are python lists of two elements: [his, name] and [I, am] They are two tuples and I need to calculate the similarity between these two tuples by any ...
0
1
567
0
47,719,572
0
0
0
0
1
false
6
2017-12-03T23:27:00.000
-9
3
0
Getting Keras trained model predictions in c#
47,624,488
-1
c#,python,.net,tensorflow,keras
it does not work like that, since you wont even be able to install tensorflow in a C# project. Abandon C# stack and learn framework in python stack instead, ex. if if you need to consume the prediction result in a web app, learn Flask or Django
As title states I'm trying to use my Keras (tf backend) pretrained model for predicitions in c#. What's the best approach? I've tried IronPython but it gave me errors, after search I found it isn't supported. Simply calling python script won't work since target Windows devices won't have python interpreters installed.
0
1
11,563
0
47,655,652
0
1
0
0
1
false
0
2017-12-04T04:18:00.000
0
1
0
can't find tensorflow local in Pycharm project Interpreters
47,626,431
0
python,tensorflow,pycharm,macos-sierra
Click on the python 2.7 that you see. Then after you select you python you will see all the packages that come with it. One of the packages will be Tensorflow.
I am new to tensorflow, OS: Mac 10.13.1 Python: 2.7 tensorflow: 1.4.0(install with pip) I want to use tensorflow from Pycharm for a project, and when I open: "Pycharm" - "Preferences" - "Project Interpreter", There are only two local: 2.7.13/(Library/Frameworks/Python.framework.Versions.2.7/bin/python2.7) /System/...
0
1
184
0
51,676,877
0
0
0
0
1
true
0
2017-12-05T00:17:00.000
0
1
0
How to get a Queue object from a TensorFlow graph?
47,644,110
1.2
python,tensorflow
I think that as of today that is not possible. However, you can call methods of the queue object by getting them using get_operation_by_name. For example get_operation_by_name("queue_name/enqueue"). You can also make your own Queue object which internally simply calls the corresponding graph operations.
In TensorFlow I have a graph that has in it a string_input_producer that is used in it's input pipeline. I am loading the graph from a checkpoint file, so I do not have access to the original object when it was created. Nonetheless, I need to run the enqueue method of this object. I have tried getting the FIFOQueue obj...
0
1
79
0
48,959,163
0
0
0
0
1
false
3
2017-12-05T04:34:00.000
0
2
0
Tensorflow Feature Column for 0 and 1
47,646,159
0
python-3.x,tensorflow
I would recommend tf.feature_column.categorical_column_with_vocabulary_list. I would think you would want to treat the data as categories, rather than as scalars.
For Tensorflow feature columns contain boolean value 0 and 1. Should I be using tf.feature_column.numeric_column or tf.feature_column.categorical_column_with_vocabulary_list?
0
1
1,012
0
48,248,566
0
0
0
0
1
false
16
2017-12-05T14:20:00.000
3
3
0
Oversampling: SMOTE for binary and categorical data in Python
47,655,813
0.197375
python-3.x,imputation
So as per documentation SMOTE doesn't support Categorical data in Python yet, and provides continuous outputs. You can instead employ a workaround where you convert the categorical variables to integers and use SMOTE. Then use np.round(X_train[categorical_variables]) to convert them back to the respective categorical ...
I would like to apply SMOTE to unbalanced dataset which contains binary, categorical and continuous data. Is there a way to apply SMOTE to binary and categorical data?
0
1
22,277
0
47,662,958
0
0
0
0
1
true
22
2017-12-05T20:29:00.000
24
2
0
What is the difference between tensors and sparse tensors?
47,662,143
1.2
python,tensorflow
The difference involves computational speed. If a large tensor has many, many zeroes, it's faster to perform computation by iterating through the non-zero elements. Therefore, you should store the data in a SparseTensor and use the special operations for SparseTensors. The relationship is similar for matrices and spar...
I am having troubles understanding the meaning and usages for Tensorflow Tensors and Sparse Tensors. According to the documentation Tensor Tensor is a typed multi-dimensional array. For example, you can represent a mini-batch of images as a 4-D array of floating point numbers with dimensions [batch, height, width, ch...
0
1
13,330
0
47,674,949
0
0
0
0
1
true
2
2017-12-06T02:32:00.000
-1
1
0
scikit learn averaged perceptron classifier
47,665,910
1.2
python-2.7,machine-learning,scikit-learn,classification,perceptron
I'm sure someone will correct me if I'm wrong but I do not believe Averaged Perceptron is implemented in sklearn. If I recall correctly, Perceptron in sklearn is simply SGD with certain default parameters. With that said, have you tried good old logistic regression? While it may not be the sexiest algorithm around, i...
I am a new learner to machine learning and I want to do a 2-class classification with only a few attributes. I have learned by researching online that two-class averaged perceptron algorithm is good for two-class classification with a linear model. However, I have been reading through the documentation of Scikit-learn,...
0
1
635
0
48,290,905
0
0
0
0
1
false
0
2017-12-06T17:17:00.000
0
1
0
How can I improve this genetic algorithm for the TSP?
47,679,966
0
python,genetic-algorithm,traveling-salesman,mutation,crossover
A problem in GA's is narrowing your search space too quickly and reaching a local maxima solution. You need to ensure that you are not leading your solution in any way other than in the selection/fitness function. So when you say, why would you take a good solution and then perform a function that will most likely m...
This is my genetic algorithm, step by step: Generate two initial population's randomly, and select the fittest tour from both. Perform an ordered crossover, which selects a random portion of the first fit tour and fills in the rest from the second, in order. Mutates this tour by randomly swapping two cities if the tou...
0
1
469
0
47,710,171
0
0
0
0
1
false
0
2017-12-07T00:42:00.000
0
2
0
How do I finetune ResNet50 Keras to only classify images in 2 classes (cats vs. dogs) instead of all 1000 imagenet classes?
47,685,816
0
python,classification,imagenet
There are several ways of applying Transfer Learning and it's trial & error what works best. However, ImageNet includes multiple types of cats and dogs in its 1000 classes, which is why I would do the following: Add a single Dense layer to your model with 2 outputs Set only the last layer to trainable Retrain the netw...
How do I finetune ResNet50 Keras to only classify images in 2 classes (cats vs. dogs) instead of all 1000 imagenet classes? I used Python and was able to classify random images with ResNet50 and keras with the 1000 ImageNet classes. Now I want to fine tune my code so that it only classifies cats vs. dogs, using the Kag...
0
1
544
0
47,720,583
0
0
0
0
1
false
1
2017-12-07T10:20:00.000
1
1
0
XGBoost unreasonable splitting value in nodes
47,692,738
0.197375
python,machine-learning,deep-learning,xgboost
A possible explanation: you have all non-missing values going to the 'text < 4' branch, and all missing values to the other - 'text > 4' - branch. Can you verify?
My xgboost model trained for a regression task in python using the xgboost package version 0.6 is using strange values for splits. Some values used as a splitting criteria are not present in the training dataset at all. Example: - there's a variable 'text' with values in the train set of [Missing,1,2] - yet, a derived ...
0
1
579
0
47,704,296
0
0
0
0
1
true
2
2017-12-07T21:33:00.000
4
1
0
Why does scipy stats describe does not have median?
47,704,158
1.2
python,scipy,statistics
I cannot speak for the scipy stats.describe people, but the general answer is this: mean, variance, and even kurtosis can be computed in one or two O(n) passes through the data, while median requires an O(n*log(n)) sort.
It might be a naive question but I couldn't find a reasonable answer. Why the median is not included in the return of stats.describe ? Even kurtosis is included but why not median ? Thanks
0
1
573
1
47,741,851
0
0
0
0
1
false
0
2017-12-10T15:16:00.000
0
2
0
Dealing with pixels in real-time using OpenCV
47,740,206
0
python
Want to continue Jakubs great answer: Using C++ or something might be a good idea in some cases. I created a csgo aimbot with opencv, pil, pyautogui and numpy and few other modules, watching sentdex's videos on this subject might give u some idea(link above). There might be a custom module for GPU cv2 tips for py: 1) l...
I just started to study OpenCV with Python and was trying to build my first game bot. My thought is: capture the game window frame by frame and analyze the pixels in some specific locations, if the color of those pixels has changed, then press a key to do some automatic operations. This game needs quick reactions so th...
0
1
1,166
0
49,182,635
0
1
0
0
1
true
0
2017-12-11T17:00:00.000
1
1
0
Jupyternotebook corrects groupby to groupyouby Python
47,757,753
1.2
python,jupyter
Grammarly was the cause of this. If you use jupyter notebooks and have the grammarly extension. It will cause problems.
I don't know how this happens or why, but I'll be in a jupyter notebook grouping by things and I will very conciously type in dataframe.groupby, write some other code and hit ctrl+ enter and there will be that damn error. Every single time, I will go back and delete the 'groupyouby' and type in groupby. I doubt that ...
0
1
39
0
47,775,119
0
0
0
0
1
false
0
2017-12-12T14:09:00.000
0
1
0
Python package installation error for openCV
47,774,652
0
python,opencv
It looks like you have not given a valid file location. The error is saying that it thinks you have given it a whl file to install but it can't find it. I suggest you check you file path again. Make sure it is located at C:\Users\Om and it is called exactly the same as the filename you have put down. It should match o...
C:\Users\Om>pip install opencv_python-3.2.0-cp36-cp36m-win32.whl Requirement 'opencv_python-3.2.0-cp36-cp36m-win32.whl' looks like a filename, but the file does not exist Processing c:\users\om\opencv_python-3.2.0-cp36-cp36m-win32.whl Exception: Traceback (most recent call last): File "c:\users\om\appdata\local\p...
0
1
266
0
57,437,066
0
0
0
0
2
false
20
2017-12-12T17:34:00.000
2
3
0
Computing TF-IDF on the whole dataset or only on training data?
47,778,403
0.132549
python,machine-learning,scikit-learn,nlp,tf-idf
As we are talking about text data, we have to make sure that the model is trained only on the vocabulary of the training set as when we will deploy a model in real life, it will encounter words that it has never seen before so we have to do the validation on the test set keeping that in mind. We have to make sure that ...
In the chapter seven of this book "TensorFlow Machine Learning Cookbook" the author in pre-processing data uses fit_transform function of scikit-learn to get the tfidf features of text for training. The author gives all text data to the function before separating it into train and test. Is it a true action or we must s...
0
1
12,402
0
55,300,936
0
0
0
0
2
false
20
2017-12-12T17:34:00.000
4
3
0
Computing TF-IDF on the whole dataset or only on training data?
47,778,403
0.26052
python,machine-learning,scikit-learn,nlp,tf-idf
Author gives all text data before separating train and test to function. Is it a true action or we must separate data first then perform tfidf fit_transform on train and transform on test? I would consider this as already leaking some information about the test set into the training set. I tend to always follow th...
In the chapter seven of this book "TensorFlow Machine Learning Cookbook" the author in pre-processing data uses fit_transform function of scikit-learn to get the tfidf features of text for training. The author gives all text data to the function before separating it into train and test. Is it a true action or we must s...
0
1
12,402
0
51,338,424
0
1
0
0
1
false
0
2017-12-12T23:56:00.000
0
2
0
Can import TensorFlow and Keras in Jupyter, even though I have them installed?
47,783,481
0
python,tensorflow,keras,jupyter-notebook
If you are a Windows/Mac user who is working on Jupyter notebook, pip install keras doesn't help you. Instead, try the steps below: In command prompt navigate to the “site packages” directory of your anaconda installed. Now use conda install tensorflow and after conda install keras Restart your Jupyter notebook and ru...
I have setup Tensorflow and Keras on Mac OS. I also have Jupyter that came as part of my Anaconda installation. When I try to import Tensoflow or Keras in a Jupyter notebook, I get "a no module named <...>" error. Am I missing a step ?
0
1
661
0
47,800,231
0
1
0
0
1
false
1
2017-12-13T09:50:00.000
-1
1
0
Decrease the debug startup time of the python code in Visual Studio Code
47,789,968
-0.197375
python,pandas,numpy,opencv,visual-studio-code
There's no explicit technique to improving the import time short of using lazy loading, but there are technical considerations which have to be taken into account before going down that route (e.g. some modules simply don't work when loaded lazily).
Is it possible to decrease the debug startup time of the python script in visual studio code? If I a have a lot of import library (like opencv, numpy, pandas and so on) every time i start the debug of the script, pressing the F5 button, the environment wait for seconds to reload them. Is it possible to reduce this time...
0
1
80
0
47,808,839
0
0
0
0
1
false
1
2017-12-13T13:37:00.000
0
1
0
OpenCV perspective transform with camera roll and pitch correction
47,794,365
0
python,opencv,graphics,computer-vision
If the camera motion is approximately a rotation about its optical center / lens entrance pupil (for example, pan-tilt-roll on a tripod with the subject distance much larger than the translation of the optical center), then images taken from rotated viewpoints are related by a homography. If you know the 3D rotation (p...
I am performing some perspective transforms on camera images, however in certain cases the roll and pitch of the camera are not zero. In other words, the camera is not level and I would like to be able to correct for this. I have some questions: 1) Can the transformation matrix (from M = cv2.getPerspectiveTransform(......
0
1
715
0
47,806,250
0
0
0
0
1
false
0
2017-12-13T18:13:00.000
0
1
0
Parameter values of Doc2vec for Document Tagging - Gensim
47,799,657
0
python,gensim,doc2vec
Which parameters are best can vary with the quality & size of your training data, and exactly what your downstream goals are. (There's no one set of best-for-everything parameters.) Starting with the gensim defaults is reasonable first guess, or other values you've see someone else having used successfully on a simila...
my task is to assign tags (descriptive words) to documents or posts from the list of available tags. I'm working with Doc2vec available in Gensim. I read that doc2vec can be used for document tagging. But i could not get the suitable parameter values for this task. Till now, i have tested it by changing value of parame...
0
1
374
0
54,758,338
0
0
0
0
1
false
4
2017-12-14T01:56:00.000
0
2
1
Distributed Tensorflow: ps/workers hosts on aws ?
47,804,792
0
python,tensorflow,tensorflow-gpu
When a distributed TF code is run on the cluster, other nodes could be accessed through "private ip: port number". But the problem with AWS is that the other nodes can not be easily launched and it needs extra configuration.
I am using distributed Tensorflow on aws using gpus. When I train the model on my local machine, I indicate ps_host/workers_host as something like 'localhost:2225'. What are the ps/workers host I need to use in case of aws?
0
1
186
0
47,820,153
0
0
0
0
1
true
0
2017-12-14T10:19:00.000
2
1
0
Passing functions to CUDA blocks with numba
47,810,891
1.2
python,cuda,numba
The Numba CUDA Python implementation presently doesn't support any sort of function pointer or objects within kernels. So what you would have ambitions to do is not possible.
I am working in python with the numba library and wondered if there is a solution to write a parallel version of a previous work. I have a function f(X, S, F) where X and S are scalar arrays, and F is a list of functions. I am almost sure that passing an array of functions is not possible with numba (and cuda in gener...
0
1
227
0
47,821,531
0
0
0
0
1
true
1
2017-12-14T20:14:00.000
1
1
0
Call scipy.optimize inside pyomo
47,821,346
1.2
python,scipy,pyomo
At the moment (Dec 2017), there is no built-in support for passing a Pyomo model to scipy.optimize. That said, it would not be a very difficult task to write a reasonably general purpose object that could generate the necessary (value, Jacobian, Hessian) evaluation functions to pass to scipy.optimize.minimize().
Can I integrate scipy.optimize.minimize solver with method=SLSQP inside pyomo? Modeling in pyomo is much faster than in scipy but pyomo documentation does not seem to say explicitly if this is feasible.
0
1
588
0
47,830,720
0
0
0
0
1
false
0
2017-12-15T06:44:00.000
0
1
0
Suggestion on LDA
47,827,130
0
python-3.x,nlp,gensim,text-analysis
I have worked on similar lines. This approach can work till 300 such documents. But, taking it to higher scale you need to replicate the approach using spark. Here it goes: 1) Prepare TF-IDF matrix: Represent documents in terms Term Vectors. Why not LDA because you need to supply number of themes first which you don't ...
I am trying to do textual analysis on a bunch (about 140 ) of textual documents. Each document, after preprocessing and removing unnecessary words and stopwords, has about 7000 sentences (as determined by nlkt's sentence tokenizer) and each sentence has about 17 words on average. My job is to find hidden themes in thos...
0
1
66
0
51,581,196
0
0
0
0
1
false
2
2017-12-15T19:25:00.000
7
2
0
reducing word2vec dimension from Google News Vector Dataset
47,838,719
1
python-3.x,gensim
tl;dr Use a dimensionality reduction technique like PCA or t-SNE. This is not a trivial operation that you are attempting. In order to understand why, you must understand what these word vectors are. Word embeddings are vectors that attempt to encode information about what a word means, how it can be used, and more. Wh...
I loaded google's news vector -300 dataset. Each word is represented with a 300 point vector. I want to use this in my neural network for classification. But 300 for one word seems to be too big. How can i reduce the vector from 300 to say 100 without compromising on the quality.
0
1
2,005
0
47,839,249
0
0
0
0
1
false
0
2017-12-15T19:30:00.000
0
2
0
Plotting a 3d surface in Python from known values
47,838,811
0
python,arrays,numpy,matplotlib,multidimensional-array
use x and y as coordinates and put a dot sized for the energy z. a table would work as well, since you haven't stated that x and y geometries have any numeric purpose other than as lablels.
I have a set of about 2000 files that look like: 10_20.txt, 10_21.txt, 10_21.txt, ... ,10_50.txt, ... , 11.20.txt, ... , 11.50.txt , ... , 20_50.txt The first value in the file name, we'll call x, goes from 10-20 in steps of 1, and the second value in the file name, we'll call y, and goes from 20-50 in steps of 1. With...
0
1
470
0
48,814,986
0
0
0
0
2
false
3
2017-12-17T18:23:00.000
0
2
0
scipy ImportError: dlopen no suitable image found in Python 3
47,858,150
0
scipy,python-3.6
Looks like I am the only one on earth to have this issue. Fortunately, I got it to work with endless attempts. In case someone in the future gets the same error, you can try this:python -m pip install scipy. I have no idea why pip install scipy doesn't work.
I have python 3.6, Mac OS X El Capitan. I installed scipy by pip install scipy. But when I import scipy, I get the following error: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/scipy/init.py in () 116 del _NumpyVersion 117 --> 118 from scipy._lib._ccallback impor...
0
1
5,874
0
54,552,819
0
0
0
0
2
false
3
2017-12-17T18:23:00.000
0
2
0
scipy ImportError: dlopen no suitable image found in Python 3
47,858,150
0
scipy,python-3.6
What I did find on MacOS 10.14.2 is that I had installed Scipy 1.1. After executing python -m pip install scipy I got Scipy 1.2 and get rid of "ImportError: dlopen".
I have python 3.6, Mac OS X El Capitan. I installed scipy by pip install scipy. But when I import scipy, I get the following error: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/scipy/init.py in () 116 del _NumpyVersion 117 --> 118 from scipy._lib._ccallback impor...
0
1
5,874
0
49,210,718
0
1
0
0
3
false
5
2017-12-18T00:34:00.000
2
3
0
Error loading tensorflow - Could not find "cudart64_80.dll"
47,860,803
0.132549
python,tensorflow,tensorflow-gpu
I had a similar issue, but with the version 9.1 which I had on my machine. The one which was missing 'cudart64_90.dll', whereas there was 'cudart64_91.dll'. So I did a 'downgrade' from CUDA 9.1 to 9.0 and it solved my problem. Hope it helps.
I am trying to import tensorflow (with GPU) and keep getting the following error: ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable Setup: NVIDIA GTX 1080 CUDA Development Tool v8.0 cuDNN 6.0 tensorflow-gpu 1...
0
1
12,211
0
47,864,449
0
1
0
0
3
true
5
2017-12-18T00:34:00.000
1
3
0
Error loading tensorflow - Could not find "cudart64_80.dll"
47,860,803
1.2
python,tensorflow,tensorflow-gpu
In certain cases you may need to restart the computer to propagate all the changes. If you are using intellij or pycharm, make sure to restart that as it may not take the correct path environment variables otherwise.
I am trying to import tensorflow (with GPU) and keep getting the following error: ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable Setup: NVIDIA GTX 1080 CUDA Development Tool v8.0 cuDNN 6.0 tensorflow-gpu 1...
0
1
12,211
0
57,690,869
0
1
0
0
3
false
5
2017-12-18T00:34:00.000
0
3
0
Error loading tensorflow - Could not find "cudart64_80.dll"
47,860,803
0
python,tensorflow,tensorflow-gpu
I just changed cudart64_90 to cudart64_80. It worked
I am trying to import tensorflow (with GPU) and keep getting the following error: ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable Setup: NVIDIA GTX 1080 CUDA Development Tool v8.0 cuDNN 6.0 tensorflow-gpu 1...
0
1
12,211
0
55,399,149
0
0
0
1
2
false
1
2017-12-18T23:46:00.000
-1
2
0
Pandas .to_sql is not inserting any records for a dataframe I want to send to sql. Are there any generic reasons why this might be the case?
47,878,076
-0.099668
python,sql,python-3.x,postgresql,pandas
I was also facing same issue because dot was added in header. remove dot then it will work.
Pandas .to_sql is not inserting any records for a dataframe I want to send to sql. Are there any generic reasons why this might be the case? I am not getting any error messages. The column names appear fine, but the table is entirely empty. When I try to send over a single column (i.e. data.ix[2]), it actually works...
0
1
2,183
0
47,896,038
0
0
0
1
2
false
1
2017-12-18T23:46:00.000
0
2
0
Pandas .to_sql is not inserting any records for a dataframe I want to send to sql. Are there any generic reasons why this might be the case?
47,878,076
0
python,sql,python-3.x,postgresql,pandas
I fixed this problem - it was becomes some of the column headers had '%' in it. I accidentally discovered this reason for the empty tables when I tried to use io and copy_from a temporary csv, instead of to_sql. I got a transaction error based on a % placeholder error. Again, this is specific to passing to PSQL; it w...
Pandas .to_sql is not inserting any records for a dataframe I want to send to sql. Are there any generic reasons why this might be the case? I am not getting any error messages. The column names appear fine, but the table is entirely empty. When I try to send over a single column (i.e. data.ix[2]), it actually works...
0
1
2,183
0
58,295,830
0
1
0
0
1
false
2
2017-12-19T17:13:00.000
2
3
0
import tensorflow in Anaconda prompt
47,892,038
0.132549
python
I was looking for a similar issue (unable to import tensorflow in jupyter) and found that maybe most answers are outdated because now conda installs tf in its own environment. The most useful thing I found is: https://docs.anaconda.com/anaconda/user-guide/tasks/tensorflow/ which explains in very few steps how to insta...
ModuleNotFoundError Traceback (most recent call last) in () 11 import numpy as np 12 ---> 13 import tensorflow as tf 14 15 ModuleNotFoundError: No module named 'tensorflow'
0
1
9,109
0
47,898,790
0
0
0
0
1
true
0
2017-12-20T03:56:00.000
1
1
0
Variable length array reshape for input to CNN
47,898,566
1.2
python,tensorflow,keras
I don't think 'None' can be accepted in any reshape function. Reshape functions usually require numeric size. But you can reshape 'None' part to 1 to fit the model you are using. For reshaping, considering x is the variable that needs to be reshaped, Using Numpy, x = np.reshape(x, (1000, 1, 1, 1)) Using Tensorflow, ...
I want to ask about how I reshape an array with a different number of elements, For example, the size of the array is (1000,). I want to reshape it to be (1000, None,None,1) to be the input to CNN, I'm using keras.
0
1
373
0
50,867,759
0
0
0
0
1
false
0
2017-12-20T11:36:00.000
0
1
0
text classification using logistic regression
47,905,139
0
python,text-classification
If you have 3 classes and labelled data and have trained the model, then you have "told the classifier" everything you can (ie trained). If you're saying you want to tell the classifier about the 2/6 test cases that failed, you then no its not possible with Logistic Regression (maybe some other feedback model?). What ...
I am planning to classify emails. I am using tfidf vectorizer and logistic regression algorithm to do this. I took very small training and testing sets. My training set consists of 150 emails( 3 classes, 50 emails/class) and testing set consists of 6 emails. Now my classifier is predicting 4 out of 6 correctly. Now my ...
0
1
422
0
47,918,220
0
0
0
0
2
false
2
2017-12-20T11:59:00.000
2
2
0
How to use Gensim Doc2vec infer_vector() for large DataFrame?
47,905,576
0.197375
python,gensim,doc2vec
Doc2Vec infer_vector() only takes individual text examples, as lists-of-word-tokens. So you can't pass in a batch of examples. (And, you shouldn't be passing in non-tokenized strings – but lists-of-tokens, preprocessed in the same manner as your training data was preprocessed.) But, you might be able to use a function ...
I have created document vectors for a large corpus using Gensim's doc2vec. sentences=gensim.models.doc2vec.TaggedLineDocument('file.csv') model = gensim.models.doc2vec.Doc2Vec(sentences,size = 10, window = 800, min_count = 1, workers=40, iter=10, dm=0) Now I am using Gensim's infer_vector() using those document vectors...
0
1
1,915
0
47,925,223
0
0
0
0
2
false
2
2017-12-20T11:59:00.000
0
2
0
How to use Gensim Doc2vec infer_vector() for large DataFrame?
47,905,576
0
python,gensim,doc2vec
@gojomo: Thanks for the answer, but I tried inferring using both tokenized rows as well as raw strings, and got the same document vector. Is there a way to know if the document vector which are getting created are meaningful or not?
I have created document vectors for a large corpus using Gensim's doc2vec. sentences=gensim.models.doc2vec.TaggedLineDocument('file.csv') model = gensim.models.doc2vec.Doc2Vec(sentences,size = 10, window = 800, min_count = 1, workers=40, iter=10, dm=0) Now I am using Gensim's infer_vector() using those document vectors...
0
1
1,915
0
47,928,522
0
0
0
0
1
false
3
2017-12-21T15:48:00.000
2
1
0
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory (Shared Linux)
47,928,371
0.379949
python,ubuntu,tensorflow,cublas
A likely explanation is that your path is not set up correctly. Try echo $LD_LIBRARY_PATH and let us know what you get. Another explanation is that it is not in that directory. Yes, libcublas.so should normally be in /usr/local/cuda-8.0/lib64 but double check if it is there or another directory by using find.
I am new to tensorflow and I am working on shared linux (Ubuntu 16.04), it means I don't have root access. Cuda 8.0 and Cudnn 8 are already installed by admin as root. I have installed python 3.5 using anaconda and then installed tensorflow using pip. I have added the cuda-8.0/bin and cuda-8.0/lib64 to PATH and LD_PATH...
0
1
1,016
0
47,934,883
0
0
0
0
1
false
1
2017-12-22T00:10:00.000
0
2
0
Create a dataframe by discarding intersections of two dataframes (Pandas)
47,934,376
0
python,pandas,dataframe
If you have both dataframes of same length you can also use: print df1.loc[df1['ID'] != df2['ID']] assign it to a third dataframe.
Does anyone know of an efficient way to create a new dataframe based off of two dataframes in Python/Pandas? What I am trying to do is check if a value from df1 is in df2, then do not add the row to df3. I am working with student IDS, and if a student ID from df1 is in df2, I do not want to include it in the new datafr...
0
1
226
0
47,942,101
0
1
0
0
1
false
0
2017-12-22T12:06:00.000
0
1
0
Able to fetch text with their locations from an image...How can I form sentence?
47,941,250
0
javascript,python,image-processing,ocr,image-conversion
I don't if I am understanding your problem correctly, but I'm assuming each dictionary in your json is giving you the coordinates for a word. My approach would be to first find the difference in pixels for the space between any 2 words, and you use this value to detect the sequence of words. For example: img1 = {'coord...
I am using online library and able to fetch words from an image with their locations. Now I want to form sentences exactly like which are in image. Any idea how can I do that? Earlier i used the distance between two words and if there are pretty close then it means it is a part of a sentence but this approach is not wo...
0
1
41
0
51,340,436
0
0
0
0
1
false
7
2017-12-22T19:34:00.000
3
2
0
Python fbprophet - export values from plot_components() for yearly
47,946,518
0.291313
python-3.x,time-series,facebook-prophet
There is a simple solution in the current version of the library. You can use from the predicted model fc. What you want for the value of yearly can be found with fc['yearly'] without using the functions in the above solution. Moreover, if you want all the other components like trend, you can use fc['trend'].
Any ideas on how to export the yearly seasonal trend using fbprophet library? The plot_components() function plots the trend, yearly, and weekly. I want to obtain the values for yearly only.
0
1
3,166
0
47,976,344
0
0
0
0
1
false
0
2017-12-22T21:43:00.000
0
1
0
How to display OpenCV camera stream in the same window as another file?
47,947,718
0
python,opencv,imshow
I think the GUI you're talking about is Tkinter, but opencv's cv.imshow is just playing frame.I don't think it's necessary to use GUI to show frame.Because cv2.imshow is good at handling.
I have been trying to use OpenCV to display my camera stream in the same window as another (GUI) window. However, the imshow() method opens its own window. Is there another way to do this so that it displays in the same window as my GUI?
0
1
223
0
47,958,997
0
0
0
0
1
true
4
2017-12-24T07:01:00.000
-1
1
0
Save OneHot Encoder object python
47,958,697
1.2
python,scikit-learn,one-hot-encoding
simple use of pickel for OHE will do for me.
Is there anyway of saving OneHotencoder object in python? . Reason is being I used that object in preprocessing of training data and test data and we are building a API containing the same trained model and that will be injected by real data from the website when user created. So first that data needs to be preprocesse...
0
1
1,953
0
48,297,553
0
0
0
0
1
false
0
2017-12-24T23:52:00.000
0
1
0
Tensorflow trained model works on cloud machine but gives an error when used in my local pc
47,964,765
0
python,tensorflow,machine-learning,deep-learning
Are the cloud and local machines running the same Python/Tensorflow versions? Sometimes checkpoints produced by a specific Tensorflow version are not backward compatible due to internal variables renaming.
I've tried to create a custom object detector in the paperspace cloud desktop, then I tried it on Jupyter Notebook and it works. Now, I've uploaded the whole models-master folder and downloaded it on my local machine. I ran it using Jupyter Notebook and it now gives an InvalidArgumentError. I've tried re-exporting th...
0
1
665
0
47,965,130
0
0
0
0
1
false
1
2017-12-25T01:08:00.000
1
2
0
OpenCV Error: Assertion failed (_img.rows * _img.cols == vecSize)
47,965,021
0.099668
python-3.x,opencv,cascade,assertion
I solved it haha. Even though I specified in the command the width and height to be 20x20, it changed it to 20x24. So the opencv_traincascade command was throwing an error. Once I changed the width and height arguments in the opencv_traincascade command it worked.
I keep getting this error OpenCV Error: Assertion failed (_img.rows * _img.cols == vecSize) in get, file /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/apps/traincascade/imagestorage.cpp, line 157 terminate called after throwing an instance of 'cv::Exception' what(): /build/opencv-SviWsf/opencv-2.4.9.1+dfsg/apps/traincasc...
0
1
2,068
0
47,973,889
0
1
0
0
2
false
2
2017-12-26T01:43:00.000
0
3
0
Cannot import FactorAnalyzer from module factor-analyzer-0.2.2
47,973,216
0
python,python-3.x
Can you try to run the import command on your Python Shell and let us know if you are able to import it successfully?
I installed the module factor-analyzer-0.2.2 but cannot import the function. My code is from factor_analyzer import FactorAnalyzer. I'm getting an error ModuleNotFoundError: No module named 'factor_analyzer'. I'm using Python 3.6 and Jupyter notebook. Do you know why this does not work? Thank you!!
0
1
5,421
0
58,283,301
0
1
0
0
2
false
2
2017-12-26T01:43:00.000
1
3
0
Cannot import FactorAnalyzer from module factor-analyzer-0.2.2
47,973,216
0.066568
python,python-3.x
Use the anaconda prompt to run the pip install factor-analyzer rather than termainal or powershell. I had the same problem and doing that solved it for me.
I installed the module factor-analyzer-0.2.2 but cannot import the function. My code is from factor_analyzer import FactorAnalyzer. I'm getting an error ModuleNotFoundError: No module named 'factor_analyzer'. I'm using Python 3.6 and Jupyter notebook. Do you know why this does not work? Thank you!!
0
1
5,421
0
47,985,532
0
0
0
0
1
false
1
2017-12-26T12:27:00.000
0
2
0
How to read data in HDF5 format file partially when the data is too large to read fully
47,978,664
0
python,hdf5,h5py
You can slice h5py datasets like numpy arrays, so you could work on a number of subsets instead of the whole dataset (e.g. 4 100000*10000 subsets).
I am engaged in analysing HDF5 format data for scientific research purposes. I'm using Python's h5py library. Now, the HDF file I want to read is so large. Its file size is about 20GB and the main part of its data is 400000*10000 float matrix. I tried to read the data once, but my development environment Spyder was ter...
0
1
1,280
0
47,990,202
0
0
0
0
1
true
0
2017-12-27T08:43:00.000
2
2
0
How does Keras read input data?
47,988,983
1.2
python,machine-learning,neural-network,keras,keras-layer
input_dim=3 means that your data have 3 features which will be used to determine final result eg. if you want to determine what animal data refer to you could put width, height and color as data. 100 examples of different animals widths, heights and colors combinations allow neural network to adjust its parameters (lea...
I am using Keras for a project and I don't understand how Keras uses data input, that is to say how Keras reads our input data when creating the first layer. For example: model = Sequential() model.add(Dense(10, activation='sigmoid', input_dim=3,name='layer1')) In this model, what does it mean to have 10 neurons an...
0
1
1,223
0
49,556,042
0
0
0
0
1
false
0
2017-12-28T07:39:00.000
1
1
0
Neural network with a single out with tensorflow
48,003,535
0.197375
python,tensorflow,machine-learning,computer-vision,deep-learning
Just use the sigmoid layer as the final layer. There's no need for any cross entropy when you have a single output, so just let the loss function work on the sigmoid output which is limited to the output range you want.
I want to make a neural network that has one single output neuron on the last layer that tells me the probability of there being a car on an image (the probability going from 0 - 1). I'm used to making neural networks for classification problems, with multiple output neurons, using the tf.nn.softmax_cross_entropy_with_...
0
1
430
0
48,015,138
0
0
0
0
1
false
0
2017-12-28T22:20:00.000
0
1
0
Neural Network: Extra features used for training but not for predicting new data
48,015,101
0
python,neural-network,keras,recurrent-neural-network
The number of goals would be an output, not an input. For example, you could build a model to predict how many goals each team would score... If you used goals scored as an input, the model train to be incredibly simple and useless- just comparing the goals, ignoring all other inputs.
I want to do a neural network to predict who is going to win a soccer game. I have several features (like the team, the physical shape of the team, etc.) and an output, telling which team won (or if there was a die). In my training, I want to add features like the number of goals these teams scored. The problem is that...
0
1
26
0
50,180,152
0
0
0
1
2
false
4
2017-12-29T17:21:00.000
0
5
0
AWS Glue Truncate Redshift Table
48,026,111
0
python,amazon-web-services,pyspark,amazon-redshift,aws-glue
You need to modify the auto generated code provided by Glue. Connect to redshift using spark jdbc connection and execute the purge query. To spin up Glue containers in redshift VPC; specify the connection in glue job, to gain access for redshift cluster. Hope this helps.
I have created a Glue job that copies data from S3 (csv file) to Redshift. It works and populates the desired table. However, I need to purge the table during this process as I am left with duplicate records after the process completes. I'm looking for a way to add this purge to the Glue process. Any advice would be ...
0
1
4,214
0
65,486,258
0
0
0
1
2
false
4
2017-12-29T17:21:00.000
2
5
0
AWS Glue Truncate Redshift Table
48,026,111
0.07983
python,amazon-web-services,pyspark,amazon-redshift,aws-glue
The link @frobinrobin provided is out of date, and I tried many times that the preactions statements will be skiped even you provide a wrong syntax, and came out with duplicated rows(insert action did executed!) Try this: just replace the syntax from glueContext.write_dynamic_frame.from_jdbc_conf() in the link above to...
I have created a Glue job that copies data from S3 (csv file) to Redshift. It works and populates the desired table. However, I need to purge the table during this process as I am left with duplicate records after the process completes. I'm looking for a way to add this purge to the Glue process. Any advice would be ...
0
1
4,214
0
48,042,507
0
0
0
0
1
false
0
2017-12-30T18:28:00.000
0
3
0
Acceptance-rate in PyMC3 (Metropolis-Hastings)
48,036,741
0
python,pymc3
Let step = pymc3.Metropolis() be our sampler, we can get the final acceptance-rate through "step.accepted" Just for beginners (pymc3) like myself, after each variable/obj. put a "." and hit the tab key; you will see some interesting suggestions ;)
Does anyone know how I can see the final acceptance-rate in PyMC3 (Metropolis-Hastings) ? Or in general, how can I see all the information that pymc3.sample() returns ? Thanks
0
1
551
0
48,048,843
0
0
0
0
1
false
0
2018-01-01T07:06:00.000
2
1
0
Are Tensorflow Variables essential?
48,047,793
0.379949
python,tensorflow
The main benefit of using tf.Variables is you don't have to explicitly state what to optimize when you train a neural network. From the perspective of Machine Learning, Variables are network parameters (or weights) which have some initial value before training but get optimized during training (The gradients of the los...
I pretty much understand the concept of Variable in Tensorflow (I think) but I still haven't found them very useful. The main reason I read it is interesting to use them it's to later restore them, which might be handy in some cases, but you could achieve similar results using numpy.save for saving matrices and values,...
0
1
52
0
48,071,714
0
0
0
1
1
false
0
2018-01-02T18:09:00.000
0
1
0
Sort by two columns, why not do grouping first?
48,065,753
0
python,sql,pandas,sorting,group-by
Here is the answer to it- Grouping is done when you want to pull out the conclusion based on the entire group , like total of sales done,for each of the groups(in this case John and Amy) . It is used mostly with an aggregate function or sometimes to select distinct records only. What you wrote above is sorting the data...
I have two columns, one is a string field customer containing customer names and the other is a numeric field sales representing sales. What I want to do is to group data by customer and then sort sales within group. In SQL or Pandas, this is normally achieved by something like order by customer, sales on the table. Bu...
0
1
119
0
48,076,093
0
1
0
0
2
false
0
2018-01-03T10:58:00.000
1
2
0
ImportError: No module named cv2 error upon running .py file in terminal
48,076,009
0.099668
python,macos,opencv
Package name is wrong pip install opencv-python Should work.
I am having trouble running a python script file that contains import opencv command. Upon running the file, it gives the following error: ImportError: No module named cv2 I then ran pip install python-opencv but it gave Could not find a version that satisfies the requirement python-opencv (from versions: ) No matching...
0
1
542
0
48,076,121
0
1
0
0
2
false
0
2018-01-03T10:58:00.000
0
2
0
ImportError: No module named cv2 error upon running .py file in terminal
48,076,009
0
python,macos,opencv
I also had this issue. Tried different things. But finally conda install opencv solved the issue for me.
I am having trouble running a python script file that contains import opencv command. Upon running the file, it gives the following error: ImportError: No module named cv2 I then ran pip install python-opencv but it gave Could not find a version that satisfies the requirement python-opencv (from versions: ) No matching...
0
1
542
0
48,109,501
0
1
0
0
1
false
6
2018-01-05T07:42:00.000
1
3
0
Normalizing data to certain range of values
48,109,228
0.066568
python,normalize
You can use sklearn.preprocessing for a lot of types of pre-processing tasks including normalization.
I am a new in Python, is there any function that can do normalizing a data? For example, I have set of list in range 0 - 1 example : [0.92323, 0.7232322, 0,93832, 0.4344433] I want to normalize those all values to range 0.25 - 0.50 Thank you,
0
1
18,367
0
48,117,192
0
0
0
0
1
true
1
2018-01-05T14:37:00.000
5
1
0
How to traverse a sorted set in Redis in reverse order using zscan?
48,115,753
1.2
python,redis,iterator,redis-py
Scanning the Sorted Set with an iterator does not guarantee any order. Use ZREVRANGEBYSCORE for that.
I have a sorted set in Redis with priorities starting from 0 up to 3. I would like to traverse this sorted set from highest to lowest priority using the python iterator zscan_iter. However, using zscan_iter gives me the items starting from 0. Is there a way to reverse the order? Unfortunately, reverse() only works on i...
0
1
884
0
48,118,131
0
0
0
0
1
false
1
2018-01-05T15:21:00.000
0
2
0
Does convolution kernel need to be designed in CNN (Convolutional Neural Networks)?
48,116,484
0
python,neural-network,keras,kernel,conv-neural-network
The actual kernel values are learned during the learning process, that's why you only need to set the number of kernels and their size. What might be confusing is that the learned kernel values actually mimic things like Gabor and edge detection filters. These are generic to many computer vision applications, but inst...
I am new to Convolutional Neural Networks. I am reading some tutorial and testing some sample codes using Keras. To add a convolution layer, basically I just need to specify the number of kernels and the size of the kernel. My question is what each kernel looks like? Are they generic to all computer vision application...
0
1
605