[Solved] Why couldn’t I predict directly using Features Matrix?

You are using this method in both training and testing: def encode_string(cat_features): enc = preprocessing.LabelEncoder() enc.fit(cat_features) enc_cat_features = enc.transform(cat_features) ohe = preprocessing.OneHotEncoder() encoded = ohe.fit(enc_cat_features.reshape(-1,1)) return encoded.transform(enc_cat_features.reshape(-1,1)).toarray() by calling: Features = encode_string(combined_custs[‘CountryRegionName’]) for col in categorical_columns: temp = encode_string(combined_custs[col]) Features = np.concatenate([Features, temp],axis=1) But as I said in my comment above, you need to apply … Read more

[Solved] Similarity between two text documents in Python

import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer vect = TfidfVectorizer(min_df=1) tfidf = vect.fit_transform([“My name is Ankit”, “Ankit name is very famous”, “Ankit like his name”, “India has a lot of beautiful cities”]) print ((tfidf * tfidf.T).A) 1 solved Similarity between two text documents in Python

[Solved] Converting list into array in python – Machine Learning

It’s not a must, but it’s very convenient because of a huge amount of handy and very fast (vectorized) functions/methods, provided by Numpy/SciPy modules. Actually most of the machine-learning methods (at least in the sklearn module) will try to convert input arrays into Numpy arrays, in order to be able to use Numpy’s functions/methods. Consider … Read more

[Solved] General Machine Learning Algorithm, Training Set -> “Predictor” [closed]

Well, without the general knowledge of the problem it is almost impossible to answer your question. You basically specified the process of machine learning: Take input, study it, and generate some parameters of the model and then predict results for validation set. it is the insight you provide based on the problem itself as to … Read more

[Solved] Is predicting number of sales a Regression or Classification problem? [closed]

I don’t understand how it is a continuous output. Looks to me like a discrete output having thousands of values. Well, continuous output here has not the formal mathematical meaning; strictly speaking, you are correct in that your output (some integer value) is discrete, but this is not the point in this context. The crucial … Read more

[Solved] What representation of chat text data should I use for user classification? [closed]

You’re asking what ML representation you should use for user-classification of chat text. bag-of-words and word-vector are the main representations generally used in text-processing. However user-classification of chat is not the usual text-processing task, we look for telltale features indicative of a specific user. Here are some: character length, word length, sentence length of each … Read more

[Solved] How to do data exploration before choosing any Machine Learning algorithms [closed]

Firstly, you have to understand Machine Learning as a field, and have some understanding of its sub fields. If you don’t intuitively understand your tools, you won’t be able to identify when to use them. The idea you’re talking about is called exploratory data analysis, and it can be very approachable if you think about … Read more

[Solved] Hello, two questions about sklearn.Pipeline with custom transformer for timeseries [closed]

You can not use target, predicted = pipe.fit_predict(df) with your defined pipeline, because the fit_predict() method can only be used, if the estimator has such a method implemented as well. Reference in documentation Valid only if the final estimator implements fit_predict. Also, it would only return the predictions, so you can not use target,predicted = … Read more

[Solved] How to use Recurrent Neural Network to play simple 2D Java game?

Some good library’s can be found in GitHub but that’s not what you should be looking for. To start up you need a training technique for your RNN, i would personally recommend NEAT (Neuroevolution of augmenting topologies) which uses RNN in a Genetic Algorithm, there is many videos explaining how it works and implementations in … Read more