Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can only concatenate str (not "traceback") to str #11101

Open
sinsniwal opened this issue May 6, 2024 · 0 comments · May be fixed by #11102
Open

TypeError: can only concatenate str (not "traceback") to str #11101

sinsniwal opened this issue May 6, 2024 · 0 comments · May be fixed by #11102
Labels
needs triage Needs a response from a contributor

Comments

@sinsniwal
Copy link

Describe the issue:

Minimal Complete Verifiable Example:

# Put your MCVE code here
import dask
import dask.bag as db
import river
# Create a Dask bag from your data
df=pd.DataFrame([[0]*2],columns=['VendorID','fare_amount'])
data = db.from_sequence(df, npartitions=4)

# Define a function to process and train on each partition
def process_and_train(partition):
    X_train,X_test,y_train,y_test=get_dask_train_test(partition)
    model = river.linear_model.LinearRegression(optimizer=river.optim.SGD(0.01), l2=0.1)
    # Stream learning from the DataFrame
    for _,row in partition.iterrows():
        y = row['fare_amount']       # Target
        x = row.drop('fare_amount')  # Features
        model = model.learn_one(x, y)
    print("done")
    return model

# Use Dask to process and train in parallel
models = data.map(process_and_train).compute()

Anything else we need to know?:

Screenshot 2024-05-06 at 7 48 57 PM

Environment:

  • Dask version:
  • Python version:3.10
  • Operating System:
  • Install method (conda, pip, source):pip
@github-actions github-actions bot added the needs triage Needs a response from a contributor label May 6, 2024
@sinsniwal sinsniwal linked a pull request May 6, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs a response from a contributor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant