Skip to content

Commit

Permalink
added quotes to character args
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Oct 5, 2015
1 parent f73d424 commit 3ab3076
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions models/files/pythonKnnReg.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ modelInfo <- list(label = "Knn regression via sklearn.neighbors.KNeighborsRegres

python.assign('X',x);python.exec('X = pd.DataFrame(X)')
python.assign('Y',y)

python.exec(paste0('neigh = KNeighborsRegressor(',
'n_neighbors=',param$n_neighbors,',',
'weights=',as.character(param$weights),',',
'algorithm=',as.character(param$algorithm),',',
'weights=\'',as.character(param$weights),'\',',
'algorithm=\'',as.character(param$algorithm),'\',',
'leaf_size=',param$leaf_size,',',
'metric=',as.character(param$metric),',',
'metric=\'',as.character(param$metric),'\',',
'p=',param$p,
')'))
python.exec('neigh.fit(X, Y)')
Expand Down

0 comments on commit 3ab3076

Please sign in to comment.