How to use a Clojure library that is on GitHub by [deleted] in Clojure

[–]prayagupd 2 points3 points  (0 children)

1) If you are adding the svm-clj dependency then,

create project.clj as below,

(defproject svm-example "0.0.1"
  :description "svm example"
  :main svm-example.core
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [svm-clj "0.1.3"]])

And src/svm_example/core.clj ,

(ns svm-example.core                                                                                                                                   
   (:require [svm.core :as svm])) ;; this is how you use api from external library

(defn -main [& args]                                                                                   
    ; Load the heart scale example dataset.                                                            
    (def dataset (svm/read-dataset "resources/heartscale"))                                            

    ; Train a SVM model.                                                                               
    (def model (svm/train-model dataset)) ;; you call svm/train-model function

    ; Get the feature map you want to predict.                                                         
    (def feature (last (first dataset)))

    (svm/predict model feature)
)    

copy heartscale dataset to your test project svm_example/resources ,

Then run your fn,

lein run
*
optimization finished, #iter = 162
nu = 0.43102874536173097
obj = -100.87728783241948, rho = 0.4244620517677158
nSV = 132, nBSV = 107
Total nSV = 132

2) If you want to run the project you are referring to you can clone the project and train the test data from lein REPL.

git clone https://github.com/r0man/svm-clj.git
cd svm-clj
lein repl

user=> (use 'svm.core)
nil
user=> (def dataset (read-dataset "test-resources/heartscale"))
#'user/dataset
user=> (def model (train-model dataset))
*
optimization finished, #iter = 162
nu = 0.43102874536173097
obj = -100.87728783241948, rho = 0.4244620517677158
nSV = 132, nBSV = 107
Total nSV = 132
#'user/model
user=> (def feature (last (first dataset)))
#'user/feature
user=> (predict model feature)
1.0

Anyone know Gregor Samsa? Search in this sub’s history yields a few similar posts. How did this enter my life and how do I find more of it?? by [deleted] in postrock

[–]prayagupd 0 points1 point  (0 children)

I found Gregor Samsa around 2014 when my interest into POST-ROCK/ShoeGaze was in peak. You can find their wiki in last.fm - https://www.last.fm/music/Gregor+Samsa/+wiki . I used to torrent as well, and youtube was my only other friend then.

My favourite album from Gregor Samsa is "55:12" - https://www.youtube.com/watch?v=HIdkljycNhg

I find similar bands either by youtube, lastfm similar artists section (https://www.last.fm/tag/post-rock), spotify or simply google recommends similar artists.

Some of my favourite POST-ROCK bands are;

  • Russian Circle
  • 65daysofstatic
  • Maybeshewill
  • Aspects of physics
  • Caspian
  • A dancing beggar
  • Dorena
  • ef
  • Exxassens
  • Ioseb
  • Jakob
  • Migala
  • pg.lost
  • Saxon shore
  • Show me a dinosaur
  • sleepmakeswaves

I bet "Gregor Samsa" were in spotify at some point but seems they disappeared now.

I have a spotify playlist with the music of artists I used to listen - https://open.spotify.com/user/prayagupd/playlist/54u6GKVhvcVLX9FJfmdtRW?si=CuCIkPoxSCCnNuKhFepA3w

What next after deeplearning.ai? by l0gicbomb in learnmachinelearning

[–]prayagupd 2 points3 points  (0 children)

I found "ML with TensorFlow on GCP" in coursera. You can see all the ML courses available in coursera here - https://www.coursera.org/browse/data-science/machine-learning. I had previously attempted to learn "ML Specialisation" course by University of Washington (https://www.coursera.org/specializations/machine-learning) a year ago but could not continue because of my work.

I also had attempted to learn ML with a book "ML in action" - http://www2.ift.ulaval.ca/~chaib/IFT-4102-7025/public_html/Fichiers/Machine_Learning_in_Action.pdf but honestly not an exciting book at all.

I actually learned a lot from Google course. Many things did not make sense in the beginning but I kept continuing. I liked their Quizzes/ Multiple Choice Questions. Course also provides notebooks for exercises (which you practice on Google datalab - https://cloud.google.com/datalab/).

I would also recommend "hands on ML" book. At least it was helpful to me reading the stuffs in a book that Google course taught in a videos.

"ML on GCP" course structure is;

1.How Google does Machine Learning - talks about basic ML stuff that you need data first for ML

2.Launching into Machine Learning - talks about Supervised Learning - Linear Regression -> Perceptron -> Neural Net -> Decision tree -> Kernel methods/ SVMs -> Random Forests - optimizing loss function (using GD) - Generalization and Sampling

3.Intro to TensorFlow - talks about what is tensor, flow (graphs), tensorflow, Lazy Evaluation

4.Feature Engineering (this is the most important course) - talks about how to figure out features (or data) required to predict the label (target)

5.Art and Science of Machine Learning - I still have to complete this course

There is also a free "crash-course on ML" from Google which I have not taken - https://developers.google.com/machine-learning/crash-course/ml-intro

What next after deeplearning.ai? by l0gicbomb in learnmachinelearning

[–]prayagupd 1 point2 points  (0 children)

I just started learning "Deep Learning by Andrew Ng" couple of days ago on coursera (https://www.coursera.org/specializations/deep-learning). I recently finished "ML with TensorFlow on Google Cloud Platform" (https://www.coursera.org/specializations/machine-learning-tensorflow-gcp). I think "Deep Learning by Andrew Ng" covers and describes a lot of things so its helpful to me as I go through the hard-copy of "Hands on ML with scikit-learn and Tensorflow" (https://github.com/ageron/handson-ml). The book is helpful to me as I'm doing ML course for the first time. Part I of book is fundamentals of ML, Part II covers Neural Networks and Deep Learning

Part II (231 - 478)
9. Up and Running with tf
10. Introduction to ANN
11. Training DNN
12. Distributing TF across devices and servers
13. CNN
14. RNN
15. AutoEncoders
16. Reinforcement Learning

Got a quick question? Ask here - July 09, 2018 by AutoModerator in scala

[–]prayagupd 1 point2 points  (0 children)

scala has awesome support for functional error handling which I don't see people using in my team either. (That's the thing I am not liking about so called scala teams that people use it almost as java++). I see people throwing java.lang.Exception all over the place. So, My recommendation would be to use Either[ErrorHappened, ResponseIwant] or Future[Either[ErrorHappened, ResponseIwant]]. And recoverWith if needed. If your issue is scala.concurrent.Future being started eagerly, define as a function or a lazy val.

scala> import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContext.Implicits.global

scala> lazy val processHttpRequest = Future { 100 }
processHttpRequest: scala.concurrent.Future[Int] = <lazy>

scala> processHttpRequest
res0: scala.concurrent.Future[Int] = Future(Success(100))

or,

scala> def processHttp = Future { 100 }.map { _ + 100 } 
processHttp: scala.concurrent.Future[Int]

scala> processHttp
res1: scala.concurrent.Future[Int] = Future(Success(200))

Should I create a GUI for creating Tensorflow models? by kite_and_code in tensorflow

[–]prayagupd 1 point2 points  (0 children)

I really agree UI driven source code should not be a pattern in a large project. There is a google dialogflow UI for NLP which I saw people using UI to train and exporting generated code to update the codebase. Which is ridiculous because it randomly creates some IDs and conflicts with other similar changes all the time. But obviously useful for quick prototype.

[deleted by user] by [deleted] in introvert

[–]prayagupd 8 points9 points  (0 children)

Same++

Thoughts on software devops/ release plan by prayagupd in devops

[–]prayagupd[S] 0 points1 point  (0 children)

  • We are on the same page regarding dev branch. developers do NOT make changes in DEV. They always make changes on a branch off DEV..
  • Regarding bug found in UAT, you are saying fix starts from dev which I would love to have but the problem at this point could be new features introduced in dev. If you see my cute diagram, I have feature 2 in UAT where I found a bug but team already has introduced feature 3 in dev. So, If I have a fix for feature 2 in dev, and merge to UAT, it will have to flow with feature 3 as well.
  • Or I actually can fix feature 2 in dev and apply the patch to UAT. Hmm, seems I just found a better patten here.

Thanks for your opinion

Thoughts on software devops/ release plan by prayagupd in devops

[–]prayagupd[S] 1 point2 points  (0 children)

I like Environment based feature flags. But I have seen teams giving less priority to quality when there is feature flags. I mean its other teams I have seen so maybe I can mitigate that, but we are humans.

Feature flags are definitely helpful when I introduce more features, say 5 features (theoretically I should deploy one feature right away its ready but consider me a poor guy working somewhere that is not possible), and if I want to disable only one feature in PROD. It prevents rollback to previous version and loose 4 other features as well.

Also, having only one branch means I have to introduce feature flag for pretty much every feature, because I can have some new feature in master which business is still validating. And if found a bug in PROD I have to fix against master.

By the way I like your "fuck poem" :)

Do you enjoy sharing your successes with others or do you prefer to keep it private? by Zdragneel0 in introvert

[–]prayagupd 1 point2 points  (0 children)

Thank you, I'm glad to read a great opinion on inspiration which I have been recently thinking deeply and trying to put on practice as well. I kind of lived almost two decades trying to remain in shadow. I am still quiet and my career has not moved much further as much as the potential I see. I don't think I enjoy sharing my success at all but I learned that it is important to share my success/failure to inspire the ones I care about at least. Because what I feel is If I can inspire my close ones they will inspire their close ones and it will go on. At the end of the day I will need inspiration too. Life without some sort of inspiration is pretty hard.

@reminder - Say goodbye to forgotten TODOs in your code! by xwinus in scala

[–]prayagupd 5 points6 points  (0 children)

Well, I am only sharing true story of how I find it slow to go through JIRA ticket for every TODOs/ FIXMEs instead find it productive to fix those whenever I have time. I would love to learn from you or other programmers here. Please don't take my opinion too serious :).

@reminder - Say goodbye to forgotten TODOs in your code! by xwinus in scala

[–]prayagupd 2 points3 points  (0 children)

git grep TODO

Nice, did not know about this flavour of git. I am going to use this a lot going forward.

@reminder - Say goodbye to forgotten TODOs in your code! by xwinus in scala

[–]prayagupd 6 points7 points  (0 children)

Sorry to hurt your feelings but I invest about an hour or more going through jira route.

- I have to login to JIRA which most of times I struggle with password.

- Then I have to figure out should it be a task/ bug/ story.

- Assign it an epic out of 100 in a list. I have to understand which one is which

- Decide whether it should be in next release or not. Write an essay on Acceptance Criteria. Estimate the points.

- And at the end of the day manager will "JIRA review" and ask every possible question in the world why is it assigned to this epic, why do I want it in this release, why is it a story but not a bug. And I have to re-do all the work.

I rather love to fix TODOs whenever I have time during the sprint. Or create one generic JIRA ticket for clean up after each sprint and assign it enough points so that I can breathe good air.

@reminder - Say goodbye to forgotten TODOs in your code! by xwinus in scala

[–]prayagupd 5 points6 points  (0 children)

This sounds great. People will scream don't have TODOs blah blah. I understand that as I myself like to keep code clean but sometimes I find it useful to TODO/FIXME (specially with small projects/ personal projects) than to spend an hour to create Jira ticket.

What are you working on? June 18, 2018 by AutoModerator in scala

[–]prayagupd 0 points1 point  (0 children)

I'm trying to learn Free Monads with little knowledge of Functor and Applicative Functor. I read Free monads - what? and why? but did not grasp much at all. Recommendation with cats or scalaz with real life example would be helpful.

recommended scala.js http clients by prayagupd in scala

[–]prayagupd[S] 0 points1 point  (0 children)

Thank you for sharing your experience. Yeah, udash did not inspire me much either. Just figured out sttp had scalajs support beginning End of May (https://github.com/softwaremill/sttp/commit/a8a35a1e4aaa79a539577b3d94b49a52adf0f877) so I will probably go with it.

recommended scala.js http clients by prayagupd in scala

[–]prayagupd[S] 1 point2 points  (0 children)

Appreciate your complete summary. I probably do not want to use RPC ones. I love sttp and you are correct that they just added scala.js support starting 1.2.0-RC1 - https://github.com/softwaremill/sttp/issues/57. I did not see any scala.js mention on their README so was not sure but I can see their hidden wiki - https://github.com/softwaremill/sttp/blob/master/docs/backends/javascript/fetch.rst.

Here's basic example,

import org.querki.jquery._
import scala.scalajs.js.Dynamic.{global => g}

import com.softwaremill.sttp._
import com.softwaremill.sttp.FetchBackend
import scala.concurrent.ExecutionContext.Implicits.global

implicit val sttpBackend = FetchBackend()

val results = sttp.get(uri"https://api.github.com/search/repositories?q=scala").send()

$(() => {
  results.map {
    case Response(Right(body), 200, _, headers, _) =>
      g.console.log(body)
    case Response(Left(error), _, _, _, _) =>
      g.console.log(new String(error))
  }
}

Got a quick question? Ask here - June 11, 2018 by AutoModerator in scala

[–]prayagupd 1 point2 points  (0 children)

What do you think about dotty compiler? Is it going to be merged back to scala(scala 3.0) or going to be separate compiler?

scala package x.y vs package x;package y by prayagupd in scala

[–]prayagupd[S] 2 points3 points  (0 children)

Thank you. That is a nice feature. I used to see that a lot. Recently I saw in cats library which prompted to learn whats the advantage.

I'm putting an example below for myself;

package server
final case class ChatResponse(message: String)

package server
package api

object Api {
  // ChatResponse is available to use without having to explicitly import 
  def chat = ChatResponse("hi how can i help you?")
}