supervised-learning

Attempting to fit a grid estimator, recieving TypeError : '<' not supported between instances of 'str' and 'int'

给你一囗甜甜゛ 提交于 2021-02-11 12:20:28
问题 I've been attempting to fit a Grid Search K Nearest neighbors Classifier, but am receiving the following Error message TypeError : '<' not supported between instances of 'str' and 'int' X_train compact sa area roofM3 h o glaz glazing_area_distribution 0 0.66 759.5 318.5 220.50 3.5 2 0.40 3 1 0.76 661.5 416.5 122.50 7.0 3 0.10 1 2 0.66 759.5 318.5 220.50 3.5 3 0.10 1 3 0.74 686.0 245.0 220.50 3.5 5 0.10 4 4 0.64 784.0 343.0 220.50 3.5 2 0.40 4 ... ... ... ... ... ... ... ... ... 609 0.98 514.5

Finding the optimal combination of inputs which return maximal output for a black box model

筅森魡賤 提交于 2021-02-10 05:24:06
问题 One of the challenges that I have been facing when applying ANN to regression tasks on my job is that in order to find the optimal out for a given range of inputs, I have to feed a multidimensional meshgrid to my model and then simply pick the highest value. However, this is overall a very computationally costly solution. The lenght of the text bellow might be scary but it just my attempt to better explain it. Let me explain with other words. Supposing that I have 9 inputs for my ANN, and

Use pretrained model with different input shape and class model

北城余情 提交于 2021-02-04 17:37:30
问题 I am working on a classification problem using CNN where my input image size is 64X64 and I want to use pretrained model such as VGG16 , COCO or any other. But the problem is input image size of pretrained model is 224X224 . How do I sort this issue. Is there any data augmentation way for input image size. If I resize my input image to 224X224 then there is very high chance of image will get blurred and that may impact the training. Please correct me if I am wrong. Another question is related

How to compute precision,recall and f1 score of an imbalanced dataset for K fold cross validation with 10 folds in python

拟墨画扇 提交于 2020-12-27 10:09:34
问题 I have an imbalanced dataset containing binary classification problem.I have built Random Forest Classifier and used k fold cross validation with 10 folds. kfold = model_selection.KFold(n_splits=10, random_state=42) model=RandomForestClassifier(n_estimators=50) I got the results of the 10 folds results = model_selection.cross_val_score(model,features,labels, cv=kfold) print results [ 0.60666667 0.60333333 0.52333333 0.73 0.75333333 0.72 0.7 0.73 0.83666667 0.88666667] I have calculated

How to compute precision,recall and f1 score of an imbalanced dataset for K fold cross validation with 10 folds in python

纵饮孤独 提交于 2020-12-27 10:09:12
问题 I have an imbalanced dataset containing binary classification problem.I have built Random Forest Classifier and used k fold cross validation with 10 folds. kfold = model_selection.KFold(n_splits=10, random_state=42) model=RandomForestClassifier(n_estimators=50) I got the results of the 10 folds results = model_selection.cross_val_score(model,features,labels, cv=kfold) print results [ 0.60666667 0.60333333 0.52333333 0.73 0.75333333 0.72 0.7 0.73 0.83666667 0.88666667] I have calculated

How to compute precision,recall and f1 score of an imbalanced dataset for K fold cross validation with 10 folds in python

牧云@^-^@ 提交于 2020-12-27 10:06:31
问题 I have an imbalanced dataset containing binary classification problem.I have built Random Forest Classifier and used k fold cross validation with 10 folds. kfold = model_selection.KFold(n_splits=10, random_state=42) model=RandomForestClassifier(n_estimators=50) I got the results of the 10 folds results = model_selection.cross_val_score(model,features,labels, cv=kfold) print results [ 0.60666667 0.60333333 0.52333333 0.73 0.75333333 0.72 0.7 0.73 0.83666667 0.88666667] I have calculated

What is the difference between x_test, x_train, y_test, y_train in sklearn?

微笑、不失礼 提交于 2020-07-20 06:34:55
问题 I'm learning sklearn and I didn't understand very good the difference and why use 4 outputs with the function train_test_split. In the Documentation, I found some examples but it wasn't sufficient to end my doubts. Does the code use the x_train to predict the x_test or use the x_train to predict the y_test? What is the difference between train and test? Do I use train to predict the test or something similar? I'm very confused about it. I will let below the example provided in the

What is the difference between x_test, x_train, y_test, y_train in sklearn?

ε祈祈猫儿з 提交于 2020-07-20 06:34:08
问题 I'm learning sklearn and I didn't understand very good the difference and why use 4 outputs with the function train_test_split. In the Documentation, I found some examples but it wasn't sufficient to end my doubts. Does the code use the x_train to predict the x_test or use the x_train to predict the y_test? What is the difference between train and test? Do I use train to predict the test or something similar? I'm very confused about it. I will let below the example provided in the

Naive Bayes in Quanteda vs caret: wildly different results

眉间皱痕 提交于 2020-01-01 12:23:31
问题 I'm trying to use the packages quanteda and caret together to classify text based on a trained sample. As a test run, I wanted to compare the build-in naive bayes classifier of quanteda with the ones in caret . However, I can't seem to get caret to work right. Here is some code for reproduction. First on the quanteda side: library(quanteda) library(quanteda.corpora) library(caret) corp <- data_corpus_movies set.seed(300) id_train <- sample(docnames(corp), size = 1500, replace = FALSE) # get

What is the difference between supervised learning and unsupervised learning?

感情迁移 提交于 2019-12-28 03:15:08
问题 In terms of artificial intelligence and machine learning, what is the difference between supervised and unsupervised learning? Can you provide a basic, easy explanation with an example? 回答1: Since you ask this very basic question, it looks like it's worth specifying what Machine Learning itself is. Machine Learning is a class of algorithms which is data-driven, i.e. unlike "normal" algorithms it is the data that "tells" what the "good answer" is. Example: a hypothetical non-machine learning