New anaconda release for M1 (2022.05)

I am trying to install the new Anaconda for M1, I chose 64-Bit (M1) Graphical Installer (428 MB). However, when I download it, it still asks for Rosetta. Is that normal? I saw the demonstration here https://youtu.be/SPZRgwjclWQ and it doesn't ask for Rosetta. Also, do you think keeping Miniforge is a better solution?
Topic: conda anaconda
Category: Data Science

error while running lasso.py

The following is the error code generated while running lasso.py. Can anybody help in fixing the same. Here is the code: from cvxpy import * import numpy as np import cvxopt from multiprocessing import Pool # Problem data. n = 10 m = 5 A = cvxopt.normal(n,m) b = cvxopt.normal(n) gamma = Parameter(nonneg=True) # Construct the problem. x = Variable(m) objective = Minimize(sum_squares(A*x - b) + gamma*norm(x, 1)) p = Problem(objective) # Assign a value to gamma and find the …
Category: Data Science

Using if statement as a model in orange

I am seeking to evaluate logistic regression against a rule-based (nested if-else statements) classification in Orange. The steps I've taken to investigate this are as follows: I could not identify any widgets that would implement this. The closest I could find was the interactive tree from version 2.7, but this widget seems to have been discontinued. I've attempted to generate the results I'm looking for by editing the in_data object produced by creating a tree, sending the results to the …
Category: Data Science

PermissionError for conda env update

I got a very strange error when run conda env create -f environment.yml. Due to proprietary information, I cannot share the content of environemnt.yml, except that it contains a pip section - pip - pip: - sqlalchemy - pyyaml It seems to run OK up to the creation of the requirements.txt file, and then throw the following error Collecting package metadata: done Solving environment: done Preparing transaction: done Verifying transaction: done Executing transaction: done # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback …
Category: Data Science

ValueError: pos_label=1 is not a valid label: array(['N', 'Y'], dtype='<U1')

X = train_encoded_df.iloc[:, 1: ] y = train_encoded_df["Loan_Status"] print("Precision:",metrics.precision_score(y_test, y_pred)) My training data contains the categorical features encoded using get_dummies(). This is causing the error: &gt; ValueError: pos_label=1 is not a valid label: array(['N', 'Y'], dtype='U1') How to fix this?
Category: Data Science

Reading a json-file from an API, getting "AttributeError: 'Response' object has no attribute 'data' "error

Title says it all. Im trying to read a json file im accessing via an API. But when I try, I get the error: 'AttributeError: 'Response' object has no attribute 'data' I don't understand why, as most (not all) of my fellow classmates do not get this error. The code I'm trying to run: [1] import folium [2] import geopandas as gpd [3] import pandas as pd [4] import numpy as np [5] import urllib3 [6] import requests [7] import …
Category: Data Science

Python uses conda-base tensorflow-gpu instead of conda environment installation

I want to create a virtual environment using anaconda for python 3 in which I can use a specific version of tensorflow-gpu. My base conda python is 3.6.8 and the base conda tensorflow-gpu version is 1.10.1. I want to create an environment with python 3.6.9 and tensorflow-gpu 1.11.0. I am running Ubuntu 18.04. To do this, I have been running the following code in my bash: $ conda create --name test_env python=3.6.9 $ conda activate test_env However, when I open …
Category: Data Science

TensorFlow stopped working after installing opencv

I am working on projects that use TensorFlow and Keras and I did the hello-world MNIST project successfully and later I tried to run some other project and TF suddenly stopped working. Now it doesn't even work on the old project. I am working in conda envs and my editor is VSC. Here is the error that I am getting: Traceback (most recent call last): File &quot;c:/Users/miliv/MLRadionica/TensProba.py&quot;, line 3, in &lt;module&gt; from tensorflow import nn File &quot;C:\Users\miliv\Miniconda3\envs\tf\lib\site-packages\tensorflow\__init__.py&quot;, line 101, in …
Category: Data Science

Spacy v2.0.1 custom NER: How to improve training of existing model

I implemented custom NER with bellow trained data first time and it gives me good prediction with Name and PrdName. I mentioned code bellow. if __name__ == '__main__': TRAIN_DATA = [ ('My Name is Rajesh', {'entities': [(11, 17, 'Name')]}), ('My Name is Bakul', {'entities': [(11, 16, 'Name')]}), ('My Name is Pritam', {'entities': [(11, 17, 'Name')]}), ('My Name is Rakesh', {'entities': [(11, 17, 'Name')]}), ('My Name is Jayeeta', {'entities': [(11, 18, 'Name')]}), ('this is the price of bag', {'entities': [(21, 24, …
Category: Data Science

Best practices when creating a virtual environment in Anaconda

I am absolutely confused due to the number of different ways and the abundance of articles explaining how to create a virtual environment in Anaconda. You could use conda or virtualenvironment to create one. Also depending on how you create it, you need to use either conda or pip to install additional libraries. I tried to read but it only confused me more! Up until now I haven't created one and install additional packages using pip into the base folder. …
Category: Data Science

How to setup and run Conda on Google Colab

I am interested in using Google Colab for data modeling. How do I install conda, create an environment and run python in a notebook? I did some searching and found some helpful hints, but had several issues with this. I can only get a partially functional environment so far. I get stuck in running another cell in the same environment. Seems that switching cells resets the environment back to default.
Category: Data Science

How to install boruta in conda?

I want to install boruta in my anaconda environment, but if I execute conda install boruta It displays: PackagesNotFoundError: The following packages are not available from current channels: - boruta Current channels: - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/r/noarch I guess I could install it using the pip that belongs to the Anaconda environment, but I am not sure if that is the best way. Any suggestions?
Category: Data Science

GraphViz not working when imported inside PydotPlus (`GraphViz's executables not found`)

I've been trying to make these packages work for quite some time now but with no success. Basically the error is: GraphViz's Executables not found EDIT: I had not posted a terminal log with the error originally. I'm using Ubuntu now so I won't be able to reproduce the exact same error I got in the past (a year ago, so far away in the past...). However, I've been experiencing a similar --- if not the same --- error in …
Category: Data Science

Anconda R version - How to upgrade to 4.0 and later

I use R through the anaconda navigator, which manages all my package installations. I need to use qgraph for a project, which is dependent on mnormt library, which in turn needs RStudio verion &gt;4.0 I think the solution to my problem would be to upgrade Anaconda R to the latest R version, but the r-base search in conda has no R version greater than 3.6. Any help in upgrading Anaconda R to newer versions would be very useful. The problem …
Category: Data Science

Google Colab conda packages permanently installation

I want to install some conda packages on Google Colab. Installation done successfully, but it wont detect it when we restart the new Colab session. I followed the link "#https://stackoverflow.com/questions/55253498/how-do-i-install-a-library-permanently-in-colab", but still no luck. Please let me know how to install python packages using conda + pip permanently on Google Colab.
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.