I’m trying to train a Random Forest to classify the species of a set of flowers from the iris dataset. However, the validation looks kind of weird to me, since it looks like the results are perfect, which is something I would not expect. Since I would like to perform a binary classification, I exclude from the training dataset the
Tag: machine-learning
Loading YOLO: invalid index to scalar variable
Getting an error for IndexError: invalid index to scalar variable on the yolo_layers line. This code won’t work on my Jupyter notebook but will run fine on google collab. No idea why. Could be my python version? Answer It’s may caused by the different versions of cv2. The version of cv2 module with CUDA support will give you a 2-D
Adding a column to Pandas Dataframe, randomly fill with values with percentage splits
I want to do a test, train, valid on a pandas dataframe, but I do not want to generate new data frames. Rather, I want to add a new column called ‘Split’ where Split = [‘train’,’valid’,’test’]. I want ‘train’, ‘valid’, ‘test’ to be distributed throughout 64%, 16%, and 20% of the rows randomly, respectively. I know of scikit learn’s train_test_split,
Error with precision_score of XGBoost classifier with RandomizedSearchCV
I’m trying to make a classifier with XGBoost, I fit it with RandomizedSearchCV. Here is the code of my function: When I run the code, I get an error, reported below: When I do the same thing but with GridSearchCV instead of RandomizedSearchCV, the code runs without any problems! Answer It’s not precision_score it’s ‘precision_score’ (with ‘ ‘), like this-
How to continue training with checkpoints using object_detector.EfficientDetLite4Spec tensorflow lite
Preciously I have set my EfficientDetLite4 model “grad_checkpoint=true” in config.yaml. And it had successfully generated some checkpoints. However, I can’t figure out how to use these checkpoints when I want to continue training based on them. Every time I train the model it just start from the beginning, not from my checkpoints. The following picture shows my colab file system
Gradient exploding problem in a graph neural network
I have a gradient exploding problem which I couldn’t solve after trying for several days. I implemented a custom message passing graph neural network in TensorFlow which is used to predict a continuous value from graph data. Each graph is associated with one target value. Each node of a graph is represented by a node attribute vector, and the edges
how to do hyperparameter optimization in large data?
I almost finished my time series model, collected enough data and now I am stuck at hyperparameter optimization. And after lots of googling I found new & good library called ultraopt, but problem is that how much amount of fragment of data should I use from my total data (~150 GB) for hyperparameter tuning. And I want to try lots of
ValueError: Dimensions must be equal, but are 96 and 256 in tpu on tensorflow
I am trying to create a mnist gan which will use tpu. I copied the gan code from here. Then i made some of my own modifications to run the code on tpu.for making changes i followed this tutorial which shows how to us tpu on tensorflow on tensorflow website. but thats not working and raising an error here is
Mismatch of manual computation of a evaluation metrics with Sklearn functions
I wanted to compare the manual computations of the precision and recall with scikit-learn functions. However, recall_score() and precision_score() of scikit-learn functions gave me different results. Not sure why! Could you please give me some advice why I am getting different results? Thanks! My confusion matrix: Answer It should be (check return value’s ordering): Please refer: here
a bug for tf.keras.layers.TextVectorization when built from saved configs and weights
I have tried writing a python program to save tf.keras.layers.TextVectorization to disk and load it with the answer of How to save TextVectorization to disk in tensorflow?. The TextVectorization layer built from saved configs outputs a vector with wrong length when the arg output_sequence_length is not None and output_mode=’int’. For example, if I set output_sequence_length= 10, and output_mode=’int’, it is