Pythonfag here, running a silhouette analysis on my k-means clustered data. I have a bunch of vectors and for every one I have to calculate an AI (the average distance between that vector and other vectors within the same cluster) and a BI (the lowest average distance to all vectors from another cluster).
Here's part of the code: for cluster,clusterNumber in zip(clusterDict.values(),range(len(clusterDict))): aiList = [] for vector1 in cluster: listOfDistancesAI = [] for vector2 in cluster: distanceAI = silhouetteDistance(vector1,vector2) listOfDistancesAI.append(distanceAI) averageDistanceAI = sum(listOfDistancesAI)/len(listOfDistancesAI) aiList.append(averageDistanceAI)
biList = [] for vector, clusterNumber in zip(cluster,range(len(clusterDict))): clusterDistanceList = [] for otherCluster in clusterDict.values(): listOfDistancesBI = [] for vector2 in otherCluster: distanceBI = silhouetteDistance(vector,vector2) listOfDistancesBI.append(distanceBI) averageDistanceBI = sum(listOfDistancesBI)/len(listOfDistancesBI) clusterDistanceList.append(averageDistanceBI) clusterDistanceList[clusterNumber] = 10**100 biList.append(min(clusterDistanceList)
The vectors are fed from a dictionary which has a key for every cluster and then a list of vectors as values. The problem is, the AI values are getting calculated just fine, but its only calculating 9 BI values. The amount of vectors in the cluster should match the number of AI and BI values. The biList.append statement is in the for-loop for the vectors, so it should be appending as many BI values as there are vectors. As it happens, 9 is the amount of clusters I'm telling my k-means algorithm to make, so stuff might be in the wrong loop?
Oliver Baker
>C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework.
Evan Hill
A NI ME
Christopher Clark
Sounds about right.
Isaac Perez
Yes, that is correct
Benjamin Campbell
>20 MB
Jaxon Turner
On windows how can i know if something is printing? also how can i get the page count?
On command i need this on command i have yet to find something useful
inb4 not programming i need this to implement a feature
Jaxson Long
20MB is cheaper than the book, faggot.
Gabriel Rivera
>the picture holy fuck
Christopher Hernandez
I never really cared for anime but holy fucking shit that is the cutest thing I have ever fucking seen what the fuck
Isaiah Reed
Does anyone have ideas for simple (or very slightly complicated) multi-threaded programs? Something like the DPT challenges but with multiple threads in mind.
Joshua Thomas
how do i make a pair variable in scheme? i do define but it's making it a procedure and giving me errors when i try to car or cdr
Ryder Ward
producer consumer
Gavin Collins
(define pair (cons 1 2))
Zachary Reyes
UMARU Yaaaaaaasssssss boooy finally umaru-chan dpt is back in town baby
Jaxson Hughes
I just always wondered what 1.5k pages of book took up
William Torres
nm i forgot to do prefix notation in a spot
Andrew Rodriguez
...
Nathan Ortiz
Wouldn't having your computer on the floor cause a lot of upper body pain from looking down for hours, Umaru-chan desu wa?
Yes, it is true anons, I am a newfriend when it comes to databases, i literally dont know shit. This is why i am asking for a point in the right direction.
Ive just read that mySQL is good, up to a certain point, then it can get slow. That is all really,
just remove the /preview from the url and you'll get the google drive normal interface, with the download button at the top
Tyler Sullivan
they're shit, have fun paying for a fucking basic ass IDE, and top kek if you fell for the scala meme, scala is shittier and less relevant than both java and C#
Jaxson Ramirez
>jetbrains.com/ i like the part where you felt the need to include a link to their website... shill
James Garcia
i want to fug sirufin
Caleb Gray
...
Austin Jenkins
>scala actually their language is fucking kotlin, even more shit and obscure
Gavin Butler
How does she slide past the green seat cushion? Why does she have a booby mousepad with no design on it? Where can I get a DOLL computer?
Easton Davis
It's a cat with cheeks as the rests
fucking perv
Kevin Torres
now
that's what i call
cheeky
Charles Roberts
That's boring af tho.
James Watson
Oh senpai, I got the best idea for my web based file manager. Make all functionality a plugin.
Camden Long
then it's not really web based is it
Nolan Long
THAT'S EVEN CUTER
Henry Powell
What do you mean? It's just a website for file management. I want users to choose only the plugins they want.
Luke Ross
can someone write me a one liner of this function?
two lines, but you get the idea. I refuse to write a messy abomination.
>which one can be understood faster when something needs to be changed? test2 indeed, it's declarative.
Jordan Ward
>test2 indeed, it's declarative.
could you understand the code of test2 function faster than test1 ?
Eli Cooper
look
Angel Nguyen
True, the error is in the 2nd parameter of the zip. Namely the a[1:]. It must be the init of the sequence, i.e. a[:-1].
I like this one better though.
Adam Mitchell
explanations: itertools is the go to for this kind of thing, although sum and zip are standard functions. I started by sum because the vp is indeed the sum of something, the sum of p[0]*q[1] - p[1]*q[0], where p is drawn from a and q is drawn from a, shifted, and that's the only subtelty in fact. I had to check the docs btw
btw it's the shoelace formula rite?
oh clearly yes! it's direct, it totally reads like English or almost. Maybe I'd do three lines and separate a_shifted in its own variable, but that's the only thing. That for loop clearly takes too long to break down.
Gabriel Hughes
I bought The Shellcoder's Handbook and couldn't finish the first chapter because they require you to understand x86 assembly. So where should I go to learn that?
I know lambda is the way, but naming functions and values out is also an option mate. To me this version, while more true to the original, is no better than a muddy for-loop. After all, isn't the One Question to separate true masterlangs from garbage, can your language abstract away an iteration?
Luis Miller
>r8 my reverse string function niggers
first of all, i'm not a nigger nor male.
and your function is not good!
Brayden Turner
stackoverflow/10
Wyatt Cooper
U welcome. Also functional constructs are the way, remember it.
Cooper Jones
except it's not this function is so short I'm sure someone else wrote the same
Dominic Rodriguez
it's alright user
Justin Myers
i did an implementation of Kmeans in C++, shouldn't one of the vector distance values always be 0 because it is the distance from the vector to itself, thus giving you 0 and 9 other values?
Elijah Perry
i thought you meant like a browser plugin
Xavier Perry
do you usually write one-liners when writing code? can other people understand?
do prefer writing it that way or normal pseudo-code?
Nathan Allen
thanks 3/2 satan
Josiah Smith
absolutely disgusting
Christian Fisher
Write something better then teach me senpai
Jace Edwards
>nor male are you a female or some kind of queer
post feet
Anthony Russell
>nor male You know the rules, tits and timestamp.
Tyler Edwards
>normal pseudo-code normies can go die really.
>do you usually write one-liners when writing code? >can other people understand? I admit I have no experience team-programming in Python 3. Maybe if I take this internship I'm on, they'll respond that itertools is evil if I ask, I don't know.
But regardless of what the populace does, once you swallow the functional red pill, you can't forget the truth, so I hope I'll find myself places filled with like-minded folks.
Isaac Nelson
btw I no Scheme isn't functional, it's just that I don't know how to categorise my preferences. Maybe superior masterrace without any adjective, idk
Aaron Lewis
He asked for a one liner :P
Isaiah Foster
> :p
Mason King
What's a good way to get started with android development? I've been skimming through a udacity course but want to start working on my own app soon.
Grayson Adams
Ja richitig, just rambling about. btw this way of programming is enlightened rather than superior, I don't want to come across like an evil bigoted racist. Because that's what C programmers are.
Jason Long
itertools is usually considered good practice, no worries.
Where do you intern?
Jayden Lopez
Start a project involving android dev.
Connor Phillips
wow thanks!
Jacob Cox
I am looking for some papers about writing your own process to get into other process loaded into memory and change value of a specific int variable.
What is this kind of method called?
Easton Robinson
Noice.
Isaiah Ross
A local small business centered on Odoo, so it's a company that provides services for companies, I don't know how to call that in English. Maybe I'll touch NoSQL stuff, or maybe get to explore the territory of some new hardware they've recently gotten. I'm competent in system administration because muh hobbies, but I know a number of languages, and I know Python is how Odoo is made, so there's that. I have an appointment soon, we'll see. Also the boss is family, as if by chance.
Ryan Gutierrez
what is this?
Dominic Howard
We learned Haskell in the first semester of uni (Germany) actually, wasn't until Scala that I have seen it being used in "real-life projects". And, of course, you can use some of these idioms in Python.
What I found out is that at least some FP is a good filter for workplaces: they're less likely to disappoint.
Joseph Martinez
I guess you built it? Nice way to skill up while being useful, unlike most of us. GG
Brody Sullivan
>tfw no nepotism
Kayden Walker
That's nice user
Jace Gonzalez
also, fails when a=[] unlike .
Luke Martin
This is an important development. Some might even call it revolutionary.
Despite its importance, however, the technologies that will underpin this new method of telling lap times are the property of major tech firms who don't necessarily have the public's best interests at heart.